This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: sections, overview of their meaning?


Hi Torsten,

there are lots of different sections in linker scripts, i know
some of them but there are quite many that i don't know.

Is there somewhere an overview on the sections and what is meant
to go into them?

Sorry no. Sections can have arbitrary names and arbitrary contents, and there is no one single place where these names and contents are specified.


Some section names are commonly known and have a reasonably well defined purpose. You probably know these names already. eg: .text for code, .data for initialised, modifiable data, .bss for zero-initialised or uninitialised data, .rdata for non-modifiable data.

Other sections are often documented in the EABI for each particular processor. So for example the ARM EABI describes sections called .ARM.exidx and .ARM.attributes. (I tried to find a V850 based example, but I cannot find the ABI for this processor).

Otherwise the best guess is the name of the section itself. Sometimes there will be comments in the linker script explaining what the section is for, but this is not always done. For example the .zdata data section used by the V850 linker scripts is there for data that is accessed relative to r0 register, as hinted at by the "z" in the name, and the .rosdata section is for read-only data that is accessed via the global pointer register (r4), as hinted at by the definition of the __gp symbol in the .sdata section.

For sections that still mystify you please feel free to ask on this list, or search for references to them in the code for gas and gcc.

Cheers
  Nick



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]