aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2024-07-27 09:13:27 +0930
committerAlan Modra <amodra@gmail.com>2024-07-29 20:01:30 +0930
commit6c41f7a812d843d6ba76b65ec7e66074fbfed041 (patch)
tree00d3c979221247192aa4904b39c555f27b187b15 /ld
parentfb2a924990d3595c4b39cbcd37ebc36df761a3ad (diff)
downloadbinutils-6c41f7a812d843d6ba76b65ec7e66074fbfed041.zip
binutils-6c41f7a812d843d6ba76b65ec7e66074fbfed041.tar.gz
binutils-6c41f7a812d843d6ba76b65ec7e66074fbfed041.tar.bz2
Fixes to "PR 31728 testcases"
This brings us down to just these fails for the set of targets I usually test when making testsuite changes. aarch64-pe +FAIL: ld-pe/symbols-ordinals-hints-imports-ld arm-pe +FAIL: ld-pe/symbols-ordinals-hints-exports-dlltool arm-pe +FAIL: ld-pe/symbols-ordinals-hints-imports-dlltool The aarch64 one is likely due to the target missing support somewhere. It is fairly new, I haven't investigated. The arm-pe fails are due to arm-pe being a target that adds underscores to symbol names (see config.bfd) whereas dlltool thinks it does not (see dlltool.c:asm_prefix). arm-wince-pe on the other hand doesn't add underscores. I would guess the right fix for dlltool is to get this symbol info from bfd using bfd_get_target_info. Note I'm not very happy about the creative use of ld_after_inputfile in symbols-ordinals-hints-imports-ld.d, which is likely to break with some future run_dump_test change.
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ld-pe/pe.exp18
-rw-r--r--ld/testsuite/ld-pe/symbols-ordinals-hints-call-imports.s23
-rw-r--r--ld/testsuite/ld-pe/symbols-ordinals-hints-exports-dlltool.d4
-rw-r--r--ld/testsuite/ld-pe/symbols-ordinals-hints-exports.s25
-rw-r--r--ld/testsuite/ld-pe/symbols-ordinals-hints-imports-dlltool.d4
-rw-r--r--ld/testsuite/ld-pe/symbols-ordinals-hints-imports-ld.d4
6 files changed, 55 insertions, 23 deletions
diff --git a/ld/testsuite/ld-pe/pe.exp b/ld/testsuite/ld-pe/pe.exp
index 457b667..6a1afef 100644
--- a/ld/testsuite/ld-pe/pe.exp
+++ b/ld/testsuite/ld-pe/pe.exp
@@ -145,7 +145,17 @@ run_dump_test "exclude-symbols-embedded-x86_64"
run_dump_test "exclude-symbols-def-i386"
run_dump_test "exclude-symbols-def-x86_64"
-run_dump_test "symbols-ordinals-hints-exports-ld"
-run_dump_test "symbols-ordinals-hints-exports-dlltool"
-run_dump_test "symbols-ordinals-hints-imports-ld"
-run_dump_test "symbols-ordinals-hints-imports-dlltool"
+if [check_shared_lib_support] {
+ set old_ASFLAGS $ASFLAGS
+ if [is_underscore_target] {
+ append ASFLAGS " --defsym UNDERSCORE=1"
+ }
+ run_dump_test "symbols-ordinals-hints-exports-ld"
+ # no dlltool for these two
+ setup_xfail aarch64-*-* sh-*-*
+ run_dump_test "symbols-ordinals-hints-exports-dlltool"
+ run_dump_test "symbols-ordinals-hints-imports-ld"
+ setup_xfail aarch64-*-* sh-*-*
+ run_dump_test "symbols-ordinals-hints-imports-dlltool"
+ set ASFLAGS $old_ASFLAGS
+}
diff --git a/ld/testsuite/ld-pe/symbols-ordinals-hints-call-imports.s b/ld/testsuite/ld-pe/symbols-ordinals-hints-call-imports.s
index 475f72e..57fd3ed 100644
--- a/ld/testsuite/ld-pe/symbols-ordinals-hints-call-imports.s
+++ b/ld/testsuite/ld-pe/symbols-ordinals-hints-call-imports.s
@@ -1,8 +1,17 @@
-.global _func
+.ifdef UNDERSCORE
+ .global _func
_func:
- call __imp__sym1
- call __imp__sym2
- call __imp__sym3
- call __imp__sym4
- call __imp__sym5
- ret
+ .dc.a __imp__sym1
+ .dc.a __imp__sym2
+ .dc.a __imp__sym3
+ .dc.a __imp__sym4
+ .dc.a __imp__sym5
+.else
+ .global func
+func:
+ .dc.a __imp_sym1
+ .dc.a __imp_sym2
+ .dc.a __imp_sym3
+ .dc.a __imp_sym4
+ .dc.a __imp_sym5
+.endif
diff --git a/ld/testsuite/ld-pe/symbols-ordinals-hints-exports-dlltool.d b/ld/testsuite/ld-pe/symbols-ordinals-hints-exports-dlltool.d
index 8de0976..fad59ea 100644
--- a/ld/testsuite/ld-pe/symbols-ordinals-hints-exports-dlltool.d
+++ b/ld/testsuite/ld-pe/symbols-ordinals-hints-exports-dlltool.d
@@ -1,6 +1,6 @@
#source: symbols-ordinals-hints-exports.s
-#dlltool: -d ${srcdir}/${subdir}/symbols-ordinals-hints.def -e exports-dlltool.o
-#ld: -shared exports-dlltool.o
+#dlltool: -d ${srcdir}/${subdir}/symbols-ordinals-hints.def -e tmpdir/exports-dlltool.o
+#ld: -shared tmpdir/exports-dlltool.o
#objdump: -p
# Rules for Ordinal/Name Pointer Table:
diff --git a/ld/testsuite/ld-pe/symbols-ordinals-hints-exports.s b/ld/testsuite/ld-pe/symbols-ordinals-hints-exports.s
index d775d70..26ee52b 100644
--- a/ld/testsuite/ld-pe/symbols-ordinals-hints-exports.s
+++ b/ld/testsuite/ld-pe/symbols-ordinals-hints-exports.s
@@ -1,12 +1,25 @@
# define symbols in no specific order
-.global _sym2
-.global _sym5
-.global _sym3
-.global _sym1
-.global _sym4
+.ifdef UNDERSCORE
+ .global _sym2
+ .global _sym5
+ .global _sym3
+ .global _sym1
+ .global _sym4
_sym2:
_sym5:
_sym3:
_sym1:
_sym4:
- ret
+.else
+ .global sym2
+ .global sym5
+ .global sym3
+ .global sym1
+ .global sym4
+sym2:
+sym5:
+sym3:
+sym1:
+sym4:
+.endif
+ .nop
diff --git a/ld/testsuite/ld-pe/symbols-ordinals-hints-imports-dlltool.d b/ld/testsuite/ld-pe/symbols-ordinals-hints-imports-dlltool.d
index 6cfa5c4..5f3702e 100644
--- a/ld/testsuite/ld-pe/symbols-ordinals-hints-imports-dlltool.d
+++ b/ld/testsuite/ld-pe/symbols-ordinals-hints-imports-dlltool.d
@@ -1,7 +1,7 @@
#source: symbols-ordinals-hints-call-imports.s
-#dlltool: -d ${srcdir}/${subdir}/symbols-ordinals-hints.def -l libimports-dlltool.a
+#dlltool: -d ${srcdir}/${subdir}/symbols-ordinals-hints.def -l tmpdir/libimports-dlltool.a
#ld: -shared
-#ld_after_inputfiles: libimports-dlltool.a
+#ld_after_inputfiles: tmpdir/libimports-dlltool.a
#objdump: -p
# Rules for Import Tables:
diff --git a/ld/testsuite/ld-pe/symbols-ordinals-hints-imports-ld.d b/ld/testsuite/ld-pe/symbols-ordinals-hints-imports-ld.d
index 1b17351..7b7cdaa 100644
--- a/ld/testsuite/ld-pe/symbols-ordinals-hints-imports-ld.d
+++ b/ld/testsuite/ld-pe/symbols-ordinals-hints-imports-ld.d
@@ -1,6 +1,6 @@
#source: symbols-ordinals-hints-exports.s
-#ld: -shared ${srcdir}/${subdir}/symbols-ordinals-hints.def --out-implib libimports-ld.a
-#ld_after_inputfiles: && $AS ${srcdir}/${subdir}/symbols-ordinals-hints-call-imports.s -o call-imports-ld.o && $LD -shared call-imports-ld.o libimports-ld.a -o tmpdir/dump
+#ld: -shared ${srcdir}/${subdir}/symbols-ordinals-hints.def --out-implib tmpdir/libimports-ld.a
+#ld_after_inputfiles: && $AS $ASFLAGS ${srcdir}/${subdir}/symbols-ordinals-hints-call-imports.s -o tmpdir/call-imports-ld.o && $LD -shared tmpdir/call-imports-ld.o tmpdir/libimports-ld.a -o tmpdir/dump
#objdump: -p
# Rules for Import Tables: