mn10300 dynamic relocation clean up: remove dynamic PCREL32

Alexandre Oliva aoliva@redhat.com
Mon Jun 28 07:56:00 GMT 2004


Turned out the adoption of _bfd_elf_symbol_refs_local_p introduced
some ugly regressions in handling of common symbols, because it
doesn't handle them properly.  The problem is that common symbols are
initially set up as bfd_link_hash_common, but then, when then linker
turns them into a definition, it doesn't set
ELF_LINK_HASH_DEF_REGULAR, which _bfd_elf_symbol_refs_local_p depends
on to tell whether a symbol is a definition.

This patch introduces ELF_LINK_HASH_COMMON, set for symbols read in as
common symbols.  This bit remains set after the linker turns the
symbol into a definition, and is the new clean way to tell that the
symbol is a definition of a common symbol.  Unfortunately, I had to
switch to a wider data type for elf_link_hash_flags.

After fixing _bfd_elf_symbol_refs_local_p, I switched to
SYMBOL_REFERENCES_LOCAL, that had the correct semantics for mn10300.

While at that, I also cleaned up an ugly bit in the FR-V code that
attempted to handle common symbols but didn't handle them correctly (a
globally-visible common symbol would be assumed to bind locally).

Ok to install?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: bfd-common-syms-may-be-local.patch
Type: text/x-patch
Size: 6568 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20040628/630c69c3/attachment.bin>
-------------- next part --------------

-- 
Alexandre Oliva             http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}


More information about the Binutils mailing list