This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
fix ia64 dynamic_symbol_p
- From: Richard Henderson <rth at redhat dot com>
- To: binutils at gcc dot gnu dot org
- Cc: Jakub Jelinek <jakub at redhat dot com>
- Date: Wed, 16 Jul 2003 14:50:30 -0700
- Subject: fix ia64 dynamic_symbol_p
We were mis-identifying symbols as dynamic when -Bsymbolic should
force them to resolve locally. This caused gnu-efi to die with
../gnuefi/crt0-efi-ia64.o: @gprel relocation against dynamic symbol ImageBase
../gnuefi/crt0-efi-ia64.o: @gprel relocation against dynamic symbol _DYNAMIC
It looks like this correction could be applied to other ports as well...
r~
* elfxx-ia64.c (elfNN_ia64_dynamic_symbol_p): Properly return false
for symbols defined locally plus -Bsymbolic. Tidy logic.
Index: elfxx-ia64.c
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-ia64.c,v
retrieving revision 1.88
diff -u -p -r1.88 elfxx-ia64.c
--- elfxx-ia64.c 10 Jul 2003 14:22:15 -0000 1.88
+++ elfxx-ia64.c 16 Jul 2003 21:44:54 -0000
@@ -1653,13 +1653,12 @@ elfNN_ia64_dynamic_symbol_p (h, info)
|| h->root.type == bfd_link_hash_defweak)
return TRUE;
- if ((!info->executable && (!info->symbolic || info->allow_shlib_undefined))
- || ((h->elf_link_hash_flags
- & (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR))
- == (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR)))
+ /* If it isn't defined locally, then clearly it's dynamic. */
+ if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
return TRUE;
- return FALSE;
+ /* Identify the cases where name binding rules say it resolves local. */
+ return !(info->executable || info->symbolic);
}
static bfd_boolean