This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [BFD][PR21703]Override the new defined symbol with the old normal symbol when --allow-multiple-definition is provided
Hi,
This patch fixes the test cases failures on target which don't support share library.
Additional, targets which use _bfd_generic_link_add_symbols instead of
bfd_elf_link_add_symbols are expected to fail on those tests.
all the failed targets mentioned by Alan have been checked. All fixed.
However, all the checks are done on cross-target environment as I don't native environment
except arm, aarch64 and x86.
Is it Okay to commit?
Regards,
Renlin
ld/ChangeLog:
2017-10-25 Renlin Li <renlin.li@arm.com>
* testsuite/ld-elf/elf.exp: xfail pr21703 tests on specific target.
Check share lib support for shared object tests.
On 25/10/17 05:16, Alan Modra wrote:
On Tue, Oct 24, 2017 at 08:04:43PM +1030, Alan Modra wrote:
On Tue, Oct 17, 2017 at 02:54:12PM +0100, Renlin Li wrote:
bfd/ChangeLog:
2017-10-17 Renlin Li <renlin.li@arm.com>
* elflink.c (_bfd_elf_merge_symbol): Handle multiple definition case.
ld/ChangeLog:
2017-10-17 Renlin Li <renlin.li@arm.com>
* testsuite/ld-elf/elf.exp: Run new tests.
* testsuite/ld-elf/pr21703-1.s: New.
* testsuite/ld-elf/pr21703-2.s: New.
* testsuite/ld-elf/pr21703-3.s: New.
* testsuite/ld-elf/pr21703-4.s: New.
* testsuite/ld-elf/pr21703-r.sd: New.
* testsuite/ld-elf/pr21703-shared.sd: New.
* testsuite/ld-elf/pr21703.sd: New.
* testsuite/ld-elf/pr21703.ver: New.
OK.
It looks like you have some work to do on this testcase. Please
investigate. One obvious thing is not run the -shared test for ELF
targets without shared library support. You also probably should
exclude targets that use _bfd_generic_link_add_symbols (those that
don't define elf_backend_relocate_section).
avr-elf +FAIL: PR ld/21703 -r
avr-elf +FAIL: PR ld/21703 shared
cr16-elf +FAIL: PR ld/21703 -r
cr16-elf +FAIL: PR ld/21703 shared
cris-elf +FAIL: PR ld/21703 shared
crx-elf +FAIL: PR ld/21703 -r
crx-elf +FAIL: PR ld/21703 shared
d10v-elf +FAIL: PR ld/21703 shared
d30v-elf +FAIL: PR ld/21703
d30v-elf +FAIL: PR ld/21703 -r
d30v-elf +FAIL: PR ld/21703 shared
dlx-elf +FAIL: PR ld/21703
dlx-elf +FAIL: PR ld/21703 -r
dlx-elf +FAIL: PR ld/21703 shared
epiphany-elf +FAIL: PR ld/21703 shared
fr30-elf +FAIL: PR ld/21703 shared
frv-elf +FAIL: PR ld/21703 shared
ft32-elf +FAIL: PR ld/21703 -r
ft32-elf +FAIL: PR ld/21703 shared
h8300-elf +FAIL: PR ld/21703 shared
hppa64-hp-hpux11.23 +FAIL: PR ld/21703 shared
hppa64-linux +FAIL: PR ld/21703 shared
ip2k-elf +FAIL: PR ld/21703 shared
iq2000-elf +FAIL: PR ld/21703 shared
lm32-elf +FAIL: PR ld/21703 shared
m32c-elf +FAIL: PR ld/21703 shared
m32r-elf +FAIL: PR ld/21703 shared
m68hc11-elf +FAIL: PR ld/21703 shared
m68hc12-elf +FAIL: PR ld/21703 shared
mcore-elf +FAIL: PR ld/21703 shared
mep-elf +FAIL: PR ld/21703 -r
mep-elf +FAIL: PR ld/21703 shared
microblaze-elf +FAIL: PR ld/21703 -r
microblaze-elf +FAIL: PR ld/21703 shared
mipstx39-elf +FAIL: PR ld/21703 shared
mn10200-elf +FAIL: PR ld/21703 shared
moxie-elf +FAIL: PR ld/21703 shared
ms1-elf +FAIL: PR ld/21703 shared
msp430-elf +FAIL: PR ld/21703 -r
msp430-elf +FAIL: PR ld/21703 shared
mt-elf +FAIL: PR ld/21703 shared
nds32le-elf +FAIL: PR ld/21703 shared
or1k-elf +FAIL: PR ld/21703 shared
pj-elf +FAIL: PR ld/21703
pj-elf +FAIL: PR ld/21703 -r
pj-elf +FAIL: PR ld/21703 shared
pru-elf +FAIL: PR ld/21703 -r
pru-elf +FAIL: PR ld/21703 shared
rl78-elf +FAIL: PR ld/21703 -r
rl78-elf +FAIL: PR ld/21703 shared
rx-elf +FAIL: PR ld/21703 shared
spu-elf +FAIL: PR ld/21703 shared
tic6x-elf +FAIL: PR ld/21703 shared
v850-elf +FAIL: PR ld/21703 shared
visium-elf +FAIL: PR ld/21703 shared
xgate-elf +FAIL: PR ld/21703 shared
xstormy16-elf +FAIL: PR ld/21703 shared
diff --git a/ld/testsuite/ld-elf/elf.exp b/ld/testsuite/ld-elf/elf.exp
index eac29e0..f092baf 100644
--- a/ld/testsuite/ld-elf/elf.exp
+++ b/ld/testsuite/ld-elf/elf.exp
@@ -70,16 +70,13 @@ run_ld_link_tests [list \
{symbol3w.s} {} "symbol3w.a" ] \
]
+# Those target use _bfd_generic_link_add_symbols instead of
+# bfd_elf_link_add_symbols
+setup_xfail "d30v-*-*" "dlx-*-*" "pj-*-*"
run_ld_link_tests [list \
[list "PR ld/21703" \
"--allow-multiple-definition tmpdir/pr21703-1.o tmpdir/pr21703-2.o" "" "" \
{pr21703-1.s pr21703-2.s} {{readelf {-s} pr21703.sd}} "pr21703" ] \
- [list "PR ld/21703 -r" \
- "-r --allow-multiple-definition tmpdir/pr21703-3.o tmpdir/pr21703-4.o" "" "" \
- {pr21703-3.s pr21703-4.s} {{readelf {-s} pr21703-r.sd}} "pr21703.o" ] \
- [list "PR ld/21703 shared" \
- "-shared --allow-multiple-definition --version-script pr21703.ver tmpdir/pr21703-3.o tmpdir/pr21703-4.o" "" "" \
- {pr21703-3.s pr21703-4.s} {{readelf {--dyn-syms} pr21703-shared.sd}} "pr21703.so" ] \
]
if { [check_shared_lib_support] } then {
@@ -98,6 +95,24 @@ if { [check_shared_lib_support] } then {
"--no-dynamic-linker tmpdir/pr14170a.o tmpdir/pr14170.so" "" $hpux \
{pr14170c.s} { } "pr14170" ] \
]
+
+ # Those target use _bfd_generic_link_add_symbols instead of
+ # bfd_elf_link_add_symbols
+ setup_xfail "d30v-*-*" "dlx-*-*" "pj-*-*"
+ run_ld_link_tests [list \
+ [list "PR ld/21703 -r" \
+ "-r --allow-multiple-definition tmpdir/pr21703-3.o tmpdir/pr21703-4.o" "" "" \
+ {pr21703-3.s pr21703-4.s} {{readelf {-s} pr21703-r.sd}} "pr21703.o" ] \
+ ]
+
+ setup_xfail "d30v-*-*" "dlx-*-*" "pj-*-*"
+ setup_xfail "tic6x-*-*" "hppa64-*-*"
+ run_ld_link_tests [list \
+ [list "PR ld/21703 shared" \
+ "-shared --allow-multiple-definition --version-script pr21703.ver tmpdir/pr21703-3.o tmpdir/pr21703-4.o" "" "" \
+ {pr21703-3.s pr21703-4.s} {{readelf {--dyn-syms} pr21703-shared.sd}} "pr21703.so" ] \
+ ]
+
}
# Only run these tests on targets that support creating shared libraries.