2014-06-12 Alan Modra <amodra@gmail.com>
Backport mainline patches
+ 2014-02-10 H.J. Lu <hongjiu.lu@intel.com>
+ PR gold/16530
+ * elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Mark symbol in
+ executables if it matches dynamic_list.
+
2014-01-13 Alan Modra <amodra@gmail.com>
* elf32-ppc.c (ppc_elf_check_relocs): For @local call to ifunc,
error when shared and force a plt call otherwise.
bfd_elf_gc_mark_dynamic_ref_symbol (struct elf_link_hash_entry *h, void *inf)
{
struct bfd_link_info *info = (struct bfd_link_info *) inf;
+ struct bfd_elf_dynamic_list *d = info->dynamic_list;
if ((h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak)
&& (h->ref_dynamic
- || ((!info->executable || info->export_dynamic)
+ || ((!info->executable
+ || info->export_dynamic
+ || (d != NULL
+ && (*d->match) (&d->head, NULL, h->root.root.string)))
&& h->def_regular
&& ELF_ST_VISIBILITY (h->other) != STV_INTERNAL
&& ELF_ST_VISIBILITY (h->other) != STV_HIDDEN
+2014-06-12 Alan Modra <amodra@gmail.com>
+
+ Apply mainline patches
+ 2014-02-10 H.J. Lu <hongjiu.lu@intel.com>
+ PR gold/16530
+ * ld-elf/dynamic-1.c: New file.
+ * ld-elf/dynamic-1.rd: Likewise.
+ * ld-elf/dynamic-1.syms: Likewise.
+ * ld-elf/shared.exp (build_tests): Add dynamic-1.
+
2014-04-16 Alan Modra <amodra@gmail.com>
* ld-bootstrap/bootstrap.exp: Add ppc476 workaround test.
--- /dev/null
+void
+dynamic ()
+{
+}
+
+int
+main ()
+{
+ return 0;
+}
--- /dev/null
+Symbol table '\.dynsym' contains [0-9]+ entries:
+ +Num: +Value +Size Type +Bind +Vis +Ndx Name
+#...
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +FUNC +GLOBAL +DEFAULT +[0-9]+ +_?dynamic
+#...
--- /dev/null
+{
+ dynamic;
+};
{"Build librel.so"
"-shared" "-fPIC"
{rel.c} {} "librel.so"}
+ {"Build dynamic-1"
+ "-Wl,--dynamic-list,dynamic-1.syms -Wl,--gc-sections" "-ffunction-sections"
+ {dynamic-1.c} {{readelf {-s} dynamic-1.rd}} "dynamic-1"}
}
run_cc_link_tests $build_tests