From 8e1d4bbbc0d40e33df07d13080aa984902bf4ef2 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Fri, 3 Aug 2001 05:10:39 +0000 Subject: [PATCH] * elf32-i386.c (allocate_plt_and_got_and_discard_relocs): Don't keep relocs for undefined syms if there are no dynamic sections in executable. * elf32-hppa.c (allocate_plt_and_got_and_discard_relocs): Likewise. --- bfd/ChangeLog | 10 +++++++++- bfd/elf32-hppa.c | 5 +++-- bfd/elf32-i386.c | 5 +++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 35a2fad46d0..e7c5c4cb2b2 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,11 @@ +2001-08-03 Alan Modra + + From H.J. Lu + * elf32-i386.c (allocate_plt_and_got_and_discard_relocs): Don't + keep relocs for undefined syms if there are no dynamic sections in + executable. + * elf32-hppa.c (allocate_plt_and_got_and_discard_relocs): Likewise. + 2001-08-02 Paul Sokolovsky * cofflink.c (coff_link_check_ar_symbols): also search for @@ -138,7 +146,7 @@ 2001-06-29 H.J. Lu * elf32-hppa.c (elf32_hppa_finish_dynamic_sections): Check if - hplink->sgot is NULL before filling GOT. Checck if hplink->splt + hplink->sgot is NULL before filling GOT. Check if hplink->splt is NULL before filling PLT. 2001-06-29 Alan Modra diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c index af08d8e010f..7fe328e7039 100644 --- a/bfd/elf32-hppa.c +++ b/bfd/elf32-hppa.c @@ -2141,8 +2141,9 @@ allocate_plt_and_got_and_discard_relocs (h, inf) if (!info->shared && (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0 && ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 - || h->root.type == bfd_link_hash_undefweak - || h->root.type == bfd_link_hash_undefined)) + || (hplink->root.dynamic_sections_created + && (h->root.type == bfd_link_hash_undefweak + || h->root.type == bfd_link_hash_undefined)))) { /* Make sure this symbol is output as a dynamic symbol. Undefined weak syms won't yet be marked as dynamic. */ diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index e76e75b0131..02a08f77d37 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -1199,8 +1199,9 @@ allocate_plt_and_got_and_discard_relocs (h, inf) if (!info->shared && (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0 && ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 - || h->root.type == bfd_link_hash_undefweak - || h->root.type == bfd_link_hash_undefined)) + || (htab->root.dynamic_sections_created + && (h->root.type == bfd_link_hash_undefweak + || h->root.type == bfd_link_hash_undefined)))) { /* Make sure this symbol is output as a dynamic symbol. Undefined weak syms won't yet be marked as dynamic. */ -- 2.30.2