Reply by Tauno Voipio April 11, 20052005-04-11
Mayank Kaushik wrote:
> Im the OP, i would like to reiterate the following comment: > > >>I didn't find GCCs linker scripts particularly difficult other than a > > >>marked absence of information on what sections the compiler will > > produce. > > Im a senior undergrad who has just started working with the GNU-ARM > toolchain. Ive found it difficult to understand what sections the > compiler would produce, and how to map them in the appropriate output > section (.text or .data, since these are the only two i would extract > from the *.elf file to make a final *.bin file that would be loaded > onto the chip). Would someone please help me with that. > > Regards, > Mayank >
Mayank, mail me with a good return address. Correct the address in my sig in the obvious way. -- Tauno Voipio tauno voipio (at) iki fi
Reply by Mayank Kaushik April 11, 20052005-04-11
Im the OP, i would like to reiterate the following comment:

> I didn't find GCCs linker scripts particularly difficult other than a
> marked absence of information on what sections the compiler will
produce. Im a senior undergrad who has just started working with the GNU-ARM toolchain. Ive found it difficult to understand what sections the compiler would produce, and how to map them in the appropriate output section (.text or .data, since these are the only two i would extract from the *.elf file to make a final *.bin file that would be loaded onto the chip). Would someone please help me with that. Regards, Mayank
Reply by R Adsett April 11, 20052005-04-11
In article <3bv8v4F695at9U3@news.dfncis.de>, broeker@physik.rwth-
aachen.de says...
> R Adsett <radsett@junk.aeolusdevelopment.cm> wrote: > > In article <3btd61F6igslaU1@news.dfncis.de>, broeker@physik.rwth- > > aachen.de says... > > > > info gcc "Invoking GCC" "Spec Files" > > > > > > (of GCC-3.4.1), or in the equivalent space of whatever format of the > > > docs you're looking at. > > > Hmm, all that gets me are some errors and in particular > > Come, now, you sure know that "some errors" is no way to report a > problem...
You're right, I was brushing quickly past it since they weren't visible long enough to decipher. Which just left the following which yo kindly deciphered.
> > > Unable to find node referenced by `Spec Files' in > > `(gcc.info.gz)Invoking GCC'. > > That means you have info installed, and a gcc info file installed in a > place where info finds it --- but it's not the one for a recent GCC. > There's a reasion I mentioned the version number being referred to, > see?
Ahh, I'll have to update, although as a documentation medium info doesn't shine. In any case the web link I found does seem to be what you were referring to. It'll do for my initial explorations. Robert
Reply by R Adsett April 11, 20052005-04-11
In article <4259C29C.8F2657CD@yahoo.com>, cbfalconer@yahoo.com says...
> R Adsett wrote: > > broeker@physik.rwth-aachen.de says... > > > ... snip ... > >> > >> info gcc "Invoking GCC" "Spec Files" > >> > >> (of GCC-3.4.1), or in the equivalent space of whatever format of > >> the docs you're looking at. > > > > Hmm, all that gets me are some errors and in particular > > > > Unable to find node referenced by > >`Spec Files' in `(gcc.info.gz)Invoking GCC'. > > > > I did find > > > > http://www.cse.ohio-state.edu/cgi-bin/info/info/gcc,Spec%20Files > > > > which I will take a look at. > > Sounds as if you haven't got the info system properly installed. > "Info" by itself should bring up a master menu and an optional > tutorial.
Seems likely, although it's a straightforward cygwin install. I just did a little more exploration and it seems that some of the nodes are missing and that's one of them. Odd, I'll have to fix that. In any case the web link seems to be the same source. Robert
Reply by Hans-Bernhard Broeker April 11, 20052005-04-11
R Adsett <radsett@junk.aeolusdevelopment.cm> wrote:
> In article <3btd61F6igslaU1@news.dfncis.de>, broeker@physik.rwth- > aachen.de says...
> > info gcc "Invoking GCC" "Spec Files" > > > > (of GCC-3.4.1), or in the equivalent space of whatever format of the > > docs you're looking at.
> Hmm, all that gets me are some errors and in particular
Come, now, you sure know that "some errors" is no way to report a problem...
> Unable to find node referenced by `Spec Files' in > `(gcc.info.gz)Invoking GCC'.
That means you have info installed, and a gcc info file installed in a place where info finds it --- but it's not the one for a recent GCC. There's a reasion I mentioned the version number being referred to, see? -- Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de) Even if all the snow were burnt, ashes would remain.
Reply by CBFalconer April 10, 20052005-04-10
R Adsett wrote:
> broeker@physik.rwth-aachen.de says... >
... snip ...
>> >> info gcc "Invoking GCC" "Spec Files" >> >> (of GCC-3.4.1), or in the equivalent space of whatever format of >> the docs you're looking at. > > Hmm, all that gets me are some errors and in particular > > Unable to find node referenced by >`Spec Files' in `(gcc.info.gz)Invoking GCC'. > > I did find > > http://www.cse.ohio-state.edu/cgi-bin/info/info/gcc,Spec%20Files > > which I will take a look at.
Sounds as if you haven't got the info system properly installed. "Info" by itself should bring up a master menu and an optional tutorial. -- "If you want to post a followup via groups.google.com, don't use the broken "Reply" link at the bottom of the article. Click on "show options" at the top of the article, then click on the "Reply" at the bottom of the article headers." - Keith Thompson
Reply by R Adsett April 10, 20052005-04-10
In article <3btd61F6igslaU1@news.dfncis.de>, broeker@physik.rwth-
aachen.de says...
> R Adsett <radsett@junk.aeolusdevelopment.cm> wrote: > > broeker@physik.rwth-aachen.de says... > > [...] > > > command line you've never used before. Nowadays, the syntax of spec > > > files format is even documented properly. > > > It is? That's good news, where? > > info gcc "Invoking GCC" "Spec Files" > > (of GCC-3.4.1), or in the equivalent space of whatever format of the > docs you're looking at.
Hmm, all that gets me are some errors and in particular Unable to find node referenced by `Spec Files' in `(gcc.info.gz)Invoking GCC'. I did find http://www.cse.ohio-state.edu/cgi-bin/info/info/gcc,Spec%20Files which I will take a look at. Robert
Reply by Grant Edwards April 10, 20052005-04-10
On 2005-04-10, Hans-Bernhard Broeker <broeker@physik.rwth-aachen.de> wrote:

>> I've never been brave enough to hack on a specs file. > > If you're brave enough to hack linker scripts, you can brave spec > files, too. It's no more difficult to read and fiddle with a specs > file than it'd be to second-guess what gcc would do for a given > command line you've never used before. Nowadays, the syntax of spec > files format is even documented properly.
But since I've got to write a linker script anyway, why bother with a specs file? I don't really see much of an advantage. It seems simpler to have the target-specific stuff in one file.
> The specs file is (among other things) GCC's way of encoding > the dependencies between compile-time flags and linker > invocations.
It's an interesting idea. I'll have to try it on my next project.
>>> It was supposed to be informed about these as part of the job of >>> porting GCC to that hardware platform. > >> If I had to port GCC to each hardware platform I'd never get >> anything done. > > I don't think it's significantly harder to do the port than to > experiment with your general-purpose GCC until it fits the new > platform.
Not sure what you mean. I don't have to experiment with gcc at all. I just write a linker script.
> It involves nothing more than to formalize the knowledge you > have about that platform a little more strictly. It's an > exercise in putting information in one place (the GCC target > specification) rather than repeating it in the Makefile of > every piece of software you'll ever write to run on that > particular target.
That's a good point. -- Grant Edwards grante Yow! I just had my entire at INTESTINAL TRACT coated visi.com with TEFLON!
Reply by Hans-Bernhard Broeker April 10, 20052005-04-10
R Adsett <radsett@junk.aeolusdevelopment.cm> wrote:
> broeker@physik.rwth-aachen.de says...
[...]
> > command line you've never used before. Nowadays, the syntax of spec > > files format is even documented properly.
> It is? That's good news, where?
info gcc "Invoking GCC" "Spec Files" (of GCC-3.4.1), or in the equivalent space of whatever format of the docs you're looking at. -- Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de) Even if all the snow were burnt, ashes would remain.
Reply by Tauno Voipio April 10, 20052005-04-10
Grant Edwards wrote:
> On 2005-04-10, Hans-Bernhard Broeker <broeker@physik.rwth-aachen.de> wrote: > >>Mayank Kaushik <prehistorictoad2k@yahoo.com> wrote: >> >> >>>arm-elf-ld -L --cref >> >>Generaly speaking, it's rarely a good idea to invoke 'ld' >>yourself when linking C or C++ programs. Have 'gcc' invoke it >>for you instead. Unless the GCC port is buggy, it'll know how >>to invoke ld correctly. > > > I've rarely found that to be true when working in an embedded > environment. I've always had to use a custom linker script and > disable most of the default startup file linkage. >
My vote to this, too. No need to re-build GCC & co for each target system. The trick is to use -Wl for gcc command line (in Makefile): LDFLAGS = -g -nostartfiles -Wl,-Map=$(TRG).map,--cref,-T,aif.ld -- Tauno Voipio tauno voipio (at) iki fi