+2010-01-07 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/11138
+ * elflink.c (elf_link_check_versioned_symbol): Don't abort if
+ a symbol referenced by DSO is is defined in a non-shared object
+ and forced local.
+
2010-01-07 H.J. Lu <hongjiu.lu@intel.com>
PR ld/11133
_bfd_elf_swap_versym_in (input, ever, &iver);
- if ((iver.vs_vers & VERSYM_HIDDEN) == 0)
+ if ((iver.vs_vers & VERSYM_HIDDEN) == 0
+ && !(h->def_regular
+ && h->forced_local))
{
/* If we have a non-hidden versioned sym, then it should
- have provided a definition for the undefined sym. */
+ have provided a definition for the undefined sym unless
+ it is defined in a non-shared object and forced local.
+ */
abort ();
}
+2010-01-07 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/11138
+ * ld-elf/pr11138-1.c: New.
+ * ld-elf/pr11138-1.map: Likewise.
+ * ld-elf/pr11138-2.c: Likewise.
+ * ld-elf/pr11138-2.map: Likewise.
+ * ld-elf/pr11138.out: Likewise.
+
+ * ld-elf/shared.exp (build_tests): Add libpr11138-1.so and
+ libpr11138-2.o.
+ (run_tests): Add 2 tests for PR ld/11138.
+
2010-01-07 H.J. Lu <hongjiu.lu@intel.com>
PR ld/11133
--- /dev/null
+#include <stdio.h>
+
+void
+bar (void)
+{
+ printf ("DSO bar\n");
+}
+
+void
+foo (void)
+{
+ bar ();
+}
--- /dev/null
+VERS_1 {
+ global: bar; foo;
+ local: *;
+};
--- /dev/null
+#include <stdio.h>
+
+extern void foo (void);
+
+void
+bar (void)
+{
+ printf ("MAIN bar\n");
+}
+
+int
+main (void)
+{
+ bar ();
+ foo ();
+ return 0;
+}
--- /dev/null
+{
+ global: main;
+ local: *;
+};
--- /dev/null
+MAIN bar
+DSO bar
{"Build libpr9679.so"
"-shared" "-fPIC -O0"
{pr9679-1.c pr9679-2.c} {{readelf {-s} pr9679.rd}} "libpr9679.so"}
+ {"Build libpr11138-1.so"
+ "-shared -Wl,--version-script=pr11138-1.map" "-fPIC"
+ {pr11138-1.c} {} "libpr11138-1.so"}
+ {"Build libpr11138-2.o"
+ "-r -nostdlib" ""
+ {pr11138-2.c} {} "libpr11138-2.o"}
}
set run_tests {
{"Run with comm1.o libfunc1.so"
"tmpdir/comm1.o tmpdir/libfunc1.so" ""
{dummy.c} "comm1" "pass.out"}
+ {"Run with pr11138-2.c libpr11138-1.so"
+ "--version-script=pr11138-2.map tmpdir/pr11138-2.o tmpdir/libpr11138-1.so" ""
+ {dummy.c} "pr11138a" "pr11138.out"}
+ {"Run with libpr11138-1.so pr11138-2.c"
+ "--version-script=pr11138-2.map tmpdir/libpr11138-1.so tmpdir/pr11138-2.o" ""
+ {dummy.c} "pr11138b" "pr11138.out"}
}
run_cc_link_tests $build_tests