diff options
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: |