binutils-gdb/ld/testsuite/ld-scripts/map-address.t
Jan Beulich d4e5db4e50 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.
2021-03-04 16:56:40 +01:00

15 lines
184 B
Perl

SECTIONS
{
def1 = DEFINED(foo) ? 0x10 : 0x20;
def2 = def1;
. = 0x10001;
foo = .;
. += 0x200;
bar = .;
. = ALIGN (4);
frob = .;
. = 0x10000;
.text : { *(.text) }
}