diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2018-01-11 19:01:39 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2018-01-11 19:01:52 -0800 |
commit | 47acac12c83f173481debc64618626b50ecf7498 (patch) | |
tree | e48aae92826c2b354a47ca3721c85cfa93b4194e /include | |
parent | 6181e9c2c5ba252ac016f51903dc35d7bfbbca71 (diff) | |
download | gdb-47acac12c83f173481debc64618626b50ecf7498.zip gdb-47acac12c83f173481debc64618626b50ecf7498.tar.gz gdb-47acac12c83f173481debc64618626b50ecf7498.tar.bz2 |
ld: Add "-z separate-code" option to ELF linker
The new "-z separate-code" option will generate separate code LOAD
segment which must be in wholly disjoint pages from any other data.
include/
PR ld/22393
* bfdlink.h (bfd_link_info): Add separate_code.
ld/
PR ld/22393
* NEWS: Mention "-z separate-code".
* emultempl/elf32.em (gld${EMULATION_NAME}_get_script): Get
builtin linker scripts and return linker scripts from disk for
"-z separate-code".
(gld${EMULATION_NAME}_handle_option): Handle "-z separate-code"
and "-z noseparate-code".
* genscripts.sh: Generate linker scripts for "-z separate-code".
(LD_FLAG): Set to *textonly for "-z separate-code".
* ld.texinfo: Document "-z separate-code".
* lexsup.c (elf_shlib_list_options): Add linker help messsages
for "-z separate-code" and "-z noseparate-code".
* scripttempl/elf.sc (SEPARATE_TEXT): New
(TEXT_SEGMENT_ALIGN): Likewise.
Use ${TEXT_SEGMENT_ALIGN} to align and pad text segment to
${MAXPAGESIZE}.
Diffstat (limited to 'include')
-rw-r--r-- | include/ChangeLog | 5 | ||||
-rw-r--r-- | include/bfdlink.h | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/include/ChangeLog b/include/ChangeLog index 3105a03..689fce9 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,8 @@ +2018-01-11 H.J. Lu <hongjiu.lu@intel.com> + + PR ld/22393 + * bfdlink.h (bfd_link_info): Add separate_code. + 2018-01-04 Jim Wilson <jimw@sifive.com> * opcode/riscv-opc.h (CSR_SBADADDR): Rename to CSR_STVAL. Rename diff --git a/include/bfdlink.h b/include/bfdlink.h index f5c23de..5d637ac 100644 --- a/include/bfdlink.h +++ b/include/bfdlink.h @@ -386,6 +386,9 @@ struct bfd_link_info /* TRUE if PT_GNU_RELRO segment should be created. */ unsigned int relro: 1; + /* TRUE if separate code segment should be created. */ + unsigned int separate_code: 1; + /* Nonzero if .eh_frame_hdr section and PT_GNU_EH_FRAME ELF segment should be created. 1 for DWARF2 tables, 2 for compact tables. */ unsigned int eh_frame_hdr_type: 2; |