aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1996-04-01 17:42:59 +0000
committerIan Lance Taylor <ian@airs.com>1996-04-01 17:42:59 +0000
commitce6a77318320c19cc5014c9cef0fdfa1289d1649 (patch)
tree26bd29fc95431c0f96ed43ac8d72c34254b1eedf /bfd/elflink.h
parent251b8ab932e847dcc51e29ec62399992f67f6fe8 (diff)
downloadgdb-ce6a77318320c19cc5014c9cef0fdfa1289d1649.zip
gdb-ce6a77318320c19cc5014c9cef0fdfa1289d1649.tar.gz
gdb-ce6a77318320c19cc5014c9cef0fdfa1289d1649.tar.bz2
* elflink.h (elf_adjust_dynamic_symbol): If a common symbol got
defined in a regular file, set ELF_LINK_HASH_DEF_REGULAR.
Diffstat (limited to 'bfd/elflink.h')
-rw-r--r--bfd/elflink.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/bfd/elflink.h b/bfd/elflink.h
index a27f930..32da750 100644
--- a/bfd/elflink.h
+++ b/bfd/elflink.h
@@ -1554,6 +1554,18 @@ elf_adjust_dynamic_symbol (h, data)
}
}
+ /* If this is a final link, and the symbol was defined as a common
+ symbol in a regular object file, and there was no definition in
+ any dynamic object, then the linker will have allocated space for
+ the symbol in a common section but the ELF_LINK_HASH_DEF_REGULAR
+ flag will not have been set. */
+ if (h->root.type == bfd_link_hash_defined
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) != 0
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
+ && (h->root.u.def.section->owner->flags & DYNAMIC) == 0)
+ h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
+
/* If -Bsymbolic was used (which means to bind references to global
symbols to the definition within the shared object), and this
symbol was defined in a regular object, then it actually doesn't