This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] ld: Add OTHER_PLT_SECTIONS
- From: H.J.Lu <hjl at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 12 Nov 2017 15:31:41 -0000
- Subject: [binutils-gdb] ld: Add OTHER_PLT_SECTIONS
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ce3ad333570333287842ed20f55220534ad4a025
commit ce3ad333570333287842ed20f55220534ad4a025
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Sun Nov 12 07:25:26 2017 -0800
ld: Add OTHER_PLT_SECTIONS
OTHER_PLT_SECTIONS contains sections which should be placed right after
.plt section.
* emulparams/elf32_x86_64.sh (TINY_READONLY_SECTION): Renamed
to ...
(OTHER_PLT_SECTIONS): This.
* emulparams/elf_i386.sh: Likewise.
* emulparams/elf_iamcu.sh: Likewise.
* emulparams/elf_x86_64.sh: Likewise.
* scripttempl/elf.sc: Place ${OTHER_PLT_SECTIONS} just after
.plt.
Diff:
---
ld/ChangeLog | 11 +++++++++++
ld/emulparams/elf32_x86_64.sh | 4 ++--
ld/emulparams/elf_i386.sh | 4 ++--
ld/emulparams/elf_iamcu.sh | 4 ++--
ld/emulparams/elf_x86_64.sh | 4 ++--
ld/scripttempl/elf.sc | 5 +++--
6 files changed, 22 insertions(+), 10 deletions(-)
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 2b6a334..59aff56 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,14 @@
+2017-11-12 H.J. Lu <hongjiu.lu@intel.com>
+
+ * emulparams/elf32_x86_64.sh (TINY_READONLY_SECTION): Renamed
+ to ...
+ (OTHER_PLT_SECTIONS): This.
+ * emulparams/elf_i386.sh: Likewise.
+ * emulparams/elf_iamcu.sh: Likewise.
+ * emulparams/elf_x86_64.sh: Likewise.
+ * scripttempl/elf.sc: Place ${OTHER_PLT_SECTIONS} just after
+ .plt.
+
2017-11-09 H.J. Lu <hongjiu.lu@intel.com>
* emultempl/elf32.em (gld${EMULATION_NAME}_get_script): Reformat
diff --git a/ld/emulparams/elf32_x86_64.sh b/ld/emulparams/elf32_x86_64.sh
index 03f9d83..9ce6533 100644
--- a/ld/emulparams/elf32_x86_64.sh
+++ b/ld/emulparams/elf32_x86_64.sh
@@ -21,8 +21,8 @@ LARGE_SECTIONS=yes
LARGE_BSS_AFTER_BSS=
SEPARATE_GOTPLT="SIZEOF (.got.plt) >= 24 ? 24 : 0"
IREL_IN_PLT=
-# Reuse TINY_READONLY_SECTION which is placed right after .plt section.
-TINY_READONLY_SECTION="
+# These sections are placed right after .plt section.
+OTHER_PLT_SECTIONS="
.plt.got ${RELOCATING-0} : { *(.plt.got) }
.plt.sec ${RELOCATING-0} : { *(.plt.sec) }
"
diff --git a/ld/emulparams/elf_i386.sh b/ld/emulparams/elf_i386.sh
index 084497c..2cef106 100644
--- a/ld/emulparams/elf_i386.sh
+++ b/ld/emulparams/elf_i386.sh
@@ -17,8 +17,8 @@ GENERATE_PIE_SCRIPT=yes
NO_SMALL_DATA=yes
SEPARATE_GOTPLT="SIZEOF (.got.plt) >= 12 ? 12 : 0"
IREL_IN_PLT=
-# Reuse TINY_READONLY_SECTION which is placed right after .plt section.
-TINY_READONLY_SECTION="
+# These sections are placed right after .plt section.
+OTHER_PLT_SECTIONS="
.plt.got ${RELOCATING-0} : { *(.plt.got) }
.plt.sec ${RELOCATING-0} : { *(.plt.sec) }
"
diff --git a/ld/emulparams/elf_iamcu.sh b/ld/emulparams/elf_iamcu.sh
index 863027b..d910b65 100644
--- a/ld/emulparams/elf_iamcu.sh
+++ b/ld/emulparams/elf_iamcu.sh
@@ -17,8 +17,8 @@ GENERATE_PIE_SCRIPT=yes
NO_SMALL_DATA=yes
SEPARATE_GOTPLT="SIZEOF (.got.plt) >= 12 ? 12 : 0"
IREL_IN_PLT=
-# Reuse TINY_READONLY_SECTION which is placed right after .plt section.
-TINY_READONLY_SECTION="
+# These sections are placed right after .plt section.
+OTHER_PLT_SECTIONS="
.plt.got ${RELOCATING-0} : { *(.plt.got) }
"
diff --git a/ld/emulparams/elf_x86_64.sh b/ld/emulparams/elf_x86_64.sh
index 09f3cda..d8c6e54 100644
--- a/ld/emulparams/elf_x86_64.sh
+++ b/ld/emulparams/elf_x86_64.sh
@@ -21,8 +21,8 @@ LARGE_SECTIONS=yes
LARGE_BSS_AFTER_BSS=
SEPARATE_GOTPLT="SIZEOF (.got.plt) >= 24 ? 24 : 0"
IREL_IN_PLT=
-# Reuse TINY_READONLY_SECTION which is placed right after .plt section.
-TINY_READONLY_SECTION="
+# These sections are placed right after .plt section.
+OTHER_PLT_SECTIONS="
.plt.got ${RELOCATING-0} : { *(.plt.got) }
.plt.sec ${RELOCATING-0} : { *(.plt.sec) }
"
diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc
index c0845c5..9f291b3 100644
--- a/ld/scripttempl/elf.sc
+++ b/ld/scripttempl/elf.sc
@@ -37,6 +37,7 @@
# writeable data sections.
# OTHER_GOT_SYMBOLS - symbols defined just before .got.
# OTHER_GOT_SECTIONS - sections just after .got.
+# OTHER_PLT_SECTIONS - sections just after .plt.
# OTHER_SDATA_SECTIONS - sections just after .sdata.
# OTHER_BSS_SYMBOLS - symbols that appear at the start of the
# .bss section besides __bss_start.
@@ -484,7 +485,7 @@ cat <<EOF
${RELOCATING+${INIT_END}}
} ${FILL}
- ${TEXT_PLT+${PLT_NEXT_DATA-${PLT}}}
+ ${TEXT_PLT+${PLT_NEXT_DATA-${PLT} ${OTHER_PLT_SECTIONS}}}
${TINY_READONLY_SECTION}
.text ${RELOCATING-0} :
{
@@ -549,7 +550,7 @@ cat <<EOF
/* These sections are generated by the Sun/Oracle C++ compiler. */
.exception_ranges ${RELOCATING-0} : ONLY_IF_RO { *(.exception_ranges
.exception_ranges*) }
- ${TEXT_PLT+${PLT_NEXT_DATA+${PLT}}}
+ ${TEXT_PLT+${PLT_NEXT_DATA+${PLT} ${OTHER_PLT_SECTIONS}}}
/* Adjust the address for the data segment. We want to adjust up to
the same address within the page on the next page up. */