diff options
author | Alan Modra <amodra@gmail.com> | 2018-10-05 11:40:54 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2018-10-08 20:26:08 +1030 |
commit | 64029e93683a266c38d19789e780f3748bd6a188 (patch) | |
tree | 9984a3e982904e0132021869f097249ccdc99759 /ld/testsuite/ld-tic6x | |
parent | 7358942661ccb0ea1e819fd2f5d47914cebf0aa2 (diff) | |
download | fsf-binutils-gdb-64029e93683a266c38d19789e780f3748bd6a188.zip fsf-binutils-gdb-64029e93683a266c38d19789e780f3748bd6a188.tar.gz fsf-binutils-gdb-64029e93683a266c38d19789e780f3748bd6a188.tar.bz2 |
Separate header PT_LOAD for -z separate-code
This patch, along with previous patches in the series, supports
putting the ELF file header and program headers in a PT_LOAD without
sections.
Logic governing whether headers a loaded has changed a little: The
primary reason to include headers is now the presence of
SIZEOF_HEADERS in a linker script. However, to support scripts that
may have reserved space for headers by hand, we continue to add
headers whenever the first section address is past the end of headers
modulo page size.
include/
* bfdlink.h (struct bfd_link_info): Add load_phdrs field.
bfd/
* elf-nacl.c (nacl_modify_segment_map): Cope with header PT_LOAD
lacking sections.
* elf.c (_bfd_elf_map_sections_to_segments): Assume file and
program headers are required when info->load_phdrs. Reorganize
code handling program headers. Generate a mapping without
sections just for file and program headers when -z separate-code
would indicate they should be on a different page to the first
section.
ld/
* ldexp.c (fold_name <SIZEOF_HEADERS>): Set link_info.load_phdrs.
* testsuite/ld-elf/loadaddr1.d: Pass -z noseparate-code.
* testsuite/ld-elf/loadaddr2.d: Likewise.
* testsuite/ld-i386/vxworks2.sd: Adjust expected output.
* testsuite/ld-powerpc/vxworks2.sd: Likewise.
* testsuite/ld-elf/overlay.d: Remove spu xfail.
* testsuite/ld-spu/ovl.lnk: Don't use SIZEOF_HEADERS.
* testsuite/ld-tic6x/dsbt-be.ld: Likewise.
* testsuite/ld-tic6x/dsbt-inrange.ld: Likewise.
* testsuite/ld-tic6x/dsbt-overflow.ld: Likewise.
* testsuite/ld-tic6x/dsbt.ld: Likewise.
Diffstat (limited to 'ld/testsuite/ld-tic6x')
-rw-r--r-- | ld/testsuite/ld-tic6x/dsbt-be.ld | 1 | ||||
-rw-r--r-- | ld/testsuite/ld-tic6x/dsbt-inrange.ld | 1 | ||||
-rw-r--r-- | ld/testsuite/ld-tic6x/dsbt-overflow.ld | 1 | ||||
-rw-r--r-- | ld/testsuite/ld-tic6x/dsbt.ld | 1 |
4 files changed, 0 insertions, 4 deletions
diff --git a/ld/testsuite/ld-tic6x/dsbt-be.ld b/ld/testsuite/ld-tic6x/dsbt-be.ld index 40ba14c..b78d910 100644 --- a/ld/testsuite/ld-tic6x/dsbt-be.ld +++ b/ld/testsuite/ld-tic6x/dsbt-be.ld @@ -3,7 +3,6 @@ OUTPUT_FORMAT("elf32-tic6x-be", "elf32-tic6x-be", EXTERN (__c6xabi_DSBT_BASE); SECTIONS { - PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x0)); . = SEGMENT_START("text-segment", 0x0) + SIZEOF_HEADERS; . = 0x8000; .hash : { *(.hash) } .gnu.hash : { *(.gnu.hash) } diff --git a/ld/testsuite/ld-tic6x/dsbt-inrange.ld b/ld/testsuite/ld-tic6x/dsbt-inrange.ld index 603f020..e5a2c87 100644 --- a/ld/testsuite/ld-tic6x/dsbt-inrange.ld +++ b/ld/testsuite/ld-tic6x/dsbt-inrange.ld @@ -1,7 +1,6 @@ EXTERN (__c6xabi_DSBT_BASE); SECTIONS { - PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x0)); . = SEGMENT_START("text-segment", 0x0) + SIZEOF_HEADERS; . = 0x8000; .hash : { *(.hash) } .gnu.hash : { *(.gnu.hash) } diff --git a/ld/testsuite/ld-tic6x/dsbt-overflow.ld b/ld/testsuite/ld-tic6x/dsbt-overflow.ld index 3128a35..fecd865 100644 --- a/ld/testsuite/ld-tic6x/dsbt-overflow.ld +++ b/ld/testsuite/ld-tic6x/dsbt-overflow.ld @@ -1,7 +1,6 @@ EXTERN (__c6xabi_DSBT_BASE); SECTIONS { - PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x0)); . = SEGMENT_START("text-segment", 0x0) + SIZEOF_HEADERS; . = 0x8000; .hash : { *(.hash) } .gnu.hash : { *(.gnu.hash) } diff --git a/ld/testsuite/ld-tic6x/dsbt.ld b/ld/testsuite/ld-tic6x/dsbt.ld index fdde8ba..83b93ff 100644 --- a/ld/testsuite/ld-tic6x/dsbt.ld +++ b/ld/testsuite/ld-tic6x/dsbt.ld @@ -3,7 +3,6 @@ OUTPUT_FORMAT("elf32-tic6x-le", "elf32-tic6x-le", EXTERN (__c6xabi_DSBT_BASE); SECTIONS { - PROVIDE (__executable_start = SEGMENT_START("text-segment", 0x0)); . = SEGMENT_START("text-segment", 0x0) + SIZEOF_HEADERS; . = 0x8000; .hash : { *(.hash) } .gnu.hash : { *(.gnu.hash) } |