+2012-11-20 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/14862
+ * elf-bfd.h (elf_link_hash_entry): Remove ref_dynamic_nonweak
+ added by accident.
+ (elf_link_add_object_symbols): Don't set nor check
+ ref_dynamic_nonweak.
+
2012-11-20 Alan Modra <amodra@gmail.com>
* elf32-rx.c (rx_elf_print_private_bfd_data): Warning fix.
/* Symbol has a non-weak reference from a non-shared object (other than
the object in which it is defined). */
unsigned int ref_regular_nonweak : 1;
- /* Symbol has a non-weak reference from a shared object. */
- unsigned int ref_dynamic_nonweak : 1;
/* Dynamic symbol has been adjustd. */
unsigned int dynamic_adjusted : 1;
/* Symbol needs a copy reloc. */
{
h->def_dynamic = 0;
h->ref_dynamic = 1;
- /* PR 12549: Note if the dynamic reference is weak. */
- h->ref_dynamic_nonweak = (bind != STB_WEAK);
}
}
{
h->ref_dynamic = 1;
hi->ref_dynamic = 1;
- /* PR 12549: Note if the dynamic reference is weak. */
- hi->ref_dynamic_nonweak =
- h->ref_dynamic_nonweak = (bind != STB_WEAK);
}
else
{
if (!add_needed
&& definition
&& ((dynsym
- && h->ref_regular_nonweak)
- || (h->ref_dynamic_nonweak
+ && h->ref_regular)
+ || (h->ref_dynamic
&& (elf_dyn_lib_class (abfd) & DYN_AS_NEEDED) != 0
&& !on_needed_list (elf_dt_name (abfd), htab->needed))))
{
+2012-11-20 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/14862
+ * ld-elf/shared.exp (build_tests): Build libpr14862-1.o and
+ libpr14862.so.
+ (run_tests): Test pr14862.
+
+ * ld-elf/pr14862-1.c: New file.
+ * ld-elf/pr14862-2.c: Likewise.
+ * ld-elf/pr14862.map: Likewise.
+ * ld-elf/pr14862.out: Likewise.
+
2012-11-20 H.J. Lu <hongjiu.lu@intel.com>
* ld-elf/global1.d: New file.
--- /dev/null
+extern void bar () __attribute__((weak));
+
+int
+main (void)
+{
+ if (bar)
+ bar ();
+ return 0;
+}
--- /dev/null
+#include <stdio.h>
+
+void
+bar (void)
+{
+ printf ("OK\n");
+}
--- /dev/null
+VERS_1 {
+ global: bar;
+ local: *;
+};
{"Build libpr14323-2.so"
"-shared" "-fPIC"
{pr14323-2.c} {} "libpr14323-2.so"}
+ {"Build pr14862-1.o"
+ "-r -nostdlib" ""
+ {pr14862-1.c} {} "libpr14862-1.o"}
+ {"Build libpr14862.so"
+ "-shared -Wl,--version-script=pr11138-1.map" "-fPIC"
+ {pr14862-2.c} {} "libpr14862.so"}
}
run_cc_link_tests $build_tests
{"Run with pr14323-1.c pr14323-2.so"
"tmpdir/libpr14323-2.so" ""
{pr14323-1.c} "pr14323" "pass.out"}
+ {"Run with pr14862-1.c libpr14862.so"
+ "--as-needed tmpdir/libpr14862-1.o tmpdir/libpr14862.so" ""
+ {dummy.c} "pr14862" "pr14862.out"}
}
# NetBSD ELF systems do not currently support the .*_array sections.