aboutsummaryrefslogtreecommitdiffstats
path: root/main/gcc/01_all_gcc-4.3.1-crtbeginTS-stuff.patch
blob: 8bc9a705679e1d8bd2215aa32f5d1bc404a33416 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
diff -Nru /var/tmp/portage/sys-devel/gcc-4.3.1-r1/work/gcc-4.3.1/gcc/config.gcc /root/hardened/gcc-4.3.1-r1/work/gcc-4.3.1/gcc/config.gcc
--- gcc-4.3.1/gcc/config.gcc	2008-06-11 04:13:33.000000000 +0200
+++ gcc-4.3.1/gcc/config.gcc	2008-06-11 04:41:39.000000000 +0200
@@ -493,7 +493,7 @@
   ;;
 *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu)
   # Must come before *-*-gnu* (because of *-*-linux-gnu* systems).
-  extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o"
+  extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtbeginTS.o crtend.o crtendS.o"
   extra_options="${extra_options} linux.opt"
   gas=yes
   gnu_ld=yes
diff -Nru /var/tmp/portage/sys-devel/gcc-4.3.1-r1/work/gcc-4.3.1/gcc/Makefile.in /root/hardened/gcc-4.3.1-r1/work/gcc-4.3.1/gcc/Makefile.in
--- gcc-4.3.1/gcc/Makefile.in	2008-06-11 04:13:37.000000000 +0200
+++ gcc-4.3.1/gcc/Makefile.in	2008-06-11 04:42:27.000000000 +0200
@@ -1665,36 +1665,43 @@
 # constructors.
 $(T)crtbegin.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
   gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
-	$(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \
+	$(GCC_FOR_TARGET) -fno-PIE $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \
 	  -c $(srcdir)/crtstuff.c -DCRT_BEGIN \
 	  -o $(T)crtbegin$(objext)
 
 $(T)crtend.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
   gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
-	$(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \
+	$(GCC_FOR_TARGET) -fno-PIE $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \
 	  -c $(srcdir)/crtstuff.c -DCRT_END \
 	  -o $(T)crtend$(objext)
 
 # These are versions of crtbegin and crtend for shared libraries.
 $(T)crtbeginS.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
   gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
-	$(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS_S) \
+	$(GCC_FOR_TARGET) -fno-PIE $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS_S) \
 	  -c $(srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFS_O \
 	  -o $(T)crtbeginS$(objext)
 
 $(T)crtendS.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
   gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
-	$(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS_S) \
+	$(GCC_FOR_TARGET) -fno-PIE $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS_S) \
 	  -c $(srcdir)/crtstuff.c -DCRT_END -DCRTSTUFFS_O \
 	  -o $(T)crtendS$(objext)
 
 # This is a version of crtbegin for -static links.
 $(T)crtbeginT.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
   gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
-	$(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \
+	$(GCC_FOR_TARGET) -fno-PIE $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \
 	  -c $(srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFT_O \
 	  -o $(T)crtbeginT$(objext)
 
+# This is a version of crtbegin for -static -fPIE links.
+$(T)crtbeginTS.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
+  gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
+	$(GCC_FOR_TARGET) -fno-PIE $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS_S) \
+	  -c $(srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFT_O -DCRTSTUFFS_O \
+	  -o $(T)crtbeginTS$(objext)
+
 # Compile the start modules crt0.o and mcrt0.o that are linked with
 # every program
 $(T)crt0.o: s-crt0 ; @true
diff -Nru /var/tmp/portage/sys-devel/gcc-4.3.1-r1/work/gcc-4.3.1/libgcc/config.host /root/hardened/gcc-4.3.1-r1/work/gcc-4.3.1/libgcc/config.host
--- gcc-4.3.1/libgcc/config.host	2008-01-25 21:49:04.000000000 +0100
+++ gcc-4.3.1/libgcc/config.host	2008-06-11 04:42:09.000000000 +0200
@@ -164,7 +164,7 @@
   ;;
 *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu)
   # Must come before *-*-gnu* (because of *-*-linux-gnu* systems).
-  extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o"
+  extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtbeginTS.o crtend.o crtendS.o"
   ;;
 *-*-gnu*)
   ;;
diff -Nru /var/tmp/portage/sys-devel/gcc-4.3.1-r1/work/gcc-4.3.1/libgcc/Makefile.in /root/hardened/gcc-4.3.1-r1/work/gcc-4.3.1/libgcc/Makefile.in
--- gcc-4.3.1/libgcc/Makefile.in	2008-06-11 04:13:37.000000000 +0200
+++ gcc-4.3.1/libgcc/Makefile.in	2008-06-11 04:42:09.000000000 +0200
@@ -783,6 +783,11 @@
 crtbeginT.o: $(gcc_srcdir)/crtstuff.c
 	$(crt_compile) $(CRTSTUFF_T_CFLAGS) \
 	  -c $(gcc_srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFT_O
+	  
+# This is a version of crtbegin for -static -fPIE links.
+crtbeginTS.o: $(gcc_srcdir)/crtstuff.c
+	$(crt_compile) $(CRTSTUFF_T_CFLAGS_S) \
+	  -c $(gcc_srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFT_O	-DCRTSTUFFS_O  
 endif
 
 # Build extra startfiles in the libgcc directory.