From: Andreas Jaeger Date: Mon, 5 May 2003 08:50:43 +0000 (+0000) Subject: * elf64-x86-64.c (allocate_dynrelocs): Don't allocate dynamic X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4bc6e03a51b7b718a385253d4b7e9fb9ab213880;p=binutils-gdb.git * elf64-x86-64.c (allocate_dynrelocs): Don't allocate dynamic relocation entries for weak undefined symbols with non-default visibility. (elf64_x86_64_relocate_section): Initialize the GOT entries and skip R_386_32/R_386_PC32 for weak undefined symbols with non-default visibility. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index e209e3dc332..42c07e82cb5 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,12 @@ +2003-05-05 Andreas Jaeger + + * elf64-x86-64.c (allocate_dynrelocs): Don't allocate dynamic + relocation entries for weak undefined symbols with non-default + visibility. + (elf64_x86_64_relocate_section): Initialize the GOT entries and + skip R_386_32/R_386_PC32 for weak undefined symbols with + non-default visibility. + 2003-05-04 H.J. Lu * elf32-i386.c (allocate_dynrelocs): Don't allocate dynamic diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index 5ed6b518dbe..f8d2a0cdd94 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -1396,7 +1396,9 @@ allocate_dynrelocs (h, inf) return FALSE; } - if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info, h)) + if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak) + && WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info, h)) { asection *s = htab->splt; @@ -1478,7 +1480,9 @@ allocate_dynrelocs (h, inf) htab->srelgot->_raw_size += sizeof (Elf64_External_Rela); else if (tls_type == GOT_TLS_GD) htab->srelgot->_raw_size += 2 * sizeof (Elf64_External_Rela); - else if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h)) + else if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak) + && WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h)) htab->srelgot->_raw_size += sizeof (Elf64_External_Rela); } else @@ -1976,7 +1980,9 @@ elf64_x86_64_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 locally, or the symbol @@ -2095,6 +2101,9 @@ elf64_x86_64_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_X86_64_PC8 && r_type != R_X86_64_PC16 && r_type != R_X86_64_PC32)