diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2017-11-12 17:03:50 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2017-11-12 17:04:03 -0800 |
commit | f882209d9aa5b68d68c45c5849e129ffc228749c (patch) | |
tree | bcb7059f22ae6ff16f204c2f10fe7ecf2826fa78 /ld/testsuite/ld-alpha | |
parent | 53892e6d2395b818554b825cabf6129fed7e2aae (diff) | |
download | fsf-binutils-gdb-f882209d9aa5b68d68c45c5849e129ffc228749c.zip fsf-binutils-gdb-f882209d9aa5b68d68c45c5849e129ffc228749c.tar.gz fsf-binutils-gdb-f882209d9aa5b68d68c45c5849e129ffc228749c.tar.bz2 |
ld: Remove PF_X from PT_PHDR segment
It was reasonable to mark PT_PHDR segment with PF_X for compatibility
with UnixWare and Solaris linkers 20 years ago. But it is inappropriate
today when the primary OS of GNU ld is Linux. This patch removes PF_X
from PT_PHDR segment as gold does.
Tested natively on Linux/x86 as well as crosss-binutils for alpha-linux,
ia64-linux, powerpc64-linux, powerpc-linux, s390-linux, s390x-linux,
sparc64-linux and sparc-linux.
bfd/
PR ld/22423
* elf.c (_bfd_elf_map_sections_to_segments): Remove PF_X from
PT_PHDR segment.
ld/
PR ld/22423
* testsuite/ld-alpha/tlsbin.rd: Replace "R E " with "R +" for
PT_PHDR segment.
* testsuite/ld-alpha/tlsbinr.rd: Likewise.
* testsuite/ld-ia64/tlsbin.rd: Likewise.
* testsuite/ld-powerpc/tlsexe.r: Likewise.
* testsuite/ld-powerpc/tlsexe32.r: Likewise.
* testsuite/ld-powerpc/tlsexetoc.r: Likewise.
* testsuite/ld-s390/tlsbin.rd: Likewise.
* testsuite/ld-s390/tlsbin_64.rd: Likewise.
* testsuite/ld-sparc/tlssunbin32.rd: Likewise.
* testsuite/ld-sparc/tlssunbin64.rd: Likewise.
* testsuite/ld-elf/pr22423.d: New test.
Diffstat (limited to 'ld/testsuite/ld-alpha')
-rw-r--r-- | ld/testsuite/ld-alpha/tlsbin.rd | 2 | ||||
-rw-r--r-- | ld/testsuite/ld-alpha/tlsbinr.rd | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/ld/testsuite/ld-alpha/tlsbin.rd b/ld/testsuite/ld-alpha/tlsbin.rd index 4ce48ea..6918611 100644 --- a/ld/testsuite/ld-alpha/tlsbin.rd +++ b/ld/testsuite/ld-alpha/tlsbin.rd @@ -35,7 +35,7 @@ There are [0-9]+ program headers, starting at offset [0-9]+ Program Headers: Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align - PHDR +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x0+150 R E 0x8 + PHDR +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x0+150 R +0x8 INTERP +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ R +0x1 .*Requesting program interpreter.* LOAD +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ R E 0x10000 diff --git a/ld/testsuite/ld-alpha/tlsbinr.rd b/ld/testsuite/ld-alpha/tlsbinr.rd index 8b7b76a..c3a275f 100644 --- a/ld/testsuite/ld-alpha/tlsbinr.rd +++ b/ld/testsuite/ld-alpha/tlsbinr.rd @@ -35,7 +35,7 @@ There are [0-9]+ program headers, starting at offset [0-9]+ Program Headers: +Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align - +PHDR +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ R E 0x8 + +PHDR +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ R +0x8 +INTERP +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ R +0x1 .*Requesting program interpreter.* +LOAD +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ R E 0x10000 |