+2015-10-05 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/18914
+ * elflink.c (elf_link_add_object_symbols): Don't re-export a
+ symbol if it isn't undefined.
+
2015-10-04 H.J. Lu <hongjiu.lu@intel.com>
* config.bfd (targ_selvecs, targ64_selvecs): Add iamcu_elf32_vec,
if ![ld_nm $nm "-D" tmpdir/exclude.so] {
unresolved $test2
-} elseif { [info exists nm_output(exclude_sym)] } {
+} elseif { [info exists nm_output(exclude_common)]
+ && [info exists nm_output(exclude_sym)] } {
pass $test2
} else {
fail $test2
if ![ld_nm $nm "-D" tmpdir/exclude.so] {
unresolved $test4
-} elseif { ! [info exists nm_output(exclude_sym)] } {
+} elseif { ! [info exists nm_output(exclude_common)]
+ && ! [info exists nm_output(exclude_sym)] } {
pass $test4
} else {
fail $test4
if { [ld_simple_link $ld tmpdir/exclude.so "--exclude-libs libexclude.a --shared tmpdir/exclude1.o -Ltmpdir -lexclude"]
&& [ld_nm $nm "-D" tmpdir/exclude.so]
+ && ! [info exists nm_output(exclude_common)]
&& ! [info exists nm_output(exclude_sym)] } {
pass $test5
} else {
if { [ld_simple_link $ld tmpdir/exclude.so "--exclude-libs ALL --shared tmpdir/exclude1.o -Ltmpdir -lexclude"]
&& [ld_nm $nm "-D" tmpdir/exclude.so]
+ && ! [info exists nm_output(exclude_common)]
&& ! [info exists nm_output(exclude_sym)] } {
pass $test6
} else {
if { [ld_simple_link $ld tmpdir/exclude.so "--exclude-libs foo:libexclude.a --shared tmpdir/exclude1.o -Ltmpdir -lexclude"]
&& [ld_nm $nm "-D" tmpdir/exclude.so]
+ && ! [info exists nm_output(exclude_common)]
&& ! [info exists nm_output(exclude_sym)] } {
pass $test7
} else {
if { [ld_simple_link $ld tmpdir/exclude.so "--exclude-libs foo,libexclude.a --shared tmpdir/exclude1.o -Ltmpdir -lexclude"]
&& [ld_nm $nm "-D" tmpdir/exclude.so]
+ && ! [info exists nm_output(exclude_common)]
&& ! [info exists nm_output(exclude_sym)] } {
pass $test8
} else {
if { [ld_simple_link $ld tmpdir/exclude.so "--exclude-libs foo:bar --shared tmpdir/exclude1.o -Ltmpdir -lexclude"]
&& [ld_nm $nm "-D" tmpdir/exclude.so]
+ && [info exists nm_output(exclude_common)]
&& [info exists nm_output(exclude_sym)] } {
pass $test9
} else {