]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Check relro directly
authorAki Tuomi <cmouse@desteem.org>
Mon, 15 Dec 2014 13:52:12 +0000 (15:52 +0200)
committerAki Tuomi <cmouse@desteem.org>
Mon, 15 Dec 2014 13:52:12 +0000 (15:52 +0200)
pdns/configure-recursor

index 4adf6a51a195aab6e7fbc7d137ddfc0b67d105f6..2882ba0c84c8c3e2f9f56c0223ac56946c671769 100755 (executable)
@@ -17,12 +17,9 @@ CF_STACK=""
 test_flags() {
   # test for relocation
 
-  relro=`$CXX -Wl,-help | grep -om1 -- '-z relro'`
-  now=`$CXX -Wl,-help | grep -om1 -- '-z now'`
-
-  if [ "$relro" = "-z relro" ]; then
+  if $CXX -Wl,-help | grep -q 'z relro'; then
     export LD_RELRO="-Wl,-z -Wl,relro"
-    if [ "$now" = "-z now" ]; then
+    if $CXX -Wl,-help | grep -q 'z now'; then
       export LD_RELRO="$LD_RELRO -Wl,-z -Wl,now"
     fi
   fi
@@ -38,8 +35,8 @@ EOF
 
   # test for PIE
 
-  if $CXX $src -c -o a.out -fPIE -fPIC -DPIE; then 
-    if $CXX -pie -o a2.out a.out; then 
+  if $CXX $src -c -o a.out -fPIE -fPIC -DPIE; then
+    if $CXX -pie -o a2.out a.out; then
       export CF_PIE="-fPIE -fPIC -DPIE"
       export LD_PIE="-pie"
     fi