{
h->def_dynamic = 0;
h->ref_dynamic = 1;
- h->dynamic_def = 1;
}
/* FIXME: Should we check type and size for protected symbol? */
h->size = 0;
{
h->def_dynamic = 0;
h->ref_dynamic = 1;
- h->dynamic_def = 1;
}
}
if (! info->executable
if (! definition)
h->ref_dynamic = 1;
else
- h->def_dynamic = 1;
+ {
+ h->def_dynamic = 1;
+ h->dynamic_def = 1;
+ }
if (h->def_regular
|| h->ref_regular
|| (h->u.weakdef != NULL
&& h->def_regular
&& ELF_ST_VISIBILITY (h->other) != STV_INTERNAL
&& ELF_ST_VISIBILITY (h->other) != STV_HIDDEN
- && !bfd_hide_sym_by_version (info->version_info,
- h->root.root.string))))
+ && (strchr (h->root.root.string, ELF_VER_CHR) != NULL
+ || !bfd_hide_sym_by_version (info->version_info,
+ h->root.root.string)))))
h->root.u.def.section->flags |= SEC_KEEP;
return TRUE;
return
}
+run_cc_link_tests {
+ {"PR ld/13195" "-Wl,--gc-sections" ""
+ {pr13195.c} {} "pr13195"}
+}
+
set array_tests {
{"preinit array" "" "" {preinit.c} "preinit" "preinit.out"}
{"init array" "" "" {init.c} "init" "init.out"}
--- /dev/null
+int
+main ()
+{
+ return 0;
+}
--- /dev/null
+#ld: --gc-sections -shared -version-script pr13195.t
+#readelf: -s --wide -D
+#target: *-*-linux* *-*-gnu*
+#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* or32-*-* pj*-*-*
+#notarget: hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-*
+# generic linker targets don't support --gc-sections, nor do a bunch of others
+
+#...
+ +[0-9]+ +[0-9]+: +[0-9a-f]+ +[0-9]+ +FUNC +GLOBAL +DEFAULT +[1-9]+ foo
+#pass
--- /dev/null
+ .section .text.new_foo,"ax",%progbits
+ .globl new_foo
+ .type new_foo, %function
+new_foo:
+ .byte 0
+ .symver new_foo,foo@@VERS_2.0
--- /dev/null
+VERS_2.0 {
+global:
+ foo;
+local:
+ *;
+};