aboutsummaryrefslogtreecommitdiff
path: root/ld/emultempl
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2024-01-05 13:16:29 -0800
committerH.J. Lu <hjl.tools@gmail.com>2024-01-09 06:45:38 -0800
commitf68c9d09a395ad4bb48661401475ba7f8e8b8a2b (patch)
treea929c5b1da632d0a87e59f28b2084f8b6fb94904 /ld/emultempl
parent9167304255940e29423517f63d11bdd968d7685e (diff)
downloadbinutils-f68c9d09a395ad4bb48661401475ba7f8e8b8a2b.zip
binutils-f68c9d09a395ad4bb48661401475ba7f8e8b8a2b.tar.gz
binutils-f68c9d09a395ad4bb48661401475ba7f8e8b8a2b.tar.bz2
ld: Add --enable-mark-plt configure option
Add --enable-mark-plt linker configure option to mark PLT entries with DT_X86_64_PLT, DT_X86_64_PLTSZ and DT_X86_64_PLTENT dynamic tags by default. * NEWS: Mention -z mark-plt/-z nomark-plt and --enable-mark-plt. * config.in: Regenerated. * configure: Likewise. * configure.ac: Add --enable-mark-plt. (DEFAULT_LD_Z_MARK_PLT): New AC_DEFINE_UNQUOTED. * emulparams/x86-64-plt.sh (PARSE_AND_LIST_OPTIONS_X86_64_PLT): Support DEFAULT_LD_Z_MARK_PLT. * emultempl/elf-x86.em (elf_x86_64_before_parse): New function. (LDEMUL_BEFORE_PARSE): New. Set to elf_x86_64_before_parse for x86-64 targets.
Diffstat (limited to 'ld/emultempl')
-rw-r--r--ld/emultempl/elf-x86.em17
1 files changed, 17 insertions, 0 deletions
diff --git a/ld/emultempl/elf-x86.em b/ld/emultempl/elf-x86.em
index 0ccad72..2e9863f 100644
--- a/ld/emultempl/elf-x86.em
+++ b/ld/emultempl/elf-x86.em
@@ -56,3 +56,20 @@ EOF
LDEMUL_BEFORE_PARSE=elf_x86_before_parse
fi
+
+case x${OUTPUT_FORMAT}${CALL_NOP_BYTE} in
+ x*x86-64*0x67)
+fragment <<EOF
+
+static void
+elf_x86_64_before_parse (void)
+{
+ params.mark_plt = DEFAULT_LD_Z_MARK_PLT;
+
+ elf_x86_before_parse ();
+}
+EOF
+
+ LDEMUL_BEFORE_PARSE=elf_x86_64_before_parse
+ ;;
+esac