ld -r frustration

Zack Weinberg zack@codesourcery.com
Tue Jul 27 17:47:00 GMT 2004

Richard Earnshaw <rearnsha@gcc.gnu.org> writes:

> Well on ELF you can just write out every section unchanged in a single
> object file (ELF is quite happy to have multiple sections with the same
> name, it's only GAS that doesn't know how to do this).  IIRC the only
> thing that needs merging is the symbol table.
> It's then a genuine object file and you don't need to frob the linker at
> all.

That's going to break tools other than the linker.  Ian mentioned
VxWorks - the VxWorks loader doesn't understand ELF, it understands
the very limited subset of ELF that it has historically had to cope
with (the historical output of GCC/GAS/ld -r) and blows chunks if
handed anything else.

It seems to me that the Right Thing is to make ld -r on PowerPC64
not merge TOC sections when this would cause overflow.  Final link
can do this, so I don't see why ld -r can't.


More information about the Binutils mailing list