Add a config option for default RELRO setting

Fixes #656.

Signed-off-by: Alexey Neyman <stilor@att.net>
This commit is contained in:
Alexey Neyman 2018-12-03 19:27:30 -08:00
parent d9afcd80fc
commit 893932e90f
3 changed files with 16 additions and 1 deletions

View File

@ -146,6 +146,16 @@ config BINUTILS_PLUGINS
Especially, gold can use the lto-plugin, as installed
by gcc, to handle LTO.
config BINUTILS_RELRO
tristate
prompt "Enable -z relro in ELF linker by default" if BINUTILS_2_27_or_later
default m
help
Setting this option forces "-z relro" by default in the ELF linker.
Clearing this option forces "-z norelro" by default in the ELF linker.
Setting this option to 'M' configures binutils with their internal
default for the selected architecture.
config BINUTILS_EXTRA_CONFIG_ARRAY
string
prompt "binutils extra config"

View File

@ -1,6 +1,6 @@
repository='git git://sourceware.org/git/binutils-gdb.git'
mirrors='$(CT_Mirrors GNU binutils) $(CT_Mirrors sourceware binutils/releases)'
origin='GNU'
milestones='2.23 2.25 2.30'
milestones='2.23 2.25 2.27 2.30'
archive_formats='.tar.xz .tar.bz2 .tar.gz'
signature_format='packed/.sig'

View File

@ -153,6 +153,11 @@ do_binutils_backend() {
if [ "${CT_BINUTILS_PLUGINS}" = "y" ]; then
extra_config+=( --enable-plugins )
fi
if [ "${CT_BINUTILES_RELRO}" = "y" ]; then
extra_config+=( --enable-relro )
elif [ "${CT_BINUTILS_RELRO}" != "m" ]; then
extra_config+=( --disable-relro )
fi
if [ "${CT_BINUTILS_HAS_PKGVERSION_BUGURL}" = "y" ]; then
[ -n "${CT_PKGVERSION}" ] && extra_config+=("--with-pkgversion=${CT_PKGVERSION}")
[ -n "${CT_TOOLCHAIN_BUGURL}" ] && extra_config+=("--with-bugurl=${CT_TOOLCHAIN_BUGURL}")