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