aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2021-03-04 16:56:40 +0100
committerJan Beulich <jbeulich@suse.com>2021-03-04 16:56:40 +0100
commitd4e5db4e5031f1b4050620e2b5a4599ace52a29f (patch)
treeda30c6651de4b71df354c908f58dba7e45d0a304 /ld/testsuite
parent6b5465b917ed37f7ce5e9bc0b91e07e7adaf101a (diff)
downloadgdb-d4e5db4e5031f1b4050620e2b5a4599ace52a29f.zip
gdb-d4e5db4e5031f1b4050620e2b5a4599ace52a29f.tar.gz
gdb-d4e5db4e5031f1b4050620e2b5a4599ace52a29f.tar.bz2
ld: adjust ld-scripts/map-address.*
Without setting an image base address and without naming at least .text, this test produces entirely bogus PE output. To be honest, even the ELF output looks odd: .text gets placed at 0x10204, and both foo and bar get associated with .text despite living below its start address. Since neither image base nor .text placement are the subject of this test, specify .text placement explicitly and in the PE case force the image base to zero.
Diffstat (limited to 'ld/testsuite')
-rw-r--r--ld/testsuite/ld-scripts/map-address.exp14
-rw-r--r--ld/testsuite/ld-scripts/map-address.t3
2 files changed, 13 insertions, 4 deletions
diff --git a/ld/testsuite/ld-scripts/map-address.exp b/ld/testsuite/ld-scripts/map-address.exp
index 9e6f2dc..0f9ac1c 100644
--- a/ld/testsuite/ld-scripts/map-address.exp
+++ b/ld/testsuite/ld-scripts/map-address.exp
@@ -26,9 +26,15 @@ if {![ld_assemble $as $srcdir/$subdir/sizeof.s tmpdir/map-address.o]} {
return
}
+if { [is_pecoff_format] } then {
+ set IMAGE_BASE "--image-base 0"
+} else {
+ set IMAGE_BASE ""
+}
+
if {![ld_link $ld tmpdir/map-address \
"$LDFLAGS -T $srcdir/$subdir/map-address.t \
- tmpdir/map-address.o \
+ $IMAGE_BASE tmpdir/map-address.o \
-Map tmpdir/map-address.map"]} {
fail $testname
return
@@ -51,7 +57,7 @@ set testname "map to directory"
if {![ld_link $ld tmpdir/map-address \
"$LDFLAGS -T $srcdir/$subdir/map-address.t \
- tmpdir/map-address.o \
+ $IMAGE_BASE tmpdir/map-address.o \
-Map tmpdir --output fred"]} {
fail $testname
return
@@ -74,7 +80,7 @@ set testname "map to % directory"
if {![ld_link $ld tmpdir/map-address \
"$LDFLAGS -T $srcdir/$subdir/map-address.t \
- tmpdir/map-address.o \
+ $IMAGE_BASE tmpdir/map-address.o \
-Map=tmpdir/% --output fred"]} {
fail $testname
return
@@ -97,7 +103,7 @@ set testname "map to %.foo directory"
if {![ld_link $ld tmpdir/map-address \
"$LDFLAGS -T $srcdir/$subdir/map-address.t \
- tmpdir/map-address.o \
+ $IMAGE_BASE tmpdir/map-address.o \
-Map=tmpdir/%.foo --output fred"]} {
fail $testname
return
diff --git a/ld/testsuite/ld-scripts/map-address.t b/ld/testsuite/ld-scripts/map-address.t
index e077ed1..94e14bde 100644
--- a/ld/testsuite/ld-scripts/map-address.t
+++ b/ld/testsuite/ld-scripts/map-address.t
@@ -8,4 +8,7 @@ SECTIONS
bar = .;
. = ALIGN (4);
frob = .;
+
+ . = 0x10000;
+ .text : { *(.text) }
}