diff options
-rw-r--r-- | ld/ChangeLog | 6 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/map-address.exp | 14 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/map-address.t | 3 |
3 files changed, 19 insertions, 4 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 95bb3f6..c451af0 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,5 +1,11 @@ 2021-03-04 Jan Beulich <jbeulich@suse.com> + * testsuite/ld-scripts/map-address.exp: Set image base to zero + for PE/COFF. + * testsuite/ld-scripts/map-address.t: Place .text. + +2021-03-04 Jan Beulich <jbeulich@suse.com> + * ldexp.c (ldexp_is_final_sym_absolute): New. * ldexp.h (ldexp_is_final_sym_absolute): Declare. * pe-dll.c (generate_reloc): Skip absolute symbols. 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) } } |