diff options
author | Ian Lance Taylor <ian@airs.com> | 1997-06-18 15:36:33 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1997-06-18 15:36:33 +0000 |
commit | c68867051ce45d6bab5af31af9d514140932a622 (patch) | |
tree | 16d967e045114d9b5dab0c2a324b009d06201f83 /bfd/elflink.h | |
parent | 66e38fb28258e39e62219b23c4593c868e537aa1 (diff) | |
download | gdb-c68867051ce45d6bab5af31af9d514140932a622.zip gdb-c68867051ce45d6bab5af31af9d514140932a622.tar.gz gdb-c68867051ce45d6bab5af31af9d514140932a622.tar.bz2 |
* elflink.h (elf_link_add_object_symbols): Don't let a common
symbol in a regular object override a common symbol in a shared
object if the latter was found via an indirect symbol.
Diffstat (limited to 'bfd/elflink.h')
-rw-r--r-- | bfd/elflink.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/bfd/elflink.h b/bfd/elflink.h index df74afe..09a7d8b 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -741,6 +741,7 @@ elf_link_add_object_symbols (abfd, info) { Elf_Internal_Versym iver; int vernum; + boolean indirect; boolean override; if (ever != NULL) @@ -850,9 +851,14 @@ elf_link_add_object_symbols (abfd, info) if (h->root.type == bfd_link_hash_new) h->elf_link_hash_flags &=~ ELF_LINK_NON_ELF; + indirect = false; while (h->root.type == bfd_link_hash_indirect || h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *) h->root.u.i.link; + { + if (h->root.type == bfd_link_hash_indirect) + indirect = true; + h = (struct elf_link_hash_entry *) h->root.u.i.link; + } /* FIXME: There are too many cases here, and it's too confusing. This code needs to be reorganized somehow. */ @@ -1008,7 +1014,8 @@ elf_link_add_object_symbols (abfd, info) && (h->root.u.def.section->flags & SEC_ALLOC) != 0 && (h->root.u.def.section->flags & SEC_LOAD) == 0 && h->size > 0 - && h->type != STT_FUNC) + && h->type != STT_FUNC + && ! indirect) { /* It would be best if we could set the hash table entry to a common symbol, but we don't know what to use for |