aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2004-03-18 23:02:06 +0000
committerAlan Modra <amodra@gmail.com>2004-03-18 23:02:06 +0000
commitf218a464b274fb6090a0d3f70870bb1bf8c2f146 (patch)
tree0c017ff637e18585df5c259d0b30a5bc98b0dd5e /bfd
parent90b04e2953dd681f7ff87aded0840aa5d09b7a14 (diff)
downloadfsf-binutils-gdb-f218a464b274fb6090a0d3f70870bb1bf8c2f146.zip
fsf-binutils-gdb-f218a464b274fb6090a0d3f70870bb1bf8c2f146.tar.gz
fsf-binutils-gdb-f218a464b274fb6090a0d3f70870bb1bf8c2f146.tar.bz2
* elflink.c (_bfd_elf_merge_symbol): Reinstate code to handle
strong syms in one shared object overriding weak syms in another.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elflink.c24
2 files changed, 29 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index eb91f6e..fb1e2c4 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2004-03-19 Alan Modra <amodra@bigpond.net.au>
+
+ * elflink.c (_bfd_elf_merge_symbol): Reinstate code to handle
+ strong syms in one shared object overriding weak syms in another.
+
2004-03-18 Alan Modra <amodra@bigpond.net.au>
* elf-bfd.h (struct elf_obj_tdata): Delete dt_soname field. Add
diff --git a/bfd/elflink.c b/bfd/elflink.c
index c9db782..0a5c175 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -1153,6 +1153,30 @@ _bfd_elf_merge_symbol (bfd *abfd,
}
}
+ /* Handle the special case of a weak definition in one shared object
+ followed by a non-weak definition in another. We are covering for
+ a deficiency of _bfd_generic_link_add_one_symbol here. A new
+ strong definition of an indirect symbol is treated as a multiple
+ definition even when the indirect symbol points to a weak sym. */
+ if (olddef
+ && oldweak
+ && olddyn
+ && newdef
+ && !newweak
+ && newdyn)
+ {
+ /* To make this work we have to frob the flags so that the rest
+ of the code does not think we are using the old definition. */
+ h->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC;
+ h->elf_link_hash_flags &= ~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
+ defining a new indirect symbol we will wind up attaching it
+ to the entry we are overriding. */
+ *sym_hash = h;
+ }
+
return TRUE;
}