binutils-gdb/ld/testsuite/ld-elf/loadaddr2.d
Alan Modra a8c75b765e hppa -z relro again
I misunderstood the hppa alias problem.  File offsets of segments need
to be such that no page is mapped twice with different permissions.
(Which still seems to me like something the kernel could fix, but
anyhow, this is not so difficult to achieve in ld.)

	PR 21000
bfd/
	* elf-bfd.h (struct elf_backend_data): Add no_page_alias.
	* elfxx-target.h (elf_backend_no_page_alias): Define.
	(elfNN_bed): Init new field.
	* elf.c (assign_file_positions_for_load_sections): If no_page_alias
	ensure PT_LOAD segment starts on a new page.
	* elf32-hppa.c (elf_backend_no_page_alias): Define.
ld/
	* testsuite/ld-elf/loadaddr1.d: Adjust for hppa file offsets.
	* testsuite/ld-elf/loadaddr2.d: Likewise.
	* testsuite/ld-elf/loadaddr3a.d: Likewise.
	* testsuite/ld-scripts/rgn-at5.d: Likewise.
2017-02-16 23:09:38 +10:30

11 lines
361 B
D

#source: loadaddr.s
#ld: -T loadaddr2.t -T loadaddr.t -z max-page-size=0x200000
#readelf: -l --wide
#target: *-*-linux* *-*-gnu*
#...
LOAD +0x000000 0xf*80000000 0xf*80000000 0x100050 0x100050 RWE 0x200000
LOAD +0x[13]10000 0xf*80110000 0xf*80101000 0x0*10 0x0*10 R E 0x200000
LOAD +0x[35]02000 0xf*80302000 0xf*80302000 0x0*10 0x0*10 RW 0x200000
#pass