public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Only use -z relro if it actually does something
@ 2004-09-20 13:25 Jakub Jelinek
  2004-09-20 15:03 ` Ulrich Drepper
  2004-09-20 15:54 ` H. J. Lu
  0 siblings, 2 replies; 6+ messages in thread
From: Jakub Jelinek @ 2004-09-20 13:25 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: Glibc hackers

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Only use -z relro if it actually does something
  2004-09-20 13:25 [PATCH] Only use -z relro if it actually does something Jakub Jelinek
@ 2004-09-20 15:03 ` Ulrich Drepper
  2004-09-20 15:54 ` H. J. Lu
  1 sibling, 0 replies; 6+ messages in thread
From: Ulrich Drepper @ 2004-09-20 15:03 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Glibc hackers

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Applied.

- --
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFBTvEn2ijCOnn/RHQRAmWKAKCPhTLuW5sk17bLir7gCJHD2+rlVwCfbRdx
7FAjGcsBalSiKOKOUqqKdSo=
=Y8pr
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Only use -z relro if it actually does something
  2004-09-20 13:25 [PATCH] Only use -z relro if it actually does something Jakub Jelinek
  2004-09-20 15:03 ` Ulrich Drepper
@ 2004-09-20 15:54 ` H. J. Lu
  2004-09-20 15:57   ` Jakub Jelinek
  1 sibling, 1 reply; 6+ messages in thread
From: H. J. Lu @ 2004-09-20 15:54 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Ulrich Drepper, Glibc hackers

On Mon, Sep 20, 2004 at 03:24:53PM +0200, Jakub Jelinek wrote:
> 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).
> 

Can you point it to my change? I may recall something.


H.J.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Only use -z relro if it actually does something
  2004-09-20 15:54 ` H. J. Lu
@ 2004-09-20 15:57   ` Jakub Jelinek
  2004-09-20 16:12     ` H. J. Lu
  0 siblings, 1 reply; 6+ messages in thread
From: Jakub Jelinek @ 2004-09-20 15:57 UTC (permalink / raw)
  To: H. J. Lu; +Cc: Ulrich Drepper, Glibc hackers

On Mon, Sep 20, 2004 at 08:54:33AM -0700, H. J. Lu wrote:
> On Mon, Sep 20, 2004 at 03:24:53PM +0200, Jakub Jelinek wrote:
> > 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).
> > 
> 
> Can you point it to my change? I may recall something.

2003-05-15  H.J. Lu <hongjiu.lu@intel.com>

	* emulparams/elf64_ia64.sh: Don't set COMMONPAGESIZE for now.

--- elf64_ia64.sh       20 Feb 2002 10:48:25 -0000      1.9
+++ elf64_ia64.sh       15 May 2003 14:56:33 -0000      1.10
@@ -7,7 +7,9 @@ OUTPUT_FORMAT="elf64-ia64-little"
 ARCH=ia64
 MACHINE=
 MAXPAGESIZE=0x10000
-if test -n "$CREATE_SHLIB"; then
+# FIXME: It interferes with linker relaxation. Disable it until it is
+# fixed.
+if test "0" = "1" -a -n "$CREATE_SHLIB"; then
   # Optimize shared libraries for 16K page size
   COMMONPAGESIZE=0x4000
 fi

	Jakub

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Only use -z relro if it actually does something
  2004-09-20 15:57   ` Jakub Jelinek
@ 2004-09-20 16:12     ` H. J. Lu
  2004-09-21 22:11       ` H. J. Lu
  0 siblings, 1 reply; 6+ messages in thread
From: H. J. Lu @ 2004-09-20 16:12 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Ulrich Drepper, gas2 Glibc hackers

On Mon, Sep 20, 2004 at 05:57:01PM +0200, Jakub Jelinek wrote:
> On Mon, Sep 20, 2004 at 08:54:33AM -0700, H. J. Lu wrote:
> > On Mon, Sep 20, 2004 at 03:24:53PM +0200, Jakub Jelinek wrote:
> > > 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).
> > > 
> > 
> > Can you point it to my change? I may recall something.
> 
> 2003-05-15  H.J. Lu <hongjiu.lu@intel.com>
> 
> 	* emulparams/elf64_ia64.sh: Don't set COMMONPAGESIZE for now.
> 

Thanks. I opened a binutils bug

http://sources.redhat.com/bugzilla/show_bug.cgi?id=393

to track it. I will check it out.


H.J.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Only use -z relro if it actually does something
  2004-09-20 16:12     ` H. J. Lu
@ 2004-09-21 22:11       ` H. J. Lu
  0 siblings, 0 replies; 6+ messages in thread
From: H. J. Lu @ 2004-09-21 22:11 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Ulrich Drepper, gas2 Glibc hackers

On Mon, Sep 20, 2004 at 09:12:55AM -0700, H. J. Lu wrote:
> On Mon, Sep 20, 2004 at 05:57:01PM +0200, Jakub Jelinek wrote:
> > On Mon, Sep 20, 2004 at 08:54:33AM -0700, H. J. Lu wrote:
> > > On Mon, Sep 20, 2004 at 03:24:53PM +0200, Jakub Jelinek wrote:
> > > > 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).
> > > > 
> > > 
> > > Can you point it to my change? I may recall something.
> > 
> > 2003-05-15  H.J. Lu <hongjiu.lu@intel.com>
> > 
> > 	* emulparams/elf64_ia64.sh: Don't set COMMONPAGESIZE for now.
> > 
> 
> Thanks. I opened a binutils bug
> 
> http://sources.redhat.com/bugzilla/show_bug.cgi?id=393
> 
> to track it. I will check it out.
> 

I have verified that gcc 3.3 still needs my patch. I closed the bug
with results for gcc 3.2 Red Hat, gcc 3.3, gcc 3.4 and gcc 4.0.


H.J.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-09-21 22:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-20 13:25 [PATCH] Only use -z relro if it actually does something Jakub Jelinek
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

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).