aboutsummaryrefslogtreecommitdiff
path: root/ld/ld.texinfo
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2018-01-11 19:01:39 -0800
committerH.J. Lu <hjl.tools@gmail.com>2018-01-11 19:01:52 -0800
commit47acac12c83f173481debc64618626b50ecf7498 (patch)
treee48aae92826c2b354a47ca3721c85cfa93b4194e /ld/ld.texinfo
parent6181e9c2c5ba252ac016f51903dc35d7bfbbca71 (diff)
downloadbinutils-47acac12c83f173481debc64618626b50ecf7498.zip
binutils-47acac12c83f173481debc64618626b50ecf7498.tar.gz
binutils-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 'ld/ld.texinfo')
-rw-r--r--ld/ld.texinfo7
1 files changed, 7 insertions, 0 deletions
diff --git a/ld/ld.texinfo b/ld/ld.texinfo
index 4fd12bb..8cd2bed 100644
--- a/ld/ld.texinfo
+++ b/ld/ld.texinfo
@@ -1264,6 +1264,13 @@ relocation, if supported. Specifying @samp{common-page-size} smaller
than the system page size will render this protection ineffective.
Don't create an ELF @code{PT_GNU_RELRO} segment if @samp{norelro}.
+@item separate-code
+@itemx noseparate-code
+Create separate code @code{PT_LOAD} segment header in the object. This
+specifies a memory segment that should contain only instructions and must
+be in wholly disjoint pages from any other data. Don't create separate
+code @code{PT_LOAD} segment if @samp{noseparate-code} is used.
+
@item shstk
Generate GNU_PROPERTY_X86_FEATURE_1_SHSTK in .note.gnu.property section
to indicate compatibility with Intel Shadow Stack. Supported for