aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfcode.h
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elfcode.h')
-rw-r--r--bfd/elfcode.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/bfd/elfcode.h b/bfd/elfcode.h
index e0f1b9c..3f30c6b 100644
--- a/bfd/elfcode.h
+++ b/bfd/elfcode.h
@@ -5107,10 +5107,11 @@ elf_link_read_relocs (abfd, o, external_relocs, internal_relocs, keep_memory)
/*ARGSUSED*/
boolean
-NAME(bfd_elf,record_link_assignment) (output_bfd, info, name)
+NAME(bfd_elf,record_link_assignment) (output_bfd, info, name, provide)
bfd *output_bfd;
struct bfd_link_info *info;
const char *name;
+ boolean provide;
{
struct elf_link_hash_entry *h;
@@ -5121,6 +5122,15 @@ NAME(bfd_elf,record_link_assignment) (output_bfd, info, name)
if (h == NULL)
return false;
+ /* If this symbol is being provided by the linker script, and it is
+ currently defined by a dynamic object, but not by a regular
+ object, then mark it as undefined so that the generic linker will
+ force the correct value. */
+ if (provide
+ && (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_undefined;
+
h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
h->type = STT_OBJECT;