This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
elflink.h -Bsymbolic change
- To: binutils at sourceware dot cygnus dot com
- Subject: elflink.h -Bsymbolic change
- From: Alan Modra <alan at linuxcare dot com dot au>
- Date: Tue, 3 Apr 2001 14:48:46 +1000 (EST)
I'd like to make the following change to fix an abort on hppa-linux with
-Bsymbolic. The problem on hppa-linux is that certain symbols need to
retain their .plt entries even when -Bsymbolic and/or symbol visibility
would dictate they become local (and normally not need a .plt entry). To
handle this situation, elf32-hppa.c provides its own version of
hide_symbol, but that isn't called here...
Anyone (cris, ia64, mips maintainers) see a problem with this? AFAICT,
this patch may actually benefit these ports.
--- elflink.h.orig Fri Mar 9 14:43:28 2001
+++ elflink.h Tue Apr 3 13:51:42 2001
@@ -3518,24 +3518,25 @@ elf_fix_symbol_flags (h, eif)
/* If -Bsymbolic was used (which means to bind references to global
symbols to the definition within the shared object), and this
symbol was defined in a regular object, then it actually doesn't
need a PLT entry. Likewise, if the symbol has any kind of
visibility (internal, hidden, or protected), it doesn't need a
PLT. */
if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0
&& eif->info->shared
&& (eif->info->symbolic || ELF_ST_VISIBILITY (h->other))
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0)
{
- h->elf_link_hash_flags &=~ ELF_LINK_HASH_NEEDS_PLT;
- h->plt.offset = (bfd_vma) -1;
+ struct elf_backend_data *bed;
+ bed = get_elf_backend_data (elf_hash_table (eif->info)->dynobj);
+ (*bed->elf_backend_hide_symbol) (eif->info, h);
}
/* If this is a weak defined symbol in a dynamic object, and we know
the real definition in the dynamic object, copy interesting flags
over to the real definition. */
if (h->weakdef != NULL)
{
struct elf_link_hash_entry *weakdef;
BFD_ASSERT (h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak);
Alan Modra
--
Linuxcare