+2018-01-11 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/22649
+ * elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Ignore dynamic
+ references on forced local symbols.
+
2018-01-11 H.J. Lu <hongjiu.lu@intel.com>
PR ld/22677
if ((h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak)
- && (h->ref_dynamic
+ && ((h->ref_dynamic && !h->forced_local)
|| ((h->def_regular || ELF_COMMON_DEF_P (h))
&& ELF_ST_VISIBILITY (h->other) != STV_INTERNAL
&& ELF_ST_VISIBILITY (h->other) != STV_HIDDEN
+2018-01-11 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/22649
+ * testsuite/ld-elf/pr22649-1.s: New file.
+ * testsuite/ld-elf/pr22649-2a.s: Likewise.
+ * testsuite/ld-elf/pr22649-2b.s: Likewise.
+ * testsuite/ld-elf/pr22649.msg: Likewise.
+ * testsuite/ld-elf/shared.exp: Run ld/22649 tests.
+
2018-01-11 H.J. Lu <hongjiu.lu@intel.com>
PR ld/22677
--- /dev/null
+ .data
+ .globl foo
+foo:
+ .dc.a bar
--- /dev/null
+ .data
+ .hidden foo
+ .hidden bar
+ .globl foo
+ .globl bar
+foo:
+bar:
+ .dc.a foo
--- /dev/null
+ .data
+ .hidden foo
+ .globl foo
+ .globl bar
+foo:
+bar:
+ .dc.a foo
--- /dev/null
+.*: Removing unused section '\.data' in file 'tmpdir/pr22649-2.*\.o'
{} \
"pr22471" \
] \
+ [list \
+ "Build pr22649-1.so" \
+ "$LFLAGS -shared" \
+ "" \
+ "$AFLAGS_PIC" \
+ {pr22649-1.s} \
+ {} \
+ "pr22649-1.so" \
+ ] \
+ [list \
+ "Build pr22649-2a.so" \
+ "$LFLAGS -shared -gc-sections -print-gc-sections" \
+ "" \
+ "$AFLAGS_PIC" \
+ {pr22649-2a.s} \
+ {{ld pr22649.msg}} \
+ "pr22649-2a.so" \
+ ] \
+ [list \
+ "Build pr22649-2b.so" \
+ "$LFLAGS -shared -gc-sections -print-gc-sections" \
+ "tmpdir/pr22649-1.so" \
+ "$AFLAGS_PIC" \
+ {pr22649-2a.s} \
+ {{ld pr22649.msg}} \
+ "pr22649-2b.so" \
+ ] \
+ [list \
+ "Build pr22649-2c.so" \
+ "$LFLAGS -shared -gc-sections -print-gc-sections" \
+ "" \
+ "$AFLAGS_PIC" \
+ {pr22649-2b.s} \
+ {} \
+ "pr22649-2b.so" \
+ ] \
+ [list \
+ "Build pr22649-2d.so" \
+ "$LFLAGS -shared -gc-sections -print-gc-sections" \
+ "tmpdir/pr22649-1.so" \
+ "$AFLAGS_PIC" \
+ {pr22649-2b.s} \
+ {} \
+ "pr22649-2b.so" \
+ ] \
]
run_ld_link_tests [list \