From e8e10743f7b207b21a1efb0cc9e42487080db013 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Thu, 13 Jun 2024 15:10:15 +0100 Subject: Add --rosegment option to BFD linker to stop the '-z separate-code' from generating two read-only segments. PR 30907 --- ld/configure | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'ld/configure') diff --git a/ld/configure b/ld/configure index 9151640..83ea68f 100755 --- a/ld/configure +++ b/ld/configure @@ -852,6 +852,7 @@ enable_new_dtags enable_relro enable_textrel_check enable_separate_code +enable_rosegment enable_mark_plt enable_warn_execstack enable_error_execstack @@ -1547,6 +1548,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-rosegment enable --rosegment in the 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 @@ -15682,6 +15684,17 @@ esac fi +# Decide if --rosegment should be enabled in the ELF linker by default. +ac_default_ld_rosegment=unset +# Check whether --enable-rosegment was given. +if test "${enable_rosegment+set}" = set; then : + enableval=$enable_rosegment; case "${enableval}" in + yes) ac_default_ld_rosegment=1 ;; + no) ac_default_ld_rosegment=0 ;; +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. @@ -19381,6 +19394,15 @@ cat >>confdefs.h <<_ACEOF _ACEOF +if test "${ac_default_ld_rosegment}" = unset; then + ac_default_ld_rosegment=0 +fi + +cat >>confdefs.h <<_ACEOF +#define DEFAULT_LD_ROSEGMENT $ac_default_ld_rosegment +_ACEOF + + if test "${ac_default_ld_z_mark_plt}" = unset; then ac_default_ld_z_mark_plt=0 fi -- cgit v1.1