aboutsummaryrefslogtreecommitdiff
path: root/ld/plugin.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2018-07-04 06:27:58 -0700
committerH.J. Lu <hjl.tools@gmail.com>2018-07-04 06:29:13 -0700
commit94d401b8b88a76b1372ce44e805516756a4f737b (patch)
tree62f580d5a657896a602fad555ea6b11c7cdc48fa /ld/plugin.c
parentb14b7ff14ffe911ec562004304841cf7d2775a19 (diff)
downloadgdb-94d401b8b88a76b1372ce44e805516756a4f737b.zip
gdb-94d401b8b88a76b1372ce44e805516756a4f737b.tar.gz
gdb-94d401b8b88a76b1372ce44e805516756a4f737b.tar.bz2
ld: Set non_ir_ref_regular for --undefined SYMBOL
Set non_ir_ref_regular to TRUE for symbols forced into the output file so that they won't be removed by garbage collection with LTO. PR ld/23309 * ldlang.c (insert_undefined): Set non_ir_ref_regular to TRUE. * plugin.c (is_visible_from_outside): Don't scan entry_symbol. * testsuite/ld-plugin/pr23309.c: New file. * testsuite/ld-plugin/pr23309.d: Likewise.
Diffstat (limited to 'ld/plugin.c')
-rw-r--r--ld/plugin.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/ld/plugin.c b/ld/plugin.c
index 78f2e04..994eb6b 100644
--- a/ld/plugin.c
+++ b/ld/plugin.c
@@ -625,8 +625,6 @@ static inline bfd_boolean
is_visible_from_outside (struct ld_plugin_symbol *lsym,
struct bfd_link_hash_entry *blhe)
{
- struct bfd_sym_chain *sym;
-
if (bfd_link_relocatable (&link_info))
return TRUE;
if (blhe->non_ir_ref_dynamic
@@ -658,11 +656,6 @@ is_visible_from_outside (struct ld_plugin_symbol *lsym,
|| lsym->visibility == LDPV_PROTECTED);
}
- for (sym = &entry_symbol; sym != NULL; sym = sym->next)
- if (sym->name
- && strcmp (sym->name, blhe->root.string) == 0)
- return TRUE;
-
return FALSE;
}