aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2017-05-16 07:56:41 +0930
committerAlan Modra <amodra@gmail.com>2017-05-16 10:35:02 +0930
commit4070765b1a1640ff8f43483cd9ee06727f658dfe (patch)
treeea06dfc18946668b4a75631e39b22a822f2fd26a /bfd
parent8cc2a9796024f2dd472985cc8ed1c65a85ec9a35 (diff)
downloadgdb-4070765b1a1640ff8f43483cd9ee06727f658dfe.zip
gdb-4070765b1a1640ff8f43483cd9ee06727f658dfe.tar.gz
gdb-4070765b1a1640ff8f43483cd9ee06727f658dfe.tar.bz2
non_ir_ref_dynamic
dynamic_ref_after_ir_def is a little odd compared to other symbol flags in that as the name suggests, it is set only for certain references after a definition. It turns out that setting a flag for any non-ir reference from a dynamic object can be used to solve the problem for which this flag was invented, which I think is a cleaner. This patch does that, and sets non_ir_ref only for regular object references. include/ * bfdlink.h (struct bfd_link_hash_entry): Update non_ir_ref comment. Rename dynamic_ref_after_ir_def to non_ir_ref_dynamic. ld/ * plugin.c (is_visible_from_outside): Use non_ir_ref_dynamic. (plugin_notice): Set non_ir_ref for references from regular objects, non_ir_ref_dynamic for references from dynamic objects. bfd/ * elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic. * elflink.c (elf_link_add_object_symbols): Update to use non_ir_ref_dynamic. (elf_link_input_bfd): Test non_ir_ref_dynamic in addition to non_ir_ref. * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog9
-rw-r--r--bfd/elf64-ppc.c1
-rw-r--r--bfd/elflink.c11
-rw-r--r--bfd/linker.c3
4 files changed, 18 insertions, 6 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 52c192d..8b3f1a5 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,12 @@
+2017-05-16 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic.
+ * elflink.c (elf_link_add_object_symbols): Update to use
+ non_ir_ref_dynamic.
+ (elf_link_input_bfd): Test non_ir_ref_dynamic in addition to
+ non_ir_ref.
+ * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
+
2017-05-15 Maciej W. Rozycki <macro@imgtec.com>
* elfxx-mips.c (print_mips_ases): Handle MIPS16e2 ASE.
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index a20d9b3..a2cc373 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -5119,6 +5119,7 @@ add_symbol_adjust (struct ppc_link_hash_entry *eh, struct bfd_link_info *info)
/* Propagate reference flags from entry symbol to function
descriptor symbol. */
fdh->elf.root.non_ir_ref |= eh->elf.root.non_ir_ref;
+ fdh->elf.root.non_ir_ref_dynamic |= eh->elf.root.non_ir_ref_dynamic;
fdh->elf.ref_regular |= eh->elf.ref_regular;
fdh->elf.ref_regular_nonweak |= eh->elf.ref_regular_nonweak;
diff --git a/bfd/elflink.c b/bfd/elflink.c
index ba50b68..8eaf533 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -4939,7 +4939,7 @@ error_free_dyn:
struct elf_link_hash_entry *h;
bfd_size_type size;
unsigned int alignment_power;
- unsigned int dynamic_ref_after_ir_def;
+ unsigned int non_ir_ref_dynamic;
for (p = htab->root.table.table[i]; p != NULL; p = p->next)
{
@@ -4961,10 +4961,10 @@ error_free_dyn:
size = 0;
alignment_power = 0;
}
- /* Preserve dynamic_ref_after_ir_def so that this symbol
+ /* Preserve non_ir_ref_dynamic so that this symbol
will be exported when the dynamic lib becomes needed
in the second pass. */
- dynamic_ref_after_ir_def = h->root.dynamic_ref_after_ir_def;
+ non_ir_ref_dynamic = h->root.non_ir_ref_dynamic;
memcpy (p, old_ent, htab->root.table.entsize);
old_ent = (char *) old_ent + htab->root.table.entsize;
h = (struct elf_link_hash_entry *) p;
@@ -4981,7 +4981,7 @@ error_free_dyn:
if (alignment_power > h->root.u.c.p->alignment_power)
h->root.u.c.p->alignment_power = alignment_power;
}
- h->root.dynamic_ref_after_ir_def = dynamic_ref_after_ir_def;
+ h->root.non_ir_ref_dynamic = non_ir_ref_dynamic;
}
}
@@ -10472,7 +10472,8 @@ elf_link_input_bfd (struct elf_final_link_info *flinfo, bfd *input_bfd)
linker may attach linker created dynamic sections
to the plugin bfd. Symbols defined in linker
created sections are not plugin symbols. */
- if (h->root.non_ir_ref
+ if ((h->root.non_ir_ref
+ || h->root.non_ir_ref_dynamic)
&& (h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak)
&& (h->root.u.def.section->flags
diff --git a/bfd/linker.c b/bfd/linker.c
index 2f56b46..1f493a3 100644
--- a/bfd/linker.c
+++ b/bfd/linker.c
@@ -1735,7 +1735,8 @@ _bfd_generic_link_add_one_symbol (struct bfd_link_info *info,
otherwise add a warning. */
if ((!info->lto_plugin_active
&& (h->u.undef.next != NULL || info->hash->undefs_tail == h))
- || h->non_ir_ref)
+ || h->non_ir_ref
+ || h->non_ir_ref_dynamic)
{
(*info->callbacks->warning) (info, string, h->root.string,
hash_entry_bfd (h), NULL, 0);