aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/bfd-in.h4
-rw-r--r--bfd/bfd-in2.h4
-rw-r--r--bfd/elfcode.h12
4 files changed, 21 insertions, 5 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 88de922..e824f8b 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,11 @@
Tue Jul 4 12:22:21 1995 Ian Lance Taylor <ian@cygnus.com>
+ * 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.
+
* libelf.h (struct elf_link_hash_table): Add needed field. Remove
saw_needed field.
* elfcode.h (elf_link_add_object_symbols): If elf_dt_needed_name
diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h
index 151e824..1582482 100644
--- a/bfd/bfd-in.h
+++ b/bfd/bfd-in.h
@@ -592,9 +592,9 @@ extern boolean bfd_mips_ecoff_create_embedded_relocs
/* Externally visible ELF routines. */
extern boolean bfd_elf32_record_link_assignment
- PARAMS ((bfd *, struct bfd_link_info *, const char *));
+ PARAMS ((bfd *, struct bfd_link_info *, const char *, boolean));
extern boolean bfd_elf64_record_link_assignment
- PARAMS ((bfd *, struct bfd_link_info *, const char *));
+ PARAMS ((bfd *, struct bfd_link_info *, const char *, boolean));
struct bfd_elf_link_needed_list
{
struct bfd_elf_link_needed_list *next;
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 1b0ba63..91d5cc9 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -592,9 +592,9 @@ extern boolean bfd_mips_ecoff_create_embedded_relocs
/* Externally visible ELF routines. */
extern boolean bfd_elf32_record_link_assignment
- PARAMS ((bfd *, struct bfd_link_info *, const char *));
+ PARAMS ((bfd *, struct bfd_link_info *, const char *, boolean));
extern boolean bfd_elf64_record_link_assignment
- PARAMS ((bfd *, struct bfd_link_info *, const char *));
+ PARAMS ((bfd *, struct bfd_link_info *, const char *, boolean));
struct bfd_elf_link_needed_list
{
struct bfd_elf_link_needed_list *next;
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;