summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1999-10-08 15:21:56 +0000
committerIan Lance Taylor <ian@airs.com>1999-10-08 15:21:56 +0000
commit64df8d0bcef2d6775b0b60e39c27c4789e29013a (patch)
tree6b44d18d8be74ac0cc788bee6eace0385bf73e7a
parentf20a759a4d205bde711c4f0f861c82e19c67e20c (diff)
downloadbinutils-gdb-64df8d0bcef2d6775b0b60e39c27c4789e29013a.tar.gz
* elflink.h (elf_merge_symbol): When overriding a weak symbol with
a defined symbol in a shared library, clear the DEF_DYNAMIC flag too.
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elflink.h8
2 files changed, 12 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index ea94b3e0a81..6037a1c4f0d 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+1999-10-08 Ian Lance Taylor <ian@zembu.com>
+
+ * elflink.h (elf_merge_symbol): When overriding a weak symbol with
+ a defined symbol in a shared library, clear the DEF_DYNAMIC flag
+ too.
+
Fri Oct 8 13:03:45 1999 Geoffrey Keating <geoffk@cygnus.com>
* elf32-mips.c (mips_elf_calculate_relocation): R_MIPS_LITERAL
diff --git a/bfd/elflink.h b/bfd/elflink.h
index 6196014dd3b..d9b5071862f 100644
--- a/bfd/elflink.h
+++ b/bfd/elflink.h
@@ -683,8 +683,12 @@ elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash,
/* To make this work we have to frob the flags so that the rest
of the code does not think we are using the regular
definition. */
- h->elf_link_hash_flags &= ~ ELF_LINK_HASH_DEF_REGULAR;
- h->elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR;
+ if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0)
+ h->elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR;
+ else if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)
+ h->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC;
+ h->elf_link_hash_flags &= ~ (ELF_LINK_HASH_DEF_REGULAR
+ | ELF_LINK_HASH_DEF_DYNAMIC);
/* If H is the target of an indirection, we want the caller to
use H rather than the indirect symbol. Otherwise if we are