[PATCH] SHF_MERGE support for gas and ld (was RFC: .gnu.strtab ...)

Jakub Jelinek jakub@redhat.com
Tue Apr 10 15:53:00 GMT 2001


On Mon, Apr 02, 2001 at 12:59:15PM -0700, Ian Lance Taylor wrote:
> Jakub Jelinek <jakub@redhat.com> writes:
> 
> > Do you mean without the gas/write.c change in the patch?
> 
> That is what I meant, yes.
> 
> > and the addend is in the instructions:
> 
> Bother.  You're right.
> 
> If you're going to change gas to preserve the symbols by default, then
> I guess you can change the linker to discard the symbols by default.

Unfortunately, I found today one more complication with the relocations
against .L symbols in SEC_MERGE sections, because ld -r screws this up
(two .o files ld -r'ed together can use the same .L symbol name for
different strings).
So I'm wondering whether it is better to add yet more generic changes
(basically SEC_MERGE merging would have to be done during ld -r as well,
plus ld -r would have to create new local symbols on the fly into the
SEC_MERGE sections (because the old ones from input objects may clash)
and change relocations against local symbols in SEC_MERGE sections to be
against the newly on-the-fly created symbols.
This looks horribly to me, so I wonder if it would not be better to actually
touch all elf*.c files (the required change would be just a couple of lines
on at least the vast majority, perhaps mips would be harder).
Will code it tomorrow and mail it here.

	Jakub



More information about the Binutils mailing list