qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 5/7] configure: Unnest detection of -z, relro and -z, now


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v2 5/7] configure: Unnest detection of -z, relro and -z, now
Date: Wed, 18 Dec 2019 23:46:28 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2

On 12/18/19 11:34 PM, Richard Henderson wrote:
There is nothing about these options that is related to PIE.
Use them unconditionally.

Signed-off-by: Richard Henderson <address@hidden>
---
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


Reviewed-by: Philippe Mathieu-Daudé <address@hidden>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]