+2020-06-10 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/26094
+ * elflink.c (bfd_elf_define_start_stop): Handle common symbols.
+ Clear verinfo.verdef.
+
2020-06-09 H.J. Lu <hongjiu.lu@intel.com>
PR ld/18801
h = elf_link_hash_lookup (elf_hash_table (info), symbol,
FALSE, FALSE, TRUE);
+ /* NB: Common symbols will be turned into definition later. */
if (h != NULL
&& (h->root.type == bfd_link_hash_undefined
|| h->root.type == bfd_link_hash_undefweak
- || ((h->ref_regular || h->def_dynamic) && !h->def_regular)))
+ || ((h->ref_regular || h->def_dynamic)
+ && !h->def_regular
+ && h->root.type != bfd_link_hash_common)))
{
bfd_boolean was_dynamic = h->ref_dynamic || h->def_dynamic;
+ h->verinfo.verdef = NULL;
h->root.type = bfd_link_hash_defined;
h->root.u.def.section = sec;
h->root.u.def.value = 0;
+2020-06-10 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/26094
+ * testsuite/ld-elf/pr26094-1.ver: New fike.
+ * testsuite/ld-elf/pr26094-1a.c: Likewise.
+ * testsuite/ld-elf/pr26094-1a.rd: Likewise.
+ * testsuite/ld-elf/pr26094-1b.c: Likewise.
+ * testsuite/ld-elf/pr26094-1b.rd: Likewise.
+ * testsuite/ld-elf/pr26094-1c.c: Likewise.
+ * testsuite/ld-elf/shared.exp: Run ld/26094 tests.
+
2020-06-09 H.J. Lu <hongjiu.lu@intel.com>
PR ld/18801
--- /dev/null
+SOME_VERSION_NAME {
+ global: *;
+};
--- /dev/null
+char foo_data __attribute__(( section("FOO") )) = { 0 };
+
+extern void * __start_FOO;
+
+void * foo() {
+ return __start_FOO;
+}
--- /dev/null
+#ld: -shared
+#readelf: --dyn-syms --wide
+#target: *-*-linux* *-*-gnu* arm*-*-uclinuxfdpiceabi
+#xfail: ![check_shared_lib_support]
+
+#...
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +GLOBAL +PROTECTED +[0-9]+ +___?start_FOO@@SOME_VERSION_NAME
+#pass
--- /dev/null
+extern void *foo();
+
+void main()
+{
+ foo();
+}
\ No newline at end of file
--- /dev/null
+#ld:
+#readelf: --dyn-syms --wide
+#target: *-*-linux* *-*-gnu* arm*-*-uclinuxfdpiceabi
+#xfail: ![check_shared_lib_support]
+
+#...
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +OBJECT +GLOBAL +PROTECTED +[0-9]+ +___?start_FOO@@SOME_VERSION_NAME
+#pass
--- /dev/null
+char foo_data __attribute__(( section("FOO") )) = { 0 };
+
+void * __start_FOO;
+
+void * foo() {
+ return __start_FOO;
+}
run_cc_link_tests $build_tests
+run_cc_link_tests [list \
+ [list \
+ "Build pr26094-1.so" \
+ "-shared -Wl,--version-script=pr26094-1.ver" \
+ "-fPIC" \
+ {pr26094-1a.c} \
+ {{readelf {--dyn-syms --wide} pr26094-1a.rd}} \
+ "pr26094-1.so" \
+ ] \
+ [list \
+ "Build pr26094-1" \
+ "-Wl,--no-as-needed tmpdir/pr26094-1.so" \
+ "-fcommon" \
+ {pr26094-1b.c pr26094-1c.c} \
+ {{readelf {--dyn-syms --wide} pr26094-1b.rd}} \
+ "pr26094-1" \
+ ] \
+]
+
run_ld_link_tests [list \
[list \
"pr22269-1 (static pie undefined weak)" \