aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-i386.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2003-05-05 05:46:53 +0000
committerH.J. Lu <hjl.tools@gmail.com>2003-05-05 05:46:53 +0000
commitef5aade5aca46a8f4244c7185fecbadbc32e50fa (patch)
treece0667846200306b0d014e816dd21bd8f6a6aaab /bfd/elf32-i386.c
parent839efa267fa3c2517d3f5072102a03415f7bad5a (diff)
downloadgdb-ef5aade5aca46a8f4244c7185fecbadbc32e50fa.zip
gdb-ef5aade5aca46a8f4244c7185fecbadbc32e50fa.tar.gz
gdb-ef5aade5aca46a8f4244c7185fecbadbc32e50fa.tar.bz2
bfd/
2003-05-04 H.J. Lu <hjl@gnu.org> * elf32-i386.c (allocate_dynrelocs): Don't allocate dynamic relocation entries for weak undefined symbols with non-default visibility. (elf_i386_relocate_section): Initialize the GOT entries and skip R_386_32/R_386_PC32 for weak undefined symbols with non-default visibility. * elfxx-ia64.c (allocate_fptr): Don't allocate function descriptors for weak undefined symbols with non-default visibility. (allocate_dynrel_entries): Don't allocate relocation entries for symbols resolved to 0. (set_got_entry): Don't install dynamic relocation for weak undefined symbols with non-default visibility. (set_pltoff_entry): Likewise. * elflink.h (elf_fix_symbol_flags): Hide weak undefined symbols with non-default visibility. (elf_link_output_extsym): Don't make weak undefined symbols with non-default visibility dynamic. ld/testsuite/ 2003-05-04 H.J. Lu <hjl@gnu.org> * ld-elfvsb/main.c: Updated. * ld-elfvsb/sh1.c: Likewise.
Diffstat (limited to 'bfd/elf32-i386.c')
-rw-r--r--bfd/elf32-i386.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index 060d66c..ac292a1 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -1569,8 +1569,10 @@ allocate_dynrelocs (h, inf)
return FALSE;
}
- if (info->shared
- || WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, 0, h))
+ if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+ || h->root.type != bfd_link_hash_undefweak)
+ && (info->shared
+ || WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, 0, h)))
{
asection *s = htab->splt;
@@ -1656,8 +1658,10 @@ allocate_dynrelocs (h, inf)
htab->srelgot->_raw_size += sizeof (Elf32_External_Rel);
else if (tls_type == GOT_TLS_GD)
htab->srelgot->_raw_size += 2 * sizeof (Elf32_External_Rel);
- else if (info->shared
- || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h))
+ else if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+ || h->root.type != bfd_link_hash_undefweak)
+ && (info->shared
+ || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h)))
htab->srelgot->_raw_size += sizeof (Elf32_External_Rel);
}
else
@@ -2298,7 +2302,9 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
&& (info->symbolic
|| h->dynindx == -1
|| (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
+ || (ELF_ST_VISIBILITY (h->other)
+ && h->root.type == bfd_link_hash_undefweak))
{
/* This is actually a static link, or it is a
-Bsymbolic link and the symbol is defined
@@ -2422,6 +2428,9 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
break;
if ((info->shared
+ && (h == NULL
+ || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+ || h->root.type != bfd_link_hash_undefweak)
&& (r_type != R_386_PC32
|| (h != NULL
&& h->dynindx != -1