telling symbols defined only in the linker script

Alexandre Oliva aoliva@redhat.com
Mon Mar 1 08:26:00 GMT 2004


I've run into a problem in FR-V FDPIC, while linking static
executables, if a symbol is weak-referenced but not defined except for
an assignment in a linker script.  We fail to allocate a rofixup entry
for it, because at size_dynamic_sections() time it's still undefweak,
but when we get to the point of emitting rofixups, it's become
defined, so we emit a rofixup and end up missing entries at the end.

OTOH, I can't tentatively allocate rofixup entries for undefweak
symbols, because there must not be unused rofixup entries.

So, I need to arrange for symbols that are defined in the linker
script to not show up as undefweak.  I've come up with the following
patch, but I'm not entirely happy with it.  It require code in
size_dynamic_sections, for example, to know that bfd_type_hash_new
means a symbol that used to be undefweak or undefined but that was
defined in the linker script.  Changing the type of the symbol to
defined (which feels like the right thing to do) would cause PROVIDEs
to no longer work, so that's not an option.  I considered introducing
bfd_type_hash_assigned, but I'm concerned that existing code might
fail to handle it properly.

Opinions?  Does this look ok to install?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ld-assign-undefweak.patch
Type: text/x-patch
Size: 941 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20040301/fa26d68d/attachment.bin>
-------------- next part --------------

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Happy GNU Year!                     oliva@{lsd.ic.unicamp.br, gnu.org}
Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist                Professional serial bug killer


More information about the Binutils mailing list