RFC: .gnu.strtab (aka merging duplicate strings by ld)

Jakub Jelinek jakub@redhat.com
Thu Mar 29 11:58:00 GMT 2001


On Wed, Mar 28, 2001 at 12:24:59PM -0800, Ian Lance Taylor wrote:
> Jakub Jelinek <jakub@redhat.com> writes:
> 
> > On Wed, Mar 28, 2001 at 11:55:33AM -0800, Ian Lance Taylor wrote:
> > > An implementation which requires changing every ELF backend file is
> > > clearly problematical.  Is it required?  Can you simply adjust the
> > > symbol values in elf_link_input_bfd?
> > 
> > I'll try to write something using information retrieved from
> > bfd_reloc_type_lookup. I need to get at addend at least.
> > Will see.
> 
> I'm not suggesting that you do the relocation processing in
> elf_link_input_bfd.  That would be hard or impossible.  I'm suggesting
> that you manipulate the local symbol values so that the local symbol
> has the correct address for the relocation processing done by the
> backend.

That would work iff we kept relocations against local symbols in the
SHF_MERGE sections (ie. not change them to section symbol + addend)
and disallowed any relocations where going from base address to base address
+ addend would cross object boundaries in the section (by disallowing I mean
not treating them as SHF_MERGE if this is condition is not met).
That IMHO is a valid requirement (because due to SHF_MERGE semantics the
object past the end of an object boundary may or may not appear there),
although the SysV ABI does not state anything about it so the question is
whether we'd be interoperable with objects coming from vendor
assemblers/compilers.

	Jakub



More information about the Binutils mailing list