Richard Henderson <richard.hender...@linaro.org> writes:
> There is nothing about these options that is related to PIE. > Use them unconditionally. > > Signed-off-by: Richard Henderson <richard.hender...@linaro.org> Reviewed-by: Alex Bennée <alex.ben...@linaro.org> > --- > v2: Do not split into two tests. > --- > configure | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/configure b/configure > index 7a646ec007..2503288654 100755 > --- a/configure > +++ b/configure > @@ -2040,9 +2040,6 @@ if test "$pie" != "no" ; then > QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS" > LDFLAGS="-pie $LDFLAGS" > pie="yes" > - if compile_prog "" "-Wl,-z,relro -Wl,-z,now" ; then > - LDFLAGS="-Wl,-z,relro -Wl,-z,now $LDFLAGS" > - fi > else > if test "$pie" = "yes"; then > error_exit "PIE not available due to missing toolchain support" > @@ -2053,6 +2050,12 @@ if test "$pie" != "no" ; then > fi > fi > > +# Detect support for PT_GNU_RELRO + DT_BIND_NOW. > +# The combination is known as "full relro", because .got is read-only too. > +if compile_prog "" "-Wl,-z,relro -Wl,-z,now" ; then > + LDFLAGS="-Wl,-z,relro -Wl,-z,now $LDFLAGS" > +fi > + > ########################################## > # __sync_fetch_and_and requires at least -march=i486. Many toolchains > # use i686 as default anyway, but for those that don't, an explicit -- Alex Bennée