diff options
author | Alan Modra <amodra@gmail.com> | 2020-07-27 18:48:57 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2020-07-27 22:31:37 +0930 |
commit | 32377a8037eefae8091f345546f52370ed515399 (patch) | |
tree | dff83095ca42a10e22813cedd2f2e23be4675f0e /ld | |
parent | 93fd13c70468a7baac5ac7d56b71feb172509f7a (diff) | |
download | binutils-32377a8037eefae8091f345546f52370ed515399.zip binutils-32377a8037eefae8091f345546f52370ed515399.tar.gz binutils-32377a8037eefae8091f345546f52370ed515399.tar.bz2 |
Allow new just-symbols test to run on XCOFF and PE
* testsuite/ld-misc/just-symbols.exp: Run for x86_64 PE too.
Set LDFLAGS for PE and XCOFF.
* testsuite/ld-misc/just-symbols.ld: Accept XCOFF mapped .data.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 6 | ||||
-rw-r--r-- | ld/testsuite/ld-misc/just-symbols-1.dd | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-misc/just-symbols.exp | 67 | ||||
-rw-r--r-- | ld/testsuite/ld-misc/just-symbols.ld | 4 |
4 files changed, 45 insertions, 36 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index ef8f648..99dfea8 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,5 +1,11 @@ 2020-07-27 Alan Modra <amodra@gmail.com> + * testsuite/ld-misc/just-symbols.exp: Run for x86_64 PE too. + Set LDFLAGS for PE and XCOFF. + * testsuite/ld-misc/just-symbols.ld: Accept XCOFF mapped .data. + +2020-07-27 Alan Modra <amodra@gmail.com> + * testsuite/lib/ld-lib.exp (check_ctf_available): Check first that target compiler is available. diff --git a/ld/testsuite/ld-misc/just-symbols-1.dd b/ld/testsuite/ld-misc/just-symbols-1.dd index 8908a23..9502566 100644 --- a/ld/testsuite/ld-misc/just-symbols-1.dd +++ b/ld/testsuite/ld-misc/just-symbols-1.dd @@ -1,5 +1,3 @@ -.*: +file format .* - -Contents of section \.data: +#... [0-9a-f]+ (?:(:?12000000|00120000|00000012) 0{8}|0{8} 00000012) 0{8} 0{8} .* #pass diff --git a/ld/testsuite/ld-misc/just-symbols.exp b/ld/testsuite/ld-misc/just-symbols.exp index 1c1f866..59c725d 100644 --- a/ld/testsuite/ld-misc/just-symbols.exp +++ b/ld/testsuite/ld-misc/just-symbols.exp @@ -20,38 +20,43 @@ # # SH/PE targets complain about zero VMA. -# x86_64/PE targets hardcode VMA to 0x100000000. -if { [istarget sh-*-pe] \ - || [istarget x86_64-*-cygwin] \ - || [istarget x86_64-*-mingw*] \ - || [istarget x86_64-*-pe] \ - || [istarget x86_64-*-pep] } { +if { [istarget sh-*-pe] } { return } -run_ld_link_tests { - {"Object for --just-symbols test" - "-r -T just-symbols.ld" "" - "" - {just-symbols-0.s} - {} - "just-symbols-0.o"} - {"Executable for --just-symbols test" - "-e 0 -T just-symbols.ld" "" - "" - {just-symbols-0.s} - {} - "just-symbols-0"} - {"Object with --just-symbols test" - "-e 0 -T just-symbols.ld --just-symbols=tmpdir/just-symbols-0.o" "" - "" - {just-symbols-1.s} - {{objdump {-s -j .data} just-symbols-1.dd}} - "just-symbols-1obj"} - {"Executable with --just-symbols test" - "-e 0 -T just-symbols.ld --just-symbols=tmpdir/just-symbols-0" "" - "" - {just-symbols-1.s} - {{objdump {-s -j .data} just-symbols-1.dd}} - "just-symbols-1exe"} +set saved_LDFLAGS "$LDFLAGS" +if { [is_pecoff_format] } then { + # Avoid auto image-basing. + set LDFLAGS "$LDFLAGS --image-base 0" +} elseif { [is_xcoff_format] } then { + set LDFLAGS "$LDFLAGS -bnogc" } + +run_ld_link_tests [list \ + [list "Object for --just-symbols test" \ + "$LDFLAGS -r -T just-symbols.ld" "" \ + "" \ + {just-symbols-0.s} \ + {} \ + "just-symbols-0.o"] \ + [list "Executable for --just-symbols test" \ + "$LDFLAGS -e 0 -T just-symbols.ld" "" \ + "" \ + {just-symbols-0.s} \ + {} \ + "just-symbols-0"] \ + [list "Object with --just-symbols test" \ + "$LDFLAGS -e 0 -T just-symbols.ld --just-symbols=tmpdir/just-symbols-0.o" "" \ + "" \ + {just-symbols-1.s} \ + {{objdump -s just-symbols-1.dd}} \ + "just-symbols-1obj"] \ + [list "Executable with --just-symbols test" \ + "$LDFLAGS -e 0 -T just-symbols.ld --just-symbols=tmpdir/just-symbols-0" "" \ + "" \ + {just-symbols-1.s} \ + {{objdump -s just-symbols-1.dd}} \ + "just-symbols-1exe"] \ +] + +set LDFLAGS "$saved_LDFLAGS" diff --git a/ld/testsuite/ld-misc/just-symbols.ld b/ld/testsuite/ld-misc/just-symbols.ld index 3d65987..51d3b14 100644 --- a/ld/testsuite/ld-misc/just-symbols.ld +++ b/ld/testsuite/ld-misc/just-symbols.ld @@ -1,7 +1,7 @@ SECTIONS { .text : { *(.text) } - .data : { *(.data) } - .bss : { *(.bss) } + .data : { *(.data .rw) } + .bss : { *(.bss) } /DISCARD/ : { *(*) } } |