1 |
vapier 08/11/01 07:34:20 |
2 |
|
3 |
Added: 03_all_binutils-2.15.92.0.2-ppc64-pie.patch |
4 |
08_all_binutils-RPATH_ENVVAR-smack.patch |
5 |
12_all_sh-targets.patch |
6 |
42_all_012_check_ldrunpath_length.patch |
7 |
63_all_binutils-2.19-pt-pax-flags-20081101.patch |
8 |
65_all_binutils-2.19-amd64-32bit-path.patch |
9 |
66_all_binutils-2.18.50.0.2-warn-textrel.patch |
10 |
76_all_only-use-new-ld-dtags.patch.disabled |
11 |
76_all_use-new-ld-dtags.patch |
12 |
77_all_generate-gnu-hash.patch |
13 |
78_all_use-relro.patch 91_all_libiberty-pic.patch |
14 |
README.history |
15 |
Log: |
16 |
initial 2.19 patchset based on last 2.19.50.0.1 patchset |
17 |
|
18 |
Revision Changes Path |
19 |
1.1 src/patchsets/binutils/2.19/03_all_binutils-2.15.92.0.2-ppc64-pie.patch |
20 |
|
21 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19/03_all_binutils-2.15.92.0.2-ppc64-pie.patch?rev=1.1&view=markup |
22 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19/03_all_binutils-2.15.92.0.2-ppc64-pie.patch?rev=1.1&content-type=text/plain |
23 |
|
24 |
Index: 03_all_binutils-2.15.92.0.2-ppc64-pie.patch |
25 |
=================================================================== |
26 |
--- bfd/elf64-ppc.c.jj 2004-09-27 16:46:06.000000000 -0400 |
27 |
+++ bfd/elf64-ppc.c 2004-10-04 09:09:50.000000000 -0400 |
28 |
@@ -9681,7 +9681,12 @@ ppc64_elf_relocate_section (bfd *output_ |
29 |
else if (!SYMBOL_REFERENCES_LOCAL (info, &h->elf) |
30 |
&& !is_opd |
31 |
&& r_type != R_PPC64_TOC) |
32 |
- outrel.r_info = ELF64_R_INFO (h->elf.dynindx, r_type); |
33 |
+ { |
34 |
+ outrel.r_info = ELF64_R_INFO (h->elf.dynindx, r_type); |
35 |
+ if (h->elf.dynindx == -1 |
36 |
+ && h->elf.root.type == bfd_link_hash_undefweak) |
37 |
+ memset (&outrel, 0, sizeof outrel); |
38 |
+ } |
39 |
else |
40 |
{ |
41 |
/* This symbol is local, or marked to become local, |
42 |
|
43 |
|
44 |
|
45 |
1.1 src/patchsets/binutils/2.19/08_all_binutils-RPATH_ENVVAR-smack.patch |
46 |
|
47 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19/08_all_binutils-RPATH_ENVVAR-smack.patch?rev=1.1&view=markup |
48 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19/08_all_binutils-RPATH_ENVVAR-smack.patch?rev=1.1&content-type=text/plain |
49 |
|
50 |
Index: 08_all_binutils-RPATH_ENVVAR-smack.patch |
51 |
=================================================================== |
52 |
http://sourceware.org/ml/binutils/2007-07/msg00401.html |
53 |
http://sourceware.org/bugzilla/show_bug.cgi?id=4970 |
54 |
|
55 |
--- configure |
56 |
+++ configure |
57 |
@@ -5355,6 +5355,7 @@ |
58 |
*-*-darwin* | *-*-rhapsody* ) RPATH_ENVVAR=DYLD_LIBRARY_PATH ;; |
59 |
*) RPATH_ENVVAR=LD_LIBRARY_PATH ;; |
60 |
esac |
61 |
+RPATH_ENVVAR="cant_touch_this_nah_nah_nah" |
62 |
|
63 |
# Record target_configdirs and the configure arguments for target and |
64 |
# build configuration in Makefile. |
65 |
|
66 |
|
67 |
|
68 |
1.1 src/patchsets/binutils/2.19/12_all_sh-targets.patch |
69 |
|
70 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19/12_all_sh-targets.patch?rev=1.1&view=markup |
71 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19/12_all_sh-targets.patch?rev=1.1&content-type=text/plain |
72 |
|
73 |
Index: 12_all_sh-targets.patch |
74 |
=================================================================== |
75 |
r10231 | lethal | 2005-05-02 09:58:00 -0400 (Mon, 02 May 2005) | 13 lines |
76 |
|
77 |
Likewise, binutils has no idea about any of these new targets either, so we |
78 |
fix that up too.. now we're able to actually build a real toolchain for |
79 |
sh2a_nofpu- and other more ineptly named toolchains (and yes, there are more |
80 |
inept targets than that one, really. Go look, I promise). |
81 |
|
82 |
--- binutils-2.16.90.0.2-dist/configure |
83 |
+++ binutils-2.16.90.0.2/configure |
84 |
@@ -1207,7 +1207,7 @@ |
85 |
am33_2.0-*-linux*) |
86 |
noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss" |
87 |
;; |
88 |
- sh-*-linux*) |
89 |
+ sh*-*-linux*) |
90 |
noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss" |
91 |
;; |
92 |
sh*-*-pe|mips*-*-pe|*arm-wince-pe) |
93 |
@@ -1495,7 +1495,7 @@ |
94 |
romp-*-*) |
95 |
noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}" |
96 |
;; |
97 |
- sh-*-* | sh64-*-*) |
98 |
+ sh*-*-* | sh64-*-*) |
99 |
case "${host}" in |
100 |
i[3456789]86-*-vsta) ;; # don't add gprof back in |
101 |
i[3456789]86-*-go32*) ;; # don't add gprof back in |
102 |
--- binutils-2.16.90.0.2-dist/configure.ac |
103 |
+++ binutils-2.16.90.0.2/configure.ac |
104 |
@@ -424,7 +424,7 @@ |
105 |
am33_2.0-*-linux*) |
106 |
noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss" |
107 |
;; |
108 |
- sh-*-linux*) |
109 |
+ sh*-*-linux*) |
110 |
noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss" |
111 |
;; |
112 |
sh*-*-pe|mips*-*-pe|*arm-wince-pe) |
113 |
@@ -712,7 +712,7 @@ |
114 |
romp-*-*) |
115 |
noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}" |
116 |
;; |
117 |
- sh-*-* | sh64-*-*) |
118 |
+ sh*-*-* | sh64-*-*) |
119 |
case "${host}" in |
120 |
i[[3456789]]86-*-vsta) ;; # don't add gprof back in |
121 |
i[[3456789]]86-*-go32*) ;; # don't add gprof back in |
122 |
|
123 |
|
124 |
|
125 |
1.1 src/patchsets/binutils/2.19/42_all_012_check_ldrunpath_length.patch |
126 |
|
127 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19/42_all_012_check_ldrunpath_length.patch?rev=1.1&view=markup |
128 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19/42_all_012_check_ldrunpath_length.patch?rev=1.1&content-type=text/plain |
129 |
|
130 |
Index: 42_all_012_check_ldrunpath_length.patch |
131 |
=================================================================== |
132 |
#!/bin/sh -e |
133 |
## 012_check_ldrunpath_length.dpatch by Chris Chimelis <chris@××××××.org> |
134 |
## |
135 |
## All lines beginning with `## DP:' are a description of the patch. |
136 |
## DP: Only generate an RPATH entry if LD_RUN_PATH is not empty, for |
137 |
## DP: cases where -rpath isn't specified. (#151024) |
138 |
|
139 |
if [ $# -ne 1 ]; then |
140 |
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" |
141 |
exit 1 |
142 |
fi |
143 |
|
144 |
[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts |
145 |
patch_opts="${patch_opts:--f --no-backup-if-mismatch}" |
146 |
|
147 |
case "$1" in |
148 |
-patch) patch $patch_opts -p1 < $0;; |
149 |
-unpatch) patch $patch_opts -p1 -R < $0;; |
150 |
*) |
151 |
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" |
152 |
exit 1;; |
153 |
esac |
154 |
|
155 |
exit 0 |
156 |
|
157 |
@DPATCH@ |
158 |
diff -urNad /home/james/debian/packages/binutils/new/binutils-2.15/ld/emultempl/elf32.em binutils-2.15/ld/emultempl/elf32.em |
159 |
--- /home/james/debian/packages/binutils/new/binutils-2.15/ld/emultempl/elf32.em 2004-05-21 23:12:58.000000000 +0100 |
160 |
+++ binutils-2.15/ld/emultempl/elf32.em 2004-05-21 23:12:59.000000000 +0100 |
161 |
@@ -692,6 +692,8 @@ |
162 |
&& command_line.rpath == NULL) |
163 |
{ |
164 |
lib_path = (const char *) getenv ("LD_RUN_PATH"); |
165 |
+ if ((lib_path) && (strlen (lib_path) == 0)) |
166 |
+ lib_path = NULL; |
167 |
if (gld${EMULATION_NAME}_search_needed (lib_path, &n, |
168 |
force)) |
169 |
break; |
170 |
@@ -871,6 +873,8 @@ |
171 |
rpath = command_line.rpath; |
172 |
if (rpath == NULL) |
173 |
rpath = (const char *) getenv ("LD_RUN_PATH"); |
174 |
+ if ((rpath) && (strlen (rpath) == 0)) |
175 |
+ rpath = NULL; |
176 |
if (! (bfd_elf_size_dynamic_sections |
177 |
(output_bfd, command_line.soname, rpath, |
178 |
command_line.filter_shlib, |
179 |
|
180 |
|
181 |
|
182 |
1.1 src/patchsets/binutils/2.19/63_all_binutils-2.19-pt-pax-flags-20081101.patch |
183 |
|
184 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19/63_all_binutils-2.19-pt-pax-flags-20081101.patch?rev=1.1&view=markup |
185 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19/63_all_binutils-2.19-pt-pax-flags-20081101.patch?rev=1.1&content-type=text/plain |
186 |
|
187 |
Index: 63_all_binutils-2.19-pt-pax-flags-20081101.patch |
188 |
=================================================================== |
189 |
--- binutils-2.19/bfd/elf-bfd.h |
190 |
+++ binutils-2.19/bfd/elf-bfd.h |
191 |
@@ -1526,6 +1526,9 @@ struct elf_obj_tdata |
192 |
/* Segment flags for the PT_GNU_STACK segment. */ |
193 |
unsigned int stack_flags; |
194 |
|
195 |
+ /* Segment flags for the PT_PAX_FLAGS segment. */ |
196 |
+ unsigned int pax_flags; |
197 |
+ |
198 |
/* Symbol version definitions in external objects. */ |
199 |
Elf_Internal_Verdef *verdef; |
200 |
|
201 |
--- binutils-2.19/bfd/elf.c |
202 |
+++ binutils-2.19/bfd/elf.c |
203 |
@@ -1136,6 +1136,7 @@ get_segment_type (unsigned int p_type) |
204 |
case PT_GNU_EH_FRAME: pt = "EH_FRAME"; break; |
205 |
case PT_GNU_STACK: pt = "STACK"; break; |
206 |
case PT_GNU_RELRO: pt = "RELRO"; break; |
207 |
+ case PT_PAX_FLAGS: pt = "PAX_FLAGS"; break; |
208 |
default: pt = NULL; break; |
209 |
} |
210 |
return pt; |
211 |
@@ -2442,6 +2443,9 @@ bfd_section_from_phdr (bfd *abfd, Elf_Internal_Phdr *hdr, int index) |
212 |
case PT_GNU_RELRO: |
213 |
return _bfd_elf_make_section_from_phdr (abfd, hdr, index, "relro"); |
214 |
|
215 |
+ case PT_PAX_FLAGS: |
216 |
+ return _bfd_elf_make_section_from_phdr (abfd, hdr, index, "pax_flags"); |
217 |
+ |
218 |
default: |
219 |
/* Check for any processor-specific program segment types. */ |
220 |
bed = get_elf_backend_data (abfd); |
221 |
@@ -3404,6 +3408,11 @@ get_program_header_size (bfd *abfd, struct bfd_link_info *info) |
222 |
++segs; |
223 |
} |
224 |
|
225 |
+ { |
226 |
+ /* We need a PT_PAX_FLAGS segment. */ |
227 |
+ ++segs; |
228 |
+ } |
229 |
+ |
230 |
for (s = abfd->sections; s != NULL; s = s->next) |
231 |
{ |
232 |
if ((s->flags & SEC_LOAD) != 0 |
233 |
@@ -3983,6 +3992,20 @@ _bfd_elf_map_sections_to_segments (bfd *abfd, struct bfd_link_info *info) |
234 |
} |
235 |
} |
236 |
|
237 |
+ { |
238 |
+ amt = sizeof (struct elf_segment_map); |
239 |
+ m = bfd_zalloc (abfd, amt); |
240 |
+ if (m == NULL) |
241 |
+ goto error_return; |
242 |
+ m->next = NULL; |
243 |
+ m->p_type = PT_PAX_FLAGS; |
244 |
+ m->p_flags = elf_tdata (abfd)->pax_flags; |
245 |
+ m->p_flags_valid = 1; |
246 |
+ |
247 |
+ *pm = m; |
248 |
+ pm = &m->next; |
249 |
+ } |
250 |
+ |
251 |
free (sections); |
252 |
elf_tdata (abfd)->segment_map = mfirst; |
253 |
} |
254 |
@@ -5173,7 +5196,8 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd) |
255 |
6. PT_TLS segment includes only SHF_TLS sections. |
256 |
7. SHF_TLS sections are only in PT_TLS or PT_LOAD segments. |
257 |
8. PT_DYNAMIC should not contain empty sections at the beginning |
258 |
- (with the possible exception of .dynamic). */ |
259 |
+ (with the possible exception of .dynamic). |
260 |
+ 9. PT_PAX_FLAGS segments does not include any sections. */ |
261 |
#define IS_SECTION_IN_INPUT_SEGMENT(section, segment, bed) \ |
262 |
((((segment->p_paddr \ |
263 |
? IS_CONTAINED_BY_LMA (section, segment, segment->p_paddr) \ |
264 |
@@ -5181,6 +5205,7 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd) |
265 |
&& (section->flags & SEC_ALLOC) != 0) \ |
266 |
|| IS_NOTE (segment, section)) \ |
267 |
&& segment->p_type != PT_GNU_STACK \ |
268 |
+ && segment->p_type != PT_PAX_FLAGS \ |
269 |
&& (segment->p_type != PT_TLS \ |
270 |
|| (section->flags & SEC_THREAD_LOCAL)) \ |
271 |
&& (segment->p_type == PT_LOAD \ |
272 |
--- binutils-2.19/bfd/elflink.c |
273 |
+++ binutils-2.19/bfd/elflink.c |
274 |
@@ -5397,16 +5397,30 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd, |
275 |
return TRUE; |
276 |
|
277 |
bed = get_elf_backend_data (output_bfd); |
278 |
+ elf_tdata (output_bfd)->pax_flags = PF_NORANDEXEC; |
279 |
+ |
280 |
+ if (info->execheap) |
281 |
+ elf_tdata (output_bfd)->pax_flags |= PF_NOMPROTECT; |
282 |
+ else if (info->noexecheap) |
283 |
+ elf_tdata (output_bfd)->pax_flags |= PF_MPROTECT; |
284 |
+ |
285 |
if (info->execstack) |
286 |
- elf_tdata (output_bfd)->stack_flags = PF_R | PF_W | PF_X; |
287 |
+ { |
288 |
+ elf_tdata (output_bfd)->stack_flags = PF_R | PF_W | PF_X; |
289 |
+ elf_tdata (output_bfd)->pax_flags |= PF_EMUTRAMP; |
290 |
+ } |
291 |
else if (info->noexecstack) |
292 |
- elf_tdata (output_bfd)->stack_flags = PF_R | PF_W; |
293 |
+ { |
294 |
+ elf_tdata (output_bfd)->stack_flags = PF_R | PF_W; |
295 |
+ elf_tdata (output_bfd)->pax_flags |= PF_NOEMUTRAMP; |
296 |
+ } |
297 |
else |
298 |
{ |
299 |
bfd *inputobj; |
300 |
asection *notesec = NULL; |
301 |
int exec = 0; |
302 |
|
303 |
+ elf_tdata (output_bfd)->pax_flags |= PF_NOEMUTRAMP; |
304 |
for (inputobj = info->input_bfds; |
305 |
inputobj; |
306 |
inputobj = inputobj->link_next) |
307 |
@@ -5419,7 +5433,11 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd, |
308 |
if (s) |
309 |
{ |
310 |
if (s->flags & SEC_CODE) |
311 |
- exec = PF_X; |
312 |
+ { |
313 |
+ elf_tdata (output_bfd)->pax_flags &= ~PF_NOEMUTRAMP; |
314 |
+ elf_tdata (output_bfd)->pax_flags |= PF_EMUTRAMP; |
315 |
+ exec = PF_X; |
316 |
+ } |
317 |
notesec = s; |
318 |
} |
319 |
else if (bed->default_execstack) |
320 |
--- binutils-2.19/binutils/readelf.c |
321 |
+++ binutils-2.19/binutils/readelf.c |
322 |
@@ -2505,6 +2505,7 @@ get_segment_type (unsigned long p_type) |
323 |
return "GNU_EH_FRAME"; |
324 |
case PT_GNU_STACK: return "GNU_STACK"; |
325 |
case PT_GNU_RELRO: return "GNU_RELRO"; |
326 |
+ case PT_PAX_FLAGS: return "PAX_FLAGS"; |
327 |
|
328 |
default: |
329 |
if ((p_type >= PT_LOPROC) && (p_type <= PT_HIPROC)) |
330 |
--- binutils-2.19/include/bfdlink.h |
331 |
+++ binutils-2.19/include/bfdlink.h |
332 |
@@ -319,6 +319,14 @@ struct bfd_link_info |
333 |
/* TRUE if PT_GNU_RELRO segment should be created. */ |
334 |
unsigned int relro: 1; |
335 |
|
336 |
+ /* TRUE if PT_PAX_FLAGS segment should be created with PF_NOMPROTECT |
337 |
+ flags. */ |
338 |
+ unsigned int execheap: 1; |
339 |
+ |
340 |
+ /* TRUE if PT_PAX_FLAGS segment should be created with PF_MPROTECT |
341 |
+ flags. */ |
342 |
+ unsigned int noexecheap: 1; |
343 |
+ |
344 |
/* TRUE if we should warn when adding a DT_TEXTREL to a shared object. */ |
345 |
unsigned int warn_shared_textrel: 1; |
346 |
|
347 |
--- binutils-2.19/include/elf/common.h |
348 |
+++ binutils-2.19/include/elf/common.h |
349 |
@@ -360,6 +360,7 @@ |
350 |
#define PT_SUNW_EH_FRAME PT_GNU_EH_FRAME /* Solaris uses the same value */ |
351 |
#define PT_GNU_STACK (PT_LOOS + 0x474e551) /* Stack flags */ |
352 |
#define PT_GNU_RELRO (PT_LOOS + 0x474e552) /* Read-only after relocation */ |
353 |
+#define PT_PAX_FLAGS (PT_LOOS + 0x5041580) /* PaX flags */ |
354 |
|
355 |
/* Program segment permissions, in program header p_flags field. */ |
356 |
|
357 |
@@ -370,6 +371,21 @@ |
358 |
#define PF_MASKOS 0x0FF00000 /* New value, Oct 4, 1999 Draft */ |
359 |
#define PF_MASKPROC 0xF0000000 /* Processor-specific reserved bits */ |
360 |
|
361 |
+/* Flags to control PaX behavior. */ |
362 |
+ |
363 |
+#define PF_PAGEEXEC (1 << 4) /* Enable PAGEEXEC */ |
364 |
+#define PF_NOPAGEEXEC (1 << 5) /* Disable PAGEEXEC */ |
365 |
+#define PF_SEGMEXEC (1 << 6) /* Enable SEGMEXEC */ |
366 |
+#define PF_NOSEGMEXEC (1 << 7) /* Disable SEGMEXEC */ |
367 |
+#define PF_MPROTECT (1 << 8) /* Enable MPROTECT */ |
368 |
+#define PF_NOMPROTECT (1 << 9) /* Disable MPROTECT */ |
369 |
+#define PF_RANDEXEC (1 << 10) /* Enable RANDEXEC */ |
370 |
+#define PF_NORANDEXEC (1 << 11) /* Disable RANDEXEC */ |
371 |
+#define PF_EMUTRAMP (1 << 12) /* Enable EMUTRAMP */ |
372 |
+#define PF_NOEMUTRAMP (1 << 13) /* Disable EMUTRAMP */ |
373 |
+#define PF_RANDMMAP (1 << 14) /* Enable RANDMMAP */ |
374 |
+#define PF_NORANDMMAP (1 << 15) /* Disable RANDMMAP */ |
375 |
+ |
376 |
/* Values for section header, sh_type field. */ |
377 |
|
378 |
#define SHT_NULL 0 /* Section header table entry unused */ |
379 |
--- binutils-2.19/ld/emultempl/elf32.em |
380 |
+++ binutils-2.19/ld/emultempl/elf32.em |
381 |
@@ -2146,6 +2146,16 @@ fragment <<EOF |
382 |
link_info.noexecstack = TRUE; |
383 |
link_info.execstack = FALSE; |
384 |
} |
385 |
+ else if (strcmp (optarg, "execheap") == 0) |
386 |
+ { |
387 |
+ link_info.execheap = TRUE; |
388 |
+ link_info.noexecheap = FALSE; |
389 |
+ } |
390 |
+ else if (strcmp (optarg, "noexecheap") == 0) |
391 |
+ { |
392 |
+ link_info.noexecheap = TRUE; |
393 |
+ link_info.execheap = FALSE; |
394 |
+ } |
395 |
EOF |
396 |
|
397 |
if test -n "$COMMONPAGESIZE"; then |
398 |
@@ -2229,6 +2239,8 @@ fragment <<EOF |
399 |
fprintf (file, _("\ |
400 |
-z execstack Mark executable as requiring executable stack\n")); |
401 |
fprintf (file, _("\ |
402 |
+ -z execheap\t\tMark executable as requiring executable heap\n")); |
403 |
+ fprintf (file, _("\ |
404 |
-z initfirst Mark DSO to be initialized first at runtime\n")); |
405 |
fprintf (file, _("\ |
406 |
-z interpose Mark object to interpose all DSOs but executable\n")); |
407 |
@@ -2252,6 +2264,8 @@ fragment <<EOF |
408 |
-z nodump Mark DSO not available to dldump\n")); |
409 |
fprintf (file, _("\ |
410 |
-z noexecstack Mark executable as not requiring executable stack\n")); |
411 |
+ fprintf (file, _("\ |
412 |
+ -z noexecheap\tMark executable as not requiring executable heap\n")); |
413 |
EOF |
414 |
|
415 |
if test -n "$COMMONPAGESIZE"; then |
416 |
--- binutils-2.19/ld/ldgram.y |
417 |
+++ binutils-2.19/ld/ldgram.y |
418 |
@@ -1112,6 +1112,8 @@ phdr_type: |
419 |
$$ = exp_intop (0x6474e550); |
420 |
else if (strcmp (s, "PT_GNU_STACK") == 0) |
421 |
$$ = exp_intop (0x6474e551); |
422 |
+ else if (strcmp (s, "PT_PAX_FLAGS") == 0) |
423 |
+ $$ = exp_intop (0x65041580); |
424 |
else |
425 |
{ |
426 |
einfo (_("\ |
427 |
|
428 |
|
429 |
|
430 |
1.1 src/patchsets/binutils/2.19/65_all_binutils-2.19-amd64-32bit-path.patch |
431 |
|
432 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19/65_all_binutils-2.19-amd64-32bit-path.patch?rev=1.1&view=markup |
433 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19/65_all_binutils-2.19-amd64-32bit-path.patch?rev=1.1&content-type=text/plain |
434 |
|
435 |
Index: 65_all_binutils-2.19-amd64-32bit-path.patch |
436 |
=================================================================== |
437 |
--- binutils/ld/emulparams/elf_i386.sh |
438 |
+++ binutils/ld/emulparams/elf_i386.sh |
439 |
@@ -11,3 +11,13 @@ |
440 |
GENERATE_PIE_SCRIPT=yes |
441 |
NO_SMALL_DATA=yes |
442 |
SEPARATE_GOTPLT=12 |
443 |
+ |
444 |
+# In Gentoo, we install 32bit libs into /lib32 in an |
445 |
+# ABI setup with amd64/x86 |
446 |
+case "$target" in |
447 |
+ x86_64*-linux*) |
448 |
+ case "$EMULATION_NAME" in |
449 |
+ *i386*) LIBPATH_SUFFIX=32 ;; |
450 |
+ esac |
451 |
+ ;; |
452 |
+esac |
453 |
|
454 |
|
455 |
|
456 |
1.1 src/patchsets/binutils/2.19/66_all_binutils-2.18.50.0.2-warn-textrel.patch |
457 |
|
458 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19/66_all_binutils-2.18.50.0.2-warn-textrel.patch?rev=1.1&view=markup |
459 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19/66_all_binutils-2.18.50.0.2-warn-textrel.patch?rev=1.1&content-type=text/plain |
460 |
|
461 |
Index: 66_all_binutils-2.18.50.0.2-warn-textrel.patch |
462 |
=================================================================== |
463 |
textrels are bad for forcing copy-on-write (this affects everyone), |
464 |
and for security/runtime code generation, this affects security ppl. |
465 |
But in either case, it doesn't matter who needs textrels, it's |
466 |
the very fact that they're needed at all. |
467 |
|
468 |
2006-06-10 Ned Ludd <solar@g.o>, Mike Frysinger <vapier@g.o> |
469 |
|
470 |
* bfd/elflink.c (bfd_elf_final_link): Check all objects for TEXTRELs. |
471 |
* ld/ldmain.c (main): Change textrel warning default to true. |
472 |
* ld/testsuite/lib/ld-lib.exp (default_ld_simple_link): Scrub TEXTREL |
473 |
warnings from ld output. |
474 |
|
475 |
--- bfd/elflink.c |
476 |
+++ bfd/elflink.c |
477 |
@@ -8652,14 +8652,12 @@ |
478 |
goto error_return; |
479 |
|
480 |
/* Check for DT_TEXTREL (late, in case the backend removes it). */ |
481 |
- if (info->warn_shared_textrel && info->shared) |
482 |
+ o = bfd_get_section_by_name (dynobj, ".dynamic"); |
483 |
+ if (info->warn_shared_textrel && o != NULL) |
484 |
{ |
485 |
bfd_byte *dyncon, *dynconend; |
486 |
|
487 |
/* Fix up .dynamic entries. */ |
488 |
- o = bfd_get_section_by_name (dynobj, ".dynamic"); |
489 |
- BFD_ASSERT (o != NULL); |
490 |
- |
491 |
dyncon = o->contents; |
492 |
dynconend = o->contents + o->size; |
493 |
for (; dyncon < dynconend; dyncon += bed->s->sizeof_dyn) |
494 |
@@ -8702,7 +8702,7 @@ bfd_elf_final_link (bfd *abfd, struct bf |
495 |
if (dyn.d_tag == DT_TEXTREL) |
496 |
{ |
497 |
info->callbacks->einfo |
498 |
- (_("%P: warning: creating a DT_TEXTREL in a shared object.\n")); |
499 |
+ (_("%P: warning: creating a DT_TEXTREL in object.\n")); |
500 |
break; |
501 |
} |
502 |
} |
503 |
--- ld/ldmain.c |
504 |
+++ ld/ldmain.c |
505 |
@@ -282,2 +282,3 @@ main (int argc, char **argv) |
506 |
link_info.spare_dynamic_tags = 5; |
507 |
+ link_info.warn_shared_textrel = TRUE; |
508 |
link_info.sharable_sections = FALSE; |
509 |
--- ld/testsuite/lib/ld-lib.exp |
510 |
+++ ld/testsuite/lib/ld-lib.exp |
511 |
@@ -181,6 +181,10 @@ proc default_ld_simple_link { ld target |
512 |
# symbol, since the default linker script might use ENTRY. |
513 |
regsub -all "(^|\n)(\[^\n\]*: warning: cannot find entry symbol\[^\n\]*\n?)" $exec_output "\\1" exec_output |
514 |
|
515 |
+ # Gentoo tweak: |
516 |
+ # We want to ignore TEXTREL warnings since we force enable them by default |
517 |
+ regsub -all "^lt-ld-new: warning: creating a DT_TEXTREL in object\." $exec_output "\\1" exec_output |
518 |
+ |
519 |
if [string match "" $exec_output] then { |
520 |
return 1 |
521 |
} else { |
522 |
|
523 |
|
524 |
|
525 |
1.1 src/patchsets/binutils/2.19/76_all_only-use-new-ld-dtags.patch.disabled |
526 |
|
527 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19/76_all_only-use-new-ld-dtags.patch.disabled?rev=1.1&view=markup |
528 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19/76_all_only-use-new-ld-dtags.patch.disabled?rev=1.1&content-type=text/plain |
529 |
|
530 |
Index: 76_all_only-use-new-ld-dtags.patch.disabled |
531 |
=================================================================== |
532 |
Don't generate RPATH if we're going to be generating RUNPATH. |
533 |
|
534 |
need to ponder what ramifications this has before enabling it |
535 |
|
536 |
--- binutils/bfd/elflink.c |
537 |
+++ binutils/bfd/elflink.c |
538 |
@@ -5382,11 +5382,15 @@ |
539 |
|
540 |
indx = _bfd_elf_strtab_add (elf_hash_table (info)->dynstr, rpath, |
541 |
TRUE); |
542 |
- if (indx == (bfd_size_type) -1 |
543 |
- || !_bfd_elf_add_dynamic_entry (info, DT_RPATH, indx)) |
544 |
+ if (indx == (bfd_size_type) -1) |
545 |
return FALSE; |
546 |
|
547 |
- if (info->new_dtags) |
548 |
+ if (!info->new_dtags) |
549 |
+ { |
550 |
+ if (!_bfd_elf_add_dynamic_entry (info, DT_RPATH, indx)) |
551 |
+ return FALSE; |
552 |
+ } |
553 |
+ else |
554 |
{ |
555 |
_bfd_elf_strtab_addref (elf_hash_table (info)->dynstr, indx); |
556 |
if (!_bfd_elf_add_dynamic_entry (info, DT_RUNPATH, indx)) |
557 |
|
558 |
|
559 |
|
560 |
1.1 src/patchsets/binutils/2.19/76_all_use-new-ld-dtags.patch |
561 |
|
562 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19/76_all_use-new-ld-dtags.patch?rev=1.1&view=markup |
563 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19/76_all_use-new-ld-dtags.patch?rev=1.1&content-type=text/plain |
564 |
|
565 |
Index: 76_all_use-new-ld-dtags.patch |
566 |
=================================================================== |
567 |
--- binutils/ld/ldmain.c |
568 |
+++ binutils/ld/ldmain.c |
569 |
@@ -296,6 +296,7 @@ main (int argc, char **argv) |
570 |
|
571 |
link_info.allow_undefined_version = TRUE; |
572 |
link_info.keep_memory = TRUE; |
573 |
+ link_info.new_dtags = TRUE; |
574 |
link_info.combreloc = TRUE; |
575 |
link_info.strip_discarded = TRUE; |
576 |
link_info.callbacks = &link_callbacks; |
577 |
|
578 |
|
579 |
|
580 |
1.1 src/patchsets/binutils/2.19/77_all_generate-gnu-hash.patch |
581 |
|
582 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19/77_all_generate-gnu-hash.patch?rev=1.1&view=markup |
583 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19/77_all_generate-gnu-hash.patch?rev=1.1&content-type=text/plain |
584 |
|
585 |
Index: 77_all_generate-gnu-hash.patch |
586 |
=================================================================== |
587 |
--- binutils/ld/ldmain.c |
588 |
+++ binutils/ld/ldmain.c |
589 |
@@ -273,2 +273,5 @@ main (int argc, char **argv) |
590 |
link_info.emit_hash = TRUE; |
591 |
+#ifndef __mips__ |
592 |
+ link_info.emit_gnu_hash = TRUE; |
593 |
+#endif |
594 |
link_info.callbacks = &link_callbacks; |
595 |
|
596 |
|
597 |
|
598 |
1.1 src/patchsets/binutils/2.19/78_all_use-relro.patch |
599 |
|
600 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19/78_all_use-relro.patch?rev=1.1&view=markup |
601 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19/78_all_use-relro.patch?rev=1.1&content-type=text/plain |
602 |
|
603 |
Index: 78_all_use-relro.patch |
604 |
=================================================================== |
605 |
--- binutils/ld/ldmain.c |
606 |
+++ binutils/ld/ldmain.c |
607 |
@@ -293,2 +293,3 @@ main (int argc, char **argv) |
608 |
link_info.combreloc = TRUE; |
609 |
+ link_info.relro = TRUE; |
610 |
link_info.strip_discarded = TRUE; |
611 |
|
612 |
|
613 |
|
614 |
1.1 src/patchsets/binutils/2.19/91_all_libiberty-pic.patch |
615 |
|
616 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19/91_all_libiberty-pic.patch?rev=1.1&view=markup |
617 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19/91_all_libiberty-pic.patch?rev=1.1&content-type=text/plain |
618 |
|
619 |
Index: 91_all_libiberty-pic.patch |
620 |
=================================================================== |
621 |
--- libiberty/Makefile.in.mps 2004-05-13 15:53:17.000000000 +0200 |
622 |
+++ libiberty/Makefile.in 2004-05-13 15:52:53.000000000 +0200 |
623 |
@@ -224,6 +224,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA |
624 |
$(AR) $(AR_FLAGS) $(TARGETLIB) \ |
625 |
$(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \ |
626 |
$(RANLIB) $(TARGETLIB); \ |
627 |
+ cp $(TARGETLIB) ../ ; \ |
628 |
cd ..; \ |
629 |
else true; fi |
630 |
|
631 |
|
632 |
|
633 |
|
634 |
1.1 src/patchsets/binutils/2.19/README.history |
635 |
|
636 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19/README.history?rev=1.1&view=markup |
637 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19/README.history?rev=1.1&content-type=text/plain |
638 |
|
639 |
Index: README.history |
640 |
=================================================================== |
641 |
1.0 11.01.2008 |
642 |
+ 03_all_binutils-2.15.92.0.2-ppc64-pie.patch |
643 |
+ 08_all_binutils-RPATH_ENVVAR-smack.patch |
644 |
+ 12_all_sh-targets.patch |
645 |
+ 42_all_012_check_ldrunpath_length.patch |
646 |
+ 63_all_binutils-2.19-pt-pax-flags-20081101.patch |
647 |
+ 65_all_binutils-2.19-amd64-32bit-path.patch |
648 |
+ 66_all_binutils-2.18.50.0.2-warn-textrel.patch |
649 |
+ 76_all_use-new-ld-dtags.patch |
650 |
+ 77_all_generate-gnu-hash.patch |
651 |
+ 78_all_use-relro.patch |
652 |
+ 91_all_libiberty-pic.patch |