This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] darwin-segaddr.c: pass -Wl,-no_pie for darwin11


   Currently, gcc.dg/darwin-segaddr.c fails its execution test at both -m32
and -m64 on darwin11. This is due to the default -pie linkage on darwin11 allowing
ASLR to randomize the segaddr on each individual execution of the resulting binary. The
attached patch eliminates this failure by passing -Wl,-no_pie for darwin10 and later.
This form of the match was selected becaused darwin9 and earlier doesn't support
-no_pie in the linker. Tested on x86_64-apple-darwin10/11. Okay for gcc trunk
and gcc-4_6-branch/gcc-4_5-branch/gcc-4_4-branch?
                Jack

2011-07-08  Jack Howarth <howarth@bromo.med.uc.edu>

	* gcc.dg/darwin-segaddr.c: Pass -Wl,-no_pie for darwin10 and later.


Index: gcc.dg/darwin-segaddr.c
===================================================================
--- gcc.dg/darwin-segaddr.c	(revision 176025)
+++ gcc.dg/darwin-segaddr.c	(working copy)
@@ -2,6 +2,8 @@
 /* { dg-do run { target *-*-darwin* } } */
 /* { dg-options "-O0 -segaddr __TEST 0x200000" { target { *-*-darwin* && { ! lp64 } } } } */
 /* { dg-options "-O0 -segaddr __TEST 0x110000000" { target { *-*-darwin* && lp64 } } } */
+/* { dg-options "-O0 -segaddr __TEST 0x200000 -Wl,-no_pie" { target { *-*-darwin1* && { ! lp64 } } } } */
+/* { dg-options "-O0 -segaddr __TEST 0x110000000 -Wl,-no_pie" { target { *-*-darwin1* && lp64 } } } */
 
 extern void abort ();
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]