aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfcode.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1995-07-04 17:43:05 +0000
committerIan Lance Taylor <ian@airs.com>1995-07-04 17:43:05 +0000
commitb5279eb6a9672dba08ce9bbef0490f4bf26243f3 (patch)
tree934940776e888d2740dac8e31a0e6fd006755c91 /bfd/elfcode.h
parent48f4903f369709dde852872db542afbb536acd54 (diff)
downloadgdb-b5279eb6a9672dba08ce9bbef0490f4bf26243f3.zip
gdb-b5279eb6a9672dba08ce9bbef0490f4bf26243f3.tar.gz
gdb-b5279eb6a9672dba08ce9bbef0490f4bf26243f3.tar.bz2
* elfcode.h (NAME(bfd_elf,record_link_assignment)): Add provide
argument. * bfd-in.h (bfd_elf32_record_link_assignment): Update prototype. (bfd_elf64_record_link_assignment): Likewise. * bfd-in2.h: Rebuild. PR 7164.
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;