aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-i386.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2001-09-08 05:47:01 +0000
committerAlan Modra <amodra@gmail.com>2001-09-08 05:47:01 +0000
commit56882138c5b70c428c589a351d58b4e0852e4a1e (patch)
treef739ca7668fb8936335b461c6b4f52415f4de6c7 /bfd/elf32-i386.c
parenta529d7582c89e435c97eaafe826da5174022b723 (diff)
downloadgdb-56882138c5b70c428c589a351d58b4e0852e4a1e.zip
gdb-56882138c5b70c428c589a351d58b4e0852e4a1e.tar.gz
gdb-56882138c5b70c428c589a351d58b4e0852e4a1e.tar.bz2
* elf32-i386.c (elf_i386_relocate_section): Check !DEF_REGULAR
as well as DEF_DYNAMIC in test for avoided copy relocs. (allocate_plt_and_got_and_discard_relocs): Likewise. * elf32-i386.c (elf_i386_relocate_section): Likewise. (allocate_plt_and_got_and_discard_relocs): Likewise.
Diffstat (limited to 'bfd/elf32-i386.c')
-rw-r--r--bfd/elf32-i386.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index ccc71e4..ffa810c 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -705,6 +705,7 @@ elf_i386_check_relocs (abfd, info, sec, relocs)
table entry. A similar situation occurs when creating
shared libraries and symbol visibility changes render the
symbol local.
+
If on the other hand, we are creating an executable, we
may need to keep relocations for symbols satisfied by a
dynamic library if we manage to avoid copy relocs for the
@@ -1213,7 +1214,8 @@ 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->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|| (htab->root.dynamic_sections_created
&& (h->root.type == bfd_link_hash_undefweak
|| h->root.type == bfd_link_hash_undefined))))
@@ -1707,8 +1709,10 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
&& h != NULL
&& h->dynindx != -1
&& (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0
- && ((h->elf_link_hash_flags
- & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+ && (((h->elf_link_hash_flags
+ & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+ && (h->elf_link_hash_flags
+ & ELF_LINK_HASH_DEF_REGULAR) == 0)
|| h->root.type == bfd_link_hash_undefweak
|| h->root.type == bfd_link_hash_undefined)))
{