]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fixes to "PR 31728 testcases"
authorAlan Modra <amodra@gmail.com>
Fri, 26 Jul 2024 23:43:27 +0000 (09:13 +0930)
committerAlan Modra <amodra@gmail.com>
Mon, 29 Jul 2024 10:31:30 +0000 (20:01 +0930)
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.

ld/testsuite/ld-pe/pe.exp
ld/testsuite/ld-pe/symbols-ordinals-hints-call-imports.s
ld/testsuite/ld-pe/symbols-ordinals-hints-exports-dlltool.d
ld/testsuite/ld-pe/symbols-ordinals-hints-exports.s
ld/testsuite/ld-pe/symbols-ordinals-hints-imports-dlltool.d
ld/testsuite/ld-pe/symbols-ordinals-hints-imports-ld.d

index 457b667c3649de0f6cb2d132c799175c053e040c..6a1afef578bc001d32fc7fecb7cd635fb8e74c8e 100644 (file)
@@ -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
+}
index 475f72ee85efda415965e50d4664ec502d92ec1e..57fd3ed4ba8af9b923b12c702d481f4a62cef828 100644 (file)
@@ -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
index 8de09760ceceeacf897ace4c9580ebc44c66fb2e..fad59eab604bb2ee694e544968b150c87f351629 100644 (file)
@@ -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:
index d775d7093c55d6efc6c4732141c9f919521acde9..26ee52b016debbf0402426cbb5d224e679d4552b 100644 (file)
@@ -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
index 6cfa5c4a02f96b3243c70707af0c39ced173d2c2..5f3702e3b08f055147d0174c75cdcc5f675e831b 100644 (file)
@@ -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:
index 1b173510a843898bd8b40ccfa52472bba573a2da..7b7cdaadb2d534bf94855c9ecc50f7ebd28a705a 100644 (file)
@@ -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: