diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2016-06-22 05:39:22 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2016-06-22 05:39:39 -0700 |
commit | 6b1edb94fedc7103b4929354d27304d0bd756f49 (patch) | |
tree | 8ec307e7bd06be77c1e3ee1f0035494f54520297 /gold/configure | |
parent | 647e4d46495f2bfb0950fd1066c8a660173cca40 (diff) | |
download | gdb-6b1edb94fedc7103b4929354d27304d0bd756f49.zip gdb-6b1edb94fedc7103b4929354d27304d0bd756f49.tar.gz gdb-6b1edb94fedc7103b4929354d27304d0bd756f49.tar.bz2 |
gold: Add a linker configure option --enable-relro
Add a configure option --enable-relro to decide whether -z relro should
be enabled by default. Default to yes.
PR ld/20283
* NEWS: Mention --enable-relro.
* configure.ac: Add --enable-relro.
(DEFAULT_LD_Z_RELRO): New. Set by --enable-relro and default
to 1.
* config.in: Regenerated.
* configure: Likewise.
* options.h (General_options::relro): Default to
DEFAULT_LD_Z_RELRO.
Diffstat (limited to 'gold/configure')
-rwxr-xr-x | gold/configure | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gold/configure b/gold/configure index 6d4f234..a40b2b5 100755 --- a/gold/configure +++ b/gold/configure @@ -792,6 +792,7 @@ with_sysroot enable_gold enable_threads enable_plugins +enable_relro enable_targets with_lib_path enable_dependency_tracking @@ -1441,6 +1442,7 @@ Optional Features: --enable-gold[=ARG] build gold [ARG={default,yes,no}] --enable-threads multi-threaded linking --enable-plugins linker plugins + --enable-relro enable -z relro in ELF linker by default --enable-targets alternative target configurations --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors @@ -3353,6 +3355,25 @@ else fi +# Decide if -z relro should be enabled in ELF linker by default. +ac_default_ld_z_relro=unset +# Provide a configure time option to override our default. +# Check whether --enable-relro was given. +if test "${enable_relro+set}" = set; then : + enableval=$enable_relro; case "${enableval}" in + yes) ac_default_ld_z_relro=1 ;; + no) ac_default_ld_z_relro=0 ;; +esac +fi +if test "${ac_default_ld_z_relro}" = unset; then + ac_default_ld_z_relro=1 +fi + +cat >>confdefs.h <<_ACEOF +#define DEFAULT_LD_Z_RELRO $ac_default_ld_z_relro +_ACEOF + + # Check whether --enable-targets was given. if test "${enable_targets+set}" = set; then : enableval=$enable_targets; case "${enableval}" in |