Since we have kbind(2), we don't need -znow to use -zrelro
authorguenther <guenther@openbsd.org>
Sun, 7 Aug 2016 20:00:39 +0000 (20:00 +0000)
committerguenther <guenther@openbsd.org>
Sun, 7 Aug 2016 20:00:39 +0000 (20:00 +0000)
ok kettenis@

gnu/usr.bin/binutils-2.17/ld/emultempl/elf32.em
gnu/usr.bin/binutils-2.17/ld/genscripts.sh

index 032441b..01dd362 100644 (file)
@@ -1940,8 +1940,7 @@ fi
 if test -n "$GENERATE_PIE_SCRIPT" ; then
 if test -n "$GENERATE_COMBRELOC_SCRIPT" ; then
 echo '  ; else if (link_info.pie && link_info.combreloc' >> e${EMULATION_NAME}.c
-echo '             && link_info.relro' >> e${EMULATION_NAME}.c
-echo '             && (link_info.flags & DF_BIND_NOW)) return' >> e${EMULATION_NAME}.c
+echo '             && link_info.relro) return' >> e${EMULATION_NAME}.c
 sed $sc ldscripts/${EMULATION_NAME}.xdw                        >> e${EMULATION_NAME}.c
 echo '  ; else if (link_info.pie && link_info.combreloc && config.data_bss_contig == TRUE) return' >> e${EMULATION_NAME}.c
 sed $sc ldscripts/${EMULATION_NAME}.xdcz                >> e${EMULATION_NAME}.c
@@ -1956,8 +1955,7 @@ fi
 if test -n "$GENERATE_SHLIB_SCRIPT" ; then
 if test -n "$GENERATE_COMBRELOC_SCRIPT" ; then
 echo '  ; else if (link_info.shared && link_info.combreloc' >> e${EMULATION_NAME}.c
-echo '             && link_info.relro' >> e${EMULATION_NAME}.c
-echo '             && (link_info.flags & DF_BIND_NOW)) return' >> e${EMULATION_NAME}.c
+echo '             && link_info.relro) return' >> e${EMULATION_NAME}.c
 sed $sc ldscripts/${EMULATION_NAME}.xsw                        >> e${EMULATION_NAME}.c
 echo '  ; else if (link_info.shared && link_info.combreloc) return' >> e${EMULATION_NAME}.c
 sed $sc ldscripts/${EMULATION_NAME}.xsc                        >> e${EMULATION_NAME}.c
@@ -1968,8 +1966,7 @@ fi
 echo '  ; else if (config.data_bss_contig == TRUE) return' >> e${EMULATION_NAME}.c
 sed $sc ldscripts/${EMULATION_NAME}.xz                 >> e${EMULATION_NAME}.c
 if test -n "$GENERATE_COMBRELOC_SCRIPT" ; then
-echo '  ; else if (link_info.combreloc && link_info.relro' >> e${EMULATION_NAME}.c
-echo '             && (link_info.flags & DF_BIND_NOW)) return' >> e${EMULATION_NAME}.c
+echo '  ; else if (link_info.combreloc && link_info.relro) return' >> e${EMULATION_NAME}.c
 sed $sc ldscripts/${EMULATION_NAME}.xw                 >> e${EMULATION_NAME}.c
 echo '  ; else if (link_info.combreloc) return'                >> e${EMULATION_NAME}.c
 sed $sc ldscripts/${EMULATION_NAME}.xc                 >> e${EMULATION_NAME}.c
@@ -2002,8 +1999,7 @@ fi
 if test -n "$GENERATE_PIE_SCRIPT" ; then
 if test -n "$GENERATE_COMBRELOC_SCRIPT" ; then
 cat >>e${EMULATION_NAME}.c <<EOF
-  else if (link_info.pie && link_info.combreloc
-          && link_info.relro && (link_info.flags & DF_BIND_NOW))
+  else if (link_info.pie && link_info.combreloc && link_info.relro)
     return "ldscripts/${EMULATION_NAME}.xdw";
   else if (link_info.pie && link_info.combreloc && config.data_bss_contig == TRUE)
     return "ldscripts/${EMULATION_NAME}.xdcz";
@@ -2021,8 +2017,7 @@ fi
 if test -n "$GENERATE_SHLIB_SCRIPT" ; then
 if test -n "$GENERATE_COMBRELOC_SCRIPT" ; then
 cat >>e${EMULATION_NAME}.c <<EOF
-  else if (link_info.shared && link_info.combreloc
-          && link_info.relro && (link_info.flags & DF_BIND_NOW))
+  else if (link_info.shared && link_info.combreloc && link_info.relro)
     return "ldscripts/${EMULATION_NAME}.xsw";
   else if (link_info.shared && link_info.combreloc)
     return "ldscripts/${EMULATION_NAME}.xsc";
@@ -2039,8 +2034,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
 EOF
 if test -n "$GENERATE_COMBRELOC_SCRIPT" ; then
 cat >>e${EMULATION_NAME}.c <<EOF
-  else if (link_info.combreloc && link_info.relro
-          && (link_info.flags & DF_BIND_NOW))
+  else if (link_info.combreloc && link_info.relro)
     return "ldscripts/${EMULATION_NAME}.xw";
   else if (link_info.combreloc)
     return "ldscripts/${EMULATION_NAME}.xc";
index 534916c..6c49e4c 100755 (executable)
@@ -278,7 +278,7 @@ if test -n "$GENERATE_COMBRELOC_SCRIPT"; then
   LD_FLAG=w
   RELRO_NOW=" "
   COMBRELOC=ldscripts/${EMULATION_NAME}.xw.tmp
-  ( echo "/* Script for -z combreloc -z now -z relro: combine and sort reloc sections */"
+  ( echo "/* Script for -z combreloc -z relro: combine and sort reloc sections */"
     . ${CUSTOMIZER_SCRIPT} ${EMULATION_NAME}
     . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
   ) | sed -e '/^ *$/d;s/[      ]*$//' > ldscripts/${EMULATION_NAME}.xw
@@ -309,7 +309,7 @@ if test -n "$GENERATE_SHLIB_SCRIPT"; then
     LD_FLAG=wshared
     RELRO_NOW=" "
     COMBRELOC=ldscripts/${EMULATION_NAME}.xsw.tmp
-    ( echo "/* Script for --shared -z combreloc -z now -z relro: shared library, combine & sort relocs */"
+    ( echo "/* Script for --shared -z combreloc -z relro: shared library, combine & sort relocs */"
       . ${CUSTOMIZER_SCRIPT} ${EMULATION_NAME}
       . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
     ) | sed -e '/^ *$/d;s/[    ]*$//' > ldscripts/${EMULATION_NAME}.xsw
@@ -342,7 +342,7 @@ if test -n "$GENERATE_PIE_SCRIPT"; then
     LD_FLAG=wpie
     RELRO_NOW=" "
     COMBRELOC=ldscripts/${EMULATION_NAME}.xdw.tmp
-    ( echo "/* Script for -pie -z combreloc -z now -z relro: position independent executable, combine & sort relocs */"
+    ( echo "/* Script for -pie -z combreloc -z relro: position independent executable, combine & sort relocs */"
       . ${CUSTOMIZER_SCRIPT} ${EMULATION_NAME}
       . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
     ) | sed -e '/^ *$/d;s/[    ]*$//' > ldscripts/${EMULATION_NAME}.xdw