ld changing section names with attr "a" (ALLOC)
Fri Jul 23 16:32:00 GMT 2004
> "GNU ld version 2.13.1" Cross-compiled for MIPS on x86.
First off, when reporting bugs, please use the latest release of
binutils (which in this case is 2.15) or, even better, the current
sources in the CVS repository.
As it happens this bug is present in the current sources as well, but it
is always best to use the most up-to-date sources that you can.
>  mips-elf-ld --section-start .new_section=0x8000 test.o -o
> I case of command  I see that linker adds the suffix ".1"
> to the my new section name:
> (and does *not* place it at the address I want)
Well strictly speaking it does place a section called .new.section at
address 0x8000, it is just that this section does not have the contents
(or attributes) of .new.section from the test.o input file. Instead
these are given to a newly created new.section.1.
The problem is a bug in the place_orphans() function which assumes that
since the .new.section in the test.o input file was not named in the
linker map it will have to create a section in the output file to hold
its contents. It tries to create a section called .new.section but
discovers that the linker has already created a section by this name.
So it assumes that the linker did not use this section because a
mismatch in the section's attributes and so it goes on to create a brand
new section name .new.section.1.
The patch below resolves this problem by teaching the place_orphan
function that it is OK to use a section name that already exists
provided that that section does not have any flags set. Such a section
will have been created by the linker in response to a --section-start
2004-07-23 Nick Clifton <firstname.lastname@example.org>
* emultempl/elf32.em (_place_orphan): Use an already existing
section name if that section does not have any flags set.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
More information about the Binutils