aboutsummaryrefslogtreecommitdiff
blob: 1fdc4341de78bb1dab36fd4fc104765e3c2629e8 (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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
--- gcc/gcc/config/alpha/elf.h.startend~	2003-12-25 16:17:34 +0100
+++ gcc/gcc/config/alpha/elf.h	2005-03-01 17:06:40 +0100
@@ -399,7 +399,7 @@
 #else
 #define STARTFILE_SPEC \
   "%{!shared: %{pg|p:gcrt1.o%s;:crt1.o%s}}\
-   crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+   crti.o%s %{static:crtbeginT.o%s;shared:crtbeginS.o%s;:crtbegin.o%s}"
 #endif
 
 /* Provide a ENDFILE_SPEC appropriate for ELF.  Here we tack on the
@@ -408,9 +408,15 @@
    `main', followed by a normal ELF "finalizer" file, `crtn.o'.  */
 
 #undef	ENDFILE_SPEC
+#ifdef HAVE_LD_PIE
 #define ENDFILE_SPEC \
   "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
    %{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
+#else
+#define ENDFILE_SPEC \
+  "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
+   %{shared:crtendS.o%s;:crtend.o%s} crtn.o%s"
+#endif
 
 /* We support #pragma.  */
 #define HANDLE_SYSV_PRAGMA 1
--- gcc/gcc/config/arm/linux-elf.h.startend~	2005-03-01 17:02:02 +0100
+++ gcc/gcc/config/arm/linux-elf.h	2005-03-01 17:06:40 +0100
@@ -63,12 +63,15 @@
    object constructed before entering `main'.  */
    
 #undef  STARTFILE_SPEC
+#ifdef HAVE_LD_PIE
 #define STARTFILE_SPEC \
-  "%{!shared: \
-     %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
-		       %{!p:%{profile:gcrt1.o%s} \
-			 %{!profile:crt1.o%s}}}} \
-   crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
+  "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
+   crti.o%s %{shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+#else
+#define STARTFILE_SPEC \
+  "%{!shared: %{pg|p|profile:gcrt1.o%s;:crt1.o%s}} \
+   crti.o%s %{shared:crtbeginS.o%s;:crtbegin.o%s}"
+#endif
 
 /* Provide a ENDFILE_SPEC appropriate for GNU/Linux.  Here we tack on
    the GNU/Linux magical crtend.o file (see crtstuff.c) which
@@ -77,8 +80,13 @@
    GNU/Linux "finalizer" file, `crtn.o'.  */
 
 #undef  ENDFILE_SPEC
+#ifdef HAVE_LD_PIE
 #define ENDFILE_SPEC \
-  "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
+  "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
+#else
+#define ENDFILE_SPEC \
+  "%{shared:crtendS.o%s;:crtend.o%s} crtn.o%s"
+#endif
 
 #undef  LINK_SPEC
 #ifdef USE_UCLIBC
--- gcc/gcc/config/ia64/linux.h.startend~	2004-09-08 02:17:14 +0200
+++ gcc/gcc/config/ia64/linux.h	2005-03-01 17:06:40 +0100
@@ -25,14 +25,20 @@
 #else
 #define STARTFILE_SPEC \
   "%{!shared: %{pg|p|profile:gcrt1.o%s;:crt1.o%s}}\
-   crti.o%s %{shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+   crti.o%s %{shared:crtbeginS.o%s;:crtbegin.o%s}"
 #endif
 
 /* Similar to standard Linux, but adding -ffast-math support.  */
 #undef  ENDFILE_SPEC
+#ifdef HAVE_LD_PIE
 #define ENDFILE_SPEC \
   "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
    %{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
+#else
+#define ENDFILE_SPEC \
+  "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
+   %{shared:crtendS.o%s;:crtend.o%s} crtn.o%s"
+#endif
 
 /* Define this for shared library support because it isn't in the main
    linux.h file.  */
--- gcc/gcc/config/rs6000/linux64.h.startend~	2004-12-02 03:21:28 +0100
+++ gcc/gcc/config/rs6000/linux64.h	2005-03-01 17:06:40 +0100
@@ -152,7 +152,7 @@
 #endif
 
 #define ASM_SPEC32 "-a32 %{n} %{T} %{Ym,*} %{Yd,*} \
-%{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} \
+%{mrelocatable} %{mrelocatable-lib} %{fpic|fPIC|fpie|fPIE:-K PIC} \
 %{memb} %{!memb: %{msdata: -memb} %{msdata=eabi: -memb}} \
 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
     %{mcall-freebsd: -mbig} \
--- gcc/gcc/config/rs6000/sysv4.h.startend~	2005-03-01 17:02:02 +0100
+++ gcc/gcc/config/rs6000/sysv4.h	2005-03-01 17:09:23 +0100
@@ -1122,12 +1122,18 @@
 #define	STARTFILE_LINUX_SPEC "\
 %{!shared: %{pg|p|profile:gcrt1.o%s;:crt1.o%s}} \
 %{mnewlib:ecrti.o%s;:crti.o%s} \
-%{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+%{static:crtbeginT.o%s;shared:crtbeginS.o%s;:crtbegin.o%s}"
 #endif
 
+#ifdef HAVE_LD_PIE
 #define	ENDFILE_LINUX_SPEC "\
 %{shared|pie:crtendS.o%s;:crtend.o%s} \
 %{mnewlib:ecrtn.o%s;:crtn.o%s}"
+#else
+#define	ENDFILE_LINUX_SPEC "\
+%{shared:crtendS.o%s;:crtend.o%s} \
+%{mnewlib:ecrtn.o%s;:crtn.o%s}"
+#endif
 
 #define LINK_START_LINUX_SPEC ""
 
--- gcc/gcc/config/sparc/linux.h.startend~	2005-01-20 21:39:42 +0100
+++ gcc/gcc/config/sparc/linux.h	2005-03-01 17:06:40 +0100
@@ -49,14 +49,14 @@
    object constructed before entering `main'.  */
    
 #undef  STARTFILE_SPEC
-#if defined HAVE_LD_PIE
+#ifdef HAVE_LD_PIE
 #define STARTFILE_SPEC \
   "%{!shared: %{pg|p:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}}\
    crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
 #else
 #define STARTFILE_SPEC \
   "%{!shared: %{pg|p:gcrt1.o%s;:crt1.o%s}}\
-   crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+   crti.o%s %{static:crtbeginT.o%s;shared:crtbeginS.o%s;:crtbegin.o%s}"
 #endif
 
 /* Provide a ENDFILE_SPEC appropriate for GNU/Linux.  Here we tack on
@@ -66,9 +66,15 @@
    GNU/Linux "finalizer" file, `crtn.o'.  */
 
 #undef  ENDFILE_SPEC
+#ifdef HAVE_LD_PIE
 #define ENDFILE_SPEC \
   "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
    %{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
+#else
+#define ENDFILE_SPEC \
+  "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
+   %{shared:crtendS.o%s;:crtend.o%s} crtn.o%s"
+#endif
 
 /* This is for -profile to use -lc_p instead of -lc.  */
 #undef	CC1_SPEC
--- gcc/gcc/config/sparc/linux64.h.startend~	2005-01-21 11:15:56 +0100
+++ gcc/gcc/config/sparc/linux64.h	2005-03-01 17:06:40 +0100
@@ -80,7 +80,7 @@
 #else
 #define STARTFILE_SPEC \
   "%{!shared:%{pg|p:gcrt1.o%s;:crt1.o%s}}\
-   crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbeginS.o%s}"
+   crti.o%s %{static:crtbeginT.o%s;shared:crtbeginS.o%s;:crtbeginS.o%s}"
 #endif
 
 /* Provide a ENDFILE_SPEC appropriate for GNU/Linux.  Here we tack on
@@ -90,10 +90,15 @@
    GNU/Linux "finalizer" file, `crtn.o'.  */
 
 #undef  ENDFILE_SPEC
-
+#ifdef HAVE_LD_PIE
 #define ENDFILE_SPEC \
   "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s\
    %{ffast-math|funsafe-math-optimizations:crtfastmath.o%s}"
+#else
+#define ENDFILE_SPEC \
+  "%{shared:crtendS.o%s;:crtend.o%s} crtn.o%s\
+   %{ffast-math|funsafe-math-optimizations:crtfastmath.o%s}"
+#endif
 
 /* The GNU C++ standard library requires that these macros be defined.  */
 #undef CPLUSPLUS_CPP_SPEC
--- gcc/gcc/config/linux.h.startend~	2004-08-05 11:12:11 +0200
+++ gcc/gcc/config/linux.h	2005-03-01 17:06:40 +0100
@@ -46,7 +46,7 @@
 #else
 #define STARTFILE_SPEC \
   "%{!shared: %{pg|p|profile:gcrt1.o%s;:crt1.o%s}} \
-   crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+   crti.o%s %{static:crtbeginT.o%s;shared:crtbeginS.o%s;:crtbegin.o%s}"
 #endif
 
 /* Provide a ENDFILE_SPEC appropriate for GNU/Linux.  Here we tack on
@@ -56,8 +56,13 @@
    GNU/Linux "finalizer" file, `crtn.o'.  */
 
 #undef	ENDFILE_SPEC
+#ifdef HAVE_LD_PIE
 #define ENDFILE_SPEC \
   "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
+#else
+#define ENDFILE_SPEC \
+  "%{shared:crtendS.o%s;:crtend.o%s} crtn.o%s"
+#endif
 
 /* This is for -profile to use -lc_p instead of -lc.  */
 #ifndef CC1_SPEC