diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2020-05-28 04:21:04 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2020-05-28 04:21:16 -0700 |
commit | b32632c49968cd03e952f9b63b32d9e9f1ddaf53 (patch) | |
tree | 49233e497456cbd09e444e4f4aad77f009c681a7 /ld/configure | |
parent | 151f5de4a6548cd83a79b4705f1e901776ddacc5 (diff) | |
download | gdb-b32632c49968cd03e952f9b63b32d9e9f1ddaf53.zip gdb-b32632c49968cd03e952f9b63b32d9e9f1ddaf53.tar.gz gdb-b32632c49968cd03e952f9b63b32d9e9f1ddaf53.tar.bz2 |
ld: Add --enable-textrel-check=[no|yes|warning|error]
Add a configure option, --enable-textrel-check=[no|yes|warning|error],
to decide what ELF linker should do by default with DT_TEXTREL in an
executable or shared library.
PR ld/20824
* NEWS: Mention --enable-textrel-check=[no|yes|warning|error].
* configure.ac: Add --enable-textrel-check=[no|yes|warning|error].
(DEFAULT_LD_TEXTREL_CHECK): New AC_DEFINE_UNQUOTED.
(DEFAULT_LD_TEXTREL_CHECK_WARNING): Likewise.
* ldmain.c (main): Initialize link_info.textrel_check to
DEFAULT_LD_TEXTREL_CHECK.
* lexsup.c (ld_options): Check DEFAULT_LD_TEXTREL_CHECK_WARNING.
* config.in: Regenerated.
* configure: Likewise.
Diffstat (limited to 'ld/configure')
-rwxr-xr-x | ld/configure | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/ld/configure b/ld/configure index e1dbc95..e70e7c3 100755 --- a/ld/configure +++ b/ld/configure @@ -831,6 +831,7 @@ enable_got enable_compressed_debug_sections enable_new_dtags enable_relro +enable_textrel_check enable_separate_code enable_default_hash_style enable_werror @@ -1498,6 +1499,8 @@ Optional Features: compress debug sections by default] --enable-new-dtags set DT_RUNPATH instead of DT_RPATH by default] --enable-relro enable -z relro in ELF linker by default + --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-default-hash-style={sysv,gnu,both} use this default hash style @@ -12032,7 +12035,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12035 "configure" +#line 12038 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12138,7 +12141,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12141 "configure" +#line 12144 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -15876,6 +15879,16 @@ if test "${enable_relro+set}" = set; then : esac fi +# Decide if DT_TEXTREL check should be enabled in ELF linker. +ac_default_ld_textrel_check=unset +# Check whether --enable-textrel-check was given. +if test "${enable_textrel_check+set}" = set; then : + enableval=$enable_textrel_check; case "${enableval}" in + yes|no|warning|error) ac_default_ld_textrel_check=${enableval} ;; +esac +fi + + # Decide if -z separate-code should be enabled in ELF linker by default. ac_default_ld_z_separate_code=unset # Check whether --enable-separate-code was given. @@ -17618,6 +17631,30 @@ cat >>confdefs.h <<_ACEOF _ACEOF +ac_default_ld_textrel_check_warning=0 +case "${ac_default_ld_textrel_check}" in + unset|no) + ac_default_ld_textrel_check=textrel_check_none + ;; + yes|warning) + ac_default_ld_textrel_check=textrel_check_warning + ac_default_ld_textrel_check_warning=1 + ;; + error) + ac_default_ld_textrel_check=textrel_check_error + ;; +esac + +cat >>confdefs.h <<_ACEOF +#define DEFAULT_LD_TEXTREL_CHECK $ac_default_ld_textrel_check +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define DEFAULT_LD_TEXTREL_CHECK_WARNING $ac_default_ld_textrel_check_warning +_ACEOF + + if test "${ac_default_ld_z_separate_code}" = unset; then ac_default_ld_z_separate_code=0 fi |