diff options
author | Alan Modra <amodra@gmail.com> | 2017-02-14 10:45:51 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2017-02-16 23:09:38 +1030 |
commit | a8c75b765e57aaebb99d4e32e0f228835cff2737 (patch) | |
tree | 2cea5382768b3cae9de0e04d151a7313d1024e77 /ld | |
parent | 247d6c4c14769b7576d810a381a68e35388ee874 (diff) | |
download | gdb-a8c75b765e57aaebb99d4e32e0f228835cff2737.zip gdb-a8c75b765e57aaebb99d4e32e0f228835cff2737.tar.gz gdb-a8c75b765e57aaebb99d4e32e0f228835cff2737.tar.bz2 |
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.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 8 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/loadaddr1.d | 2 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/loadaddr2.d | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/loadaddr3a.d | 2 | ||||
-rw-r--r-- | ld/testsuite/ld-scripts/rgn-at5.d | 8 |
5 files changed, 16 insertions, 8 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index f0b0b0e..1a7d18c 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,5 +1,13 @@ 2017-02-16 Alan Modra <amodra@gmail.com> + PR 21000 + * 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 Alan Modra <amodra@gmail.com> + * testsuite/ld-powerpc/vxworks1-lib.s: Correct addi to addic. * testsuite/ld-powerpc/vxworks1-lib.dd: Adjust to suit. diff --git a/ld/testsuite/ld-elf/loadaddr1.d b/ld/testsuite/ld-elf/loadaddr1.d index 0fd96a7..adb562a 100644 --- a/ld/testsuite/ld-elf/loadaddr1.d +++ b/ld/testsuite/ld-elf/loadaddr1.d @@ -6,5 +6,5 @@ #... LOAD +0x000000 0xf*80000000 0xf*80000000 0x100050 0x100050 RWE 0x200000 LOAD +0x200000 0xf*ff600000 0xf*80101000 0x0*10 0x0*10 R E 0x200000 - LOAD +0x302000 0xf*80102000 0xf*80102000 0x0*10 0x0*10 RW 0x200000 + LOAD +0x[35]02000 0xf*80102000 0xf*80102000 0x0*10 0x0*10 RW 0x200000 #pass diff --git a/ld/testsuite/ld-elf/loadaddr2.d b/ld/testsuite/ld-elf/loadaddr2.d index 5825fe8..eaa672d 100644 --- a/ld/testsuite/ld-elf/loadaddr2.d +++ b/ld/testsuite/ld-elf/loadaddr2.d @@ -5,6 +5,6 @@ #... LOAD +0x000000 0xf*80000000 0xf*80000000 0x100050 0x100050 RWE 0x200000 - LOAD +0x110000 0xf*80110000 0xf*80101000 0x0*10 0x0*10 R E 0x200000 - LOAD +0x302000 0xf*80302000 0xf*80302000 0x0*10 0x0*10 RW 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 diff --git a/ld/testsuite/ld-elf/loadaddr3a.d b/ld/testsuite/ld-elf/loadaddr3a.d index 10cb9a5..0082e1f 100644 --- a/ld/testsuite/ld-elf/loadaddr3a.d +++ b/ld/testsuite/ld-elf/loadaddr3a.d @@ -5,5 +5,5 @@ #... LOAD +0x000000 0x0*00000000 0x0*00000000 0x0*0110 0x0*0110 R E 0x.* - LOAD +0x000200 0x0*00000200 0x0*00000110 0x0*0010 0x0*0010 RW 0x.* + LOAD +0x[02]00200 0x0*00000200 0x0*00000110 0x0*0010 0x0*0010 RW 0x.* #pass diff --git a/ld/testsuite/ld-scripts/rgn-at5.d b/ld/testsuite/ld-scripts/rgn-at5.d index 7ba9caf..012451a 100644 --- a/ld/testsuite/ld-scripts/rgn-at5.d +++ b/ld/testsuite/ld-scripts/rgn-at5.d @@ -13,8 +13,8 @@ Sections: Idx +Name +Size +VMA +LMA +File off +Algn +Flags 0 .sec0 +0+4 +0+2000 +0+2000 +0+1000 +.* 1 .sec1 +0+4 +0+1000 +0+2004 +0+2000 +.* - 2 .sec2 +0+4 +0+4000 +0+603c +0+4000 +.* - 3 .sec3 +0+4 +0+5000 +0+5000 +0+3000 +.* - 4 .sec4 +0+4 +0+2008 +0+2008 +0+2008 +.* - 5 .sec5 +0+4 +0+200c +0+200c +0+200c +.* + 2 .sec2 +0+4 +0+4000 +0+603c +0+[45]000 +.* + 3 .sec3 +0+4 +0+5000 +0+5000 +0+[34]000 +.* + 4 .sec4 +0+4 +0+2008 +0+2008 +0+[23]008 +.* + 5 .sec5 +0+4 +0+200c +0+200c +0+[23]00c +.* #pass |