public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Ulrich Drepper <drepper@redhat.com>
Cc: Glibc hackers <libc-hacker@sources.redhat.com>
Subject: [PATCH] Only use -z relro if it actually does something
Date: Mon, 20 Sep 2004 13:25:00 -0000	[thread overview]
Message-ID: <20040920132453.GM30497@sunsite.ms.mff.cuni.cz> (raw)

Hi!

On ia64 ATM -z relro does nothing (but increase the size of program
headers).
H.J. disabled it because it interferred with linker relaxation
(not sure if that still applies or what the testcase was).

This patch makes glibc use -z relro only when the linker does something
with it.

2004-09-20  Jakub Jelinek  <jakub@redhat.com>

	* configure.in (libc_cv_z_relro): Only set to yes if linker script
	contains DATA_SEGMENT_RELRO_END.
	* configure: Rebuilt.

--- libc/configure.in.jj	2004-09-20 15:16:27.000000000 +0200
+++ libc/configure.in	2004-09-20 15:19:51.950223522 +0200
@@ -1325,11 +1325,13 @@ EOF
 
   AC_CACHE_CHECK(for -z relro option,
 		 libc_cv_z_relro, [dnl
+  libc_cv_z_relro=no
   if AC_TRY_COMMAND([${CC-cc} -v --help 2>&1|grep "z relro" 1>&AS_MESSAGE_LOG_FD])
   then
-    libc_cv_z_relro=yes
-  else
-    libc_cv_z_relro=no
+    if AC_TRY_COMMAND([${CC-cc} -Wl,--verbose 2>&1|grep DATA_SEGMENT_RELRO_END 1>&AS_MESSAGE_LOG_FD])
+    then
+      libc_cv_z_relro=yes
+    fi
   fi])
   AC_SUBST(libc_cv_z_relro)
   if test $libc_cv_z_relro = yes; then
--- libc/configure.jj	2004-09-20 15:16:27.000000000 +0200
+++ libc/configure	2004-09-20 15:19:56.117482738 +0200
@@ -5549,16 +5549,23 @@ echo $ECHO_N "checking for -z relro opti
 if test "${libc_cv_z_relro+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-    if { ac_try='${CC-cc} -v --help 2>&1|grep "z relro" 1>&5'
+    libc_cv_z_relro=no
+  if { ac_try='${CC-cc} -v --help 2>&1|grep "z relro" 1>&5'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }
   then
-    libc_cv_z_relro=yes
-  else
-    libc_cv_z_relro=no
+    if { ac_try='${CC-cc} -Wl,--verbose 2>&1|grep DATA_SEGMENT_RELRO_END 1>&5'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }
+    then
+      libc_cv_z_relro=yes
+    fi
   fi
 fi
 echo "$as_me:$LINENO: result: $libc_cv_z_relro" >&5


	Jakub

             reply	other threads:[~2004-09-20 13:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-20 13:25 Jakub Jelinek [this message]
2004-09-20 15:03 ` Ulrich Drepper
2004-09-20 15:54 ` H. J. Lu
2004-09-20 15:57   ` Jakub Jelinek
2004-09-20 16:12     ` H. J. Lu
2004-09-21 22:11       ` H. J. Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040920132453.GM30497@sunsite.ms.mff.cuni.cz \
    --to=jakub@redhat.com \
    --cc=drepper@redhat.com \
    --cc=libc-hacker@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).