From 416c34d683f2a17aefe19afb466af4316c7c603b Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 20 Mar 2018 03:51:26 -0700 Subject: Set non_ir_ref_dynamic if a symbol is made dynamic If a symbol is made dynamic by --dynamic-list, it has non-IR reference. bfd/ PR ld/22983 * elflink.c (bfd_elf_link_mark_dynamic_symbol): Set non_ir_ref_dynamic if a symbol is made dynamic by --dynamic-list. ld/ PR ld/22983 * testsuite/ld-plugin/lto.exp: Run PR ld/22983 test. * testsuite/ld-plugin/pr22983.d: New file. * testsuite/ld-plugin/pr22983.t: Likewise. * testsuite/ld-plugin/pr22983a.c: Likewise. * testsuite/ld-plugin/pr22983b.c: Likewise. --- bfd/elflink.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'bfd/elflink.c') diff --git a/bfd/elflink.c b/bfd/elflink.c index 6a3d516..ce3765e 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -586,7 +586,12 @@ bfd_elf_link_mark_dynamic_symbol (struct bfd_link_info *info, || (d != NULL && h->non_elf && (*d->match) (&d->head, NULL, h->root.root.string))) - h->dynamic = 1; + { + h->dynamic = 1; + /* NB: If a symbol is made dynamic by --dynamic-list, it has + non-IR reference. */ + h->root.non_ir_ref_dynamic = 1; + } } /* Record an assignment to a symbol made by a linker script. We need -- cgit v1.1