Author Topic: GNU ld ?: meaning of *(.text .text.*)  (Read 8866 times)

Offline syakovlev

  • Newbie
  • *
  • Posts: 20
    • View Profile
GNU ld ?: meaning of *(.text .text.*)
« on: May 10, 2008, 10:07:16 PM »
There is a line
*(.text .text.*)
in linker file m52235evb-rom.ld.
What does it exactly mean?
In GNU ld manuals I've found:

"For example,
.text . : { *(.text) }
and
.text : { *(.text) }
are subtly different. The first will set the address of the `.text' output section to the
current value of the location counter. The second will set it to the current value of the
location counter aligned to the strictest alignment of a `.text' input section."

"There are two ways to include more than one section:
*(.text .rdata)
*(.text) *(.rdata)
The difference between these is the order in which the `.text' and `.rdata' input sections
will appear in the output section. In the frst example, they will be intermingled, appearing
in the same order as they are found in the linker input. In the second example, all `.text'
input sections will appear first, followed by all `.rdata' input sections."

Thx.
Sergei.

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: GNU ld ?: meaning of *(.text .text.*)
« Reply #1 on: May 12, 2008, 01:29:34 PM »
Hi Sergei

Maybe someone else will be able to give more details, but I don't know exactly the way that this is interpreted.

The linker script in the project is more or less the standard one which is included in the CodeSourcery GCC distribution - this will handle C and C++ (although only the C part is important for the uTasker project) and essentially puts all code and constants in to FLASH. As you have already found out, the ordering of the sections can be controlled but this is not actually important in the uTasker project.

Personally I find that not all details can easily be found in the GCC documentation. There are lots of nuances which are probably only known to people working on the code or with lots of experience with it.

Perhaps you could find more information directly from CodeSourcery?

Regards

Mark