aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Granberg <zorry@gentoo.org>2013-11-10 11:22:48 +0100
committerMagnus Granberg <zorry@gentoo.org>2013-11-10 11:22:48 +0100
commitec80df40d20243d3d534a5ea798424705927dcfb (patch)
tree48508a1106a3ca17e369eb187582e4e94734f255 /upstream/gcc49_default_pie_testsuite.patch
parentupdate gcc 4.8.X patchset (diff)
downloadhardened-gccpatchset-ec80df40d20243d3d534a5ea798424705927dcfb.tar.gz
hardened-gccpatchset-ec80df40d20243d3d534a5ea798424705927dcfb.tar.bz2
hardened-gccpatchset-ec80df40d20243d3d534a5ea798424705927dcfb.zip
Add default PIE patches for gcc 4.9.X
Diffstat (limited to 'upstream/gcc49_default_pie_testsuite.patch')
-rw-r--r--upstream/gcc49_default_pie_testsuite.patch53
1 files changed, 53 insertions, 0 deletions
diff --git a/upstream/gcc49_default_pie_testsuite.patch b/upstream/gcc49_default_pie_testsuite.patch
new file mode 100644
index 0000000..de3d16d
--- /dev/null
+++ b/upstream/gcc49_default_pie_testsuite.patch
@@ -0,0 +1,53 @@
+--- a/gcc/testsuite/gcc.dg/default-pie.c 2013-11-09 21:07:16.741479728 +0100
++++ b/gcc/testsuite/gcc.dg/default-pie.c 2013-11-09 21:05:07.801479218 +0100
+@@ -0,0 +1,12 @@
++/* { dg-do compile { target *-*-linux* *-*-gnu* } } */
++/* { dg-require-effective-target default_pie } */
++/* { dg-options "-O2" } */
++int foo (void);
++
++int
++main (void)
++{
++ return foo ();
++}
++
++/* { dg-final { scan-assembler "foo@PLT" } } */
+--- a/gcc/testsuite/g++.dg/other/anon5.C 2012-11-10 15:34:42.000000000 +0100
++++ b/gcc/testsuite/g++.dg/other/anon5.C 2013-11-09 14:49:52.281390127 +0100
+@@ -1,5 +1,6 @@
+ // PR c++/34094
+ // { dg-do link { target { ! { *-*-darwin* *-*-hpux* *-*-solaris2.* } } } }
++// { dg-skip-if "" { default_pie } { "*" } { "" } }
+ // { dg-options "-g" }
+ // Ignore additional message on powerpc-ibm-aix
+ // { dg-prune-output "obtain more information" } */
+--- a/gcc/testsuite/lib/target-supports.exp 2013-10-01 11:18:30.000000000 +0200
++++ b/gcc/testsuite/lib/target-supports.exp 2013-10-25 22:01:46.743388469 +0200
+@@ -474,6 +474,11 @@ proc check_profiling_available { test_wh
+ }
+ }
+
++ # Profiling don't work with default -fPIE -pie.
++ if { [check_effective_target_default_pie] } {
++ return 0
++ }
++
+ # Support for -p on solaris2 relies on mcrt1.o which comes with the
+ # vendor compiler. We cannot reliably predict the directory where the
+ # vendor compiler (and thus mcrt1.o) is installed so we can't
+@@ -839,6 +844,14 @@ proc check_effective_target_pie { } {
+ return 0
+ }
+
++# Return 1 if -pie, -fPIE are default enable, 0 otherwise.
++
++proc check_effective_target_default_pie { } {
++ global ENABLE_DEFAULT_PIE
++ return [info exists ENABLE_DEFAULT_PIE]
++ return 0
++}
++
+ # Return true if the target supports -mpaired-single (as used on MIPS).
+
+ proc check_effective_target_mpaired_single { } {