aboutsummaryrefslogtreecommitdiff
path: root/ld/configure
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/configure
parent9167304255940e29423517f63d11bdd968d7685e (diff)
downloadgdb-f68c9d09a395ad4bb48661401475ba7f8e8b8a2b.zip
gdb-f68c9d09a395ad4bb48661401475ba7f8e8b8a2b.tar.gz
gdb-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/configure')
-rwxr-xr-xld/configure26
1 files changed, 24 insertions, 2 deletions
diff --git a/ld/configure b/ld/configure
index 07eb669..b7f29ca 100755
--- a/ld/configure
+++ b/ld/configure
@@ -852,6 +852,7 @@ enable_new_dtags
enable_relro
enable_textrel_check
enable_separate_code
+enable_mark_plt
enable_warn_execstack
enable_error_execstack
enable_warn_rwx_segments
@@ -1546,6 +1547,7 @@ Optional Features:
--enable-textrel-check=[yes|no|warning|error]
enable DT_TEXTREL check in ELF linker
--enable-separate-code enable -z separate-code in ELF linker by default
+ --enable-mark-plt enable -z mark-plt in ELF x86-64 linker by default
--enable-warn-execstack enable warnings when creating an executable stack
--enable-error-execstack
turn executable stack warnings into errors
@@ -11681,7 +11683,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11684 "configure"
+#line 11686 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11787,7 +11789,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11790 "configure"
+#line 11792 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -15682,6 +15684,17 @@ esac
fi
+# Decide if -z mark-plt should be enabled in ELF x86-64 linker by default.
+ac_default_ld_z_mark_plt=unset
+# Check whether --enable-mark-plt was given.
+if test "${enable_mark_plt+set}" = set; then :
+ enableval=$enable_mark_plt; case "${enableval}" in
+ yes) ac_default_ld_z_mark_plt=1 ;;
+ no) ac_default_ld_z_mark_plt=0 ;;
+esac
+fi
+
+
# By default warn when an executable stack is created due to object files
# requesting such, not when the user specifies -z execstack.
@@ -19365,6 +19378,15 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
+if test "${ac_default_ld_z_mark_plt}" = unset; then
+ ac_default_ld_z_mark_plt=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define DEFAULT_LD_Z_MARK_PLT $ac_default_ld_z_mark_plt
+_ACEOF
+
+
cat >>confdefs.h <<_ACEOF