Gentoo Archives: gentoo-commits

From: "Mike Frysinger (vapier)" <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo commit in src/patchsets/binutils/2.19.51.0.10: 03_all_binutils-2.15.92.0.2-ppc64-pie.patch 08_all_binutils-RPATH_ENVVAR-smack.patch 12_all_sh-targets.patch 42_all_012_check_ldrunpath_length.patch 63_all_binutils-2.18-pt-pax-flags-20070828.patch 65_all_binutils-2.18-amd64-32bit-path.patch 66_all_binutils-2.18.50.0.2-warn-textrel.patch 76_all_only-use-new-ld-dtags.patch.disabled 76_all_use-new-ld-dtags.patch 77_all_document-new-dtags-behaviour.patch 77_all_generate-gnu-hash.patch 78_all_use-relro.patch 91_all_libiberty-pic.patch README.history
Date: Fri, 19 Jun 2009 13:52:20
Message-Id: E1MHeVs-0007a3-RU@stork.gentoo.org
1 vapier 09/06/19 13:52:16
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.18-pt-pax-flags-20070828.patch
8 65_all_binutils-2.18-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 import of 2.19.51.0.10 patchset based on last 2.19.51.0.9 patchset
18
19 Revision Changes Path
20 1.1 src/patchsets/binutils/2.19.51.0.10/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.19.51.0.10/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.19.51.0.10/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.19.51.0.10/08_all_binutils-RPATH_ENVVAR-smack.patch
47
48 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19.51.0.10/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.19.51.0.10/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.19.51.0.10/12_all_sh-targets.patch
70
71 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19.51.0.10/12_all_sh-targets.patch?rev=1.1&view=markup
72 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19.51.0.10/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.19.51.0.10/42_all_012_check_ldrunpath_length.patch
127
128 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19.51.0.10/42_all_012_check_ldrunpath_length.patch?rev=1.1&view=markup
129 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19.51.0.10/42_all_012_check_ldrunpath_length.patch?rev=1.1&content-type=text/plain
130
131 Index: 42_all_012_check_ldrunpath_length.patch
132 ===================================================================
133 #!/bin/sh -e
134 ## 012_check_ldrunpath_length.dpatch by Chris Chimelis <chris@××××××.org>
135 ##
136 ## All lines beginning with `## DP:' are a description of the patch.
137 ## DP: Only generate an RPATH entry if LD_RUN_PATH is not empty, for
138 ## DP: cases where -rpath isn't specified. (#151024)
139
140 if [ $# -ne 1 ]; then
141 echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
142 exit 1
143 fi
144
145 [ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
146 patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
147
148 case "$1" in
149 -patch) patch $patch_opts -p1 < $0;;
150 -unpatch) patch $patch_opts -p1 -R < $0;;
151 *)
152 echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
153 exit 1;;
154 esac
155
156 exit 0
157
158 @DPATCH@
159 diff -urNad /home/james/debian/packages/binutils/new/binutils-2.15/ld/emultempl/elf32.em binutils-2.15/ld/emultempl/elf32.em
160 --- /home/james/debian/packages/binutils/new/binutils-2.15/ld/emultempl/elf32.em 2004-05-21 23:12:58.000000000 +0100
161 +++ binutils-2.15/ld/emultempl/elf32.em 2004-05-21 23:12:59.000000000 +0100
162 @@ -692,6 +692,8 @@
163 && command_line.rpath == NULL)
164 {
165 lib_path = (const char *) getenv ("LD_RUN_PATH");
166 + if ((lib_path) && (strlen (lib_path) == 0))
167 + lib_path = NULL;
168 if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
169 force))
170 break;
171 @@ -871,6 +873,8 @@
172 rpath = command_line.rpath;
173 if (rpath == NULL)
174 rpath = (const char *) getenv ("LD_RUN_PATH");
175 + if ((rpath) && (strlen (rpath) == 0))
176 + rpath = NULL;
177 if (! (bfd_elf_size_dynamic_sections
178 (output_bfd, command_line.soname, rpath,
179 command_line.filter_shlib,
180
181
182
183 1.1 src/patchsets/binutils/2.19.51.0.10/63_all_binutils-2.18-pt-pax-flags-20070828.patch
184
185 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19.51.0.10/63_all_binutils-2.18-pt-pax-flags-20070828.patch?rev=1.1&view=markup
186 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19.51.0.10/63_all_binutils-2.18-pt-pax-flags-20070828.patch?rev=1.1&content-type=text/plain
187
188 Index: 63_all_binutils-2.18-pt-pax-flags-20070828.patch
189 ===================================================================
190 --- binutils-2.18/bfd/elf-bfd.h
191 +++ binutils-2.18/bfd/elf-bfd.h
192 @@ -1431,6 +1431,9 @@ struct elf_obj_tdata
193 /* Should the PT_GNU_RELRO segment be emitted? */
194 bfd_boolean relro;
195
196 + /* Segment flags for the PT_PAX_FLAGS segment. */
197 + unsigned int pax_flags;
198 +
199 /* Symbol version definitions in external objects. */
200 Elf_Internal_Verdef *verdef;
201
202 --- binutils-2.18/bfd/elf.c
203 +++ binutils-2.18/bfd/elf.c
204 @@ -1085,6 +1085,7 @@ get_segment_type (unsigned int p_type)
205 case PT_GNU_EH_FRAME: pt = "EH_FRAME"; break;
206 case PT_GNU_STACK: pt = "STACK"; break;
207 case PT_GNU_RELRO: pt = "RELRO"; break;
208 + case PT_PAX_FLAGS: pt = "PAX_FLAGS"; break;
209 default: pt = NULL; break;
210 }
211 return pt;
212 @@ -2361,6 +2362,9 @@ bfd_section_from_phdr (bfd *abfd, Elf_In
213 case PT_GNU_RELRO:
214 return _bfd_elf_make_section_from_phdr (abfd, hdr, index, "relro");
215
216 + case PT_PAX_FLAGS:
217 + return _bfd_elf_make_section_from_phdr (abfd, hdr, index, "pax_flags");
218 +
219 default:
220 /* Check for any processor-specific program segment types. */
221 bed = get_elf_backend_data (abfd);
222 @@ -3341,6 +3345,11 @@ get_program_header_size (bfd *abfd, stru
223 ++segs;
224 }
225
226 + {
227 + /* We need a PT_PAX_FLAGS segment. */
228 + ++segs;
229 + }
230 +
231 for (s = abfd->sections; s != NULL; s = s->next)
232 {
233 if ((s->flags & SEC_LOAD) != 0
234 @@ -3868,6 +3877,20 @@ _bfd_elf_map_sections_to_segments (bfd *
235 pm = &m->next;
236 }
237
238 + {
239 + amt = sizeof (struct elf_segment_map);
240 + m = bfd_zalloc (abfd, amt);
241 + if (m == NULL)
242 + goto error_return;
243 + m->next = NULL;
244 + m->p_type = PT_PAX_FLAGS;
245 + m->p_flags = elf_tdata (abfd)->pax_flags;
246 + m->p_flags_valid = 1;
247 +
248 + *pm = m;
249 + pm = &m->next;
250 + }
251 +
252 free (sections);
253 elf_tdata (abfd)->segment_map = mfirst;
254 }
255 @@ -5010,7 +5033,8 @@ rewrite_elf_program_header (bfd *ibfd, b
256 6. PT_TLS segment includes only SHF_TLS sections.
257 7. SHF_TLS sections are only in PT_TLS or PT_LOAD segments.
258 8. PT_DYNAMIC should not contain empty sections at the beginning
259 - (with the possible exception of .dynamic). */
260 + (with the possible exception of .dynamic).
261 + 9. PT_PAX_FLAGS segments do not include any sections. */
262 #define IS_SECTION_IN_INPUT_SEGMENT(section, segment, bed) \
263 ((((segment->p_paddr \
264 ? IS_CONTAINED_BY_LMA (section, segment, segment->p_paddr) \
265 @@ -5018,6 +5042,7 @@ rewrite_elf_program_header (bfd *ibfd, b
266 && (section->flags & SEC_ALLOC) != 0) \
267 || IS_COREFILE_NOTE (segment, section)) \
268 && segment->p_type != PT_GNU_STACK \
269 + && segment->p_type != PT_PAX_FLAGS \
270 && (segment->p_type != PT_TLS \
271 || (section->flags & SEC_THREAD_LOCAL)) \
272 && (segment->p_type == PT_LOAD \
273 --- binutils-2.18/bfd/elflink.c
274 +++ binutils-2.18/bfd/elflink.c
275 @@ -5328,16 +5328,30 @@ bfd_elf_size_dynamic_sections (bfd *outp
276 return TRUE;
277
278 bed = get_elf_backend_data (output_bfd);
279 +
280 + elf_tdata (output_bfd)->pax_flags = PF_NORANDEXEC;
281 + if (info->execheap)
282 + elf_tdata (output_bfd)->pax_flags |= PF_NOMPROTECT;
283 + else if (info->noexecheap)
284 + elf_tdata (output_bfd)->pax_flags |= PF_MPROTECT;
285 +
286 if (info->execstack)
287 - elf_tdata (output_bfd)->stack_flags = PF_R | PF_W | PF_X;
288 + {
289 + elf_tdata (output_bfd)->stack_flags = PF_R | PF_W | PF_X;
290 + elf_tdata (output_bfd)->pax_flags |= PF_EMUTRAMP;
291 + }
292 else if (info->noexecstack)
293 - elf_tdata (output_bfd)->stack_flags = PF_R | PF_W;
294 + {
295 + elf_tdata (output_bfd)->stack_flags = PF_R | PF_W;
296 + elf_tdata (output_bfd)->pax_flags |= PF_NOEMUTRAMP;
297 + }
298 else
299 {
300 bfd *inputobj;
301 asection *notesec = NULL;
302 int exec = 0;
303
304 + elf_tdata (output_bfd)->pax_flags |= PF_NOEMUTRAMP;
305 for (inputobj = info->input_bfds;
306 inputobj;
307 inputobj = inputobj->link_next)
308 @@ -5350,7 +5364,11 @@ bfd_elf_size_dynamic_sections (bfd *outp
309 if (s)
310 {
311 if (s->flags & SEC_CODE)
312 - exec = PF_X;
313 + {
314 + elf_tdata (output_bfd)->pax_flags &= ~PF_NOEMUTRAMP;
315 + elf_tdata (output_bfd)->pax_flags |= PF_EMUTRAMP;
316 + exec = PF_X;
317 + }
318 notesec = s;
319 }
320 else if (bed->default_execstack)
321 --- binutils-2.18/binutils/readelf.c
322 +++ binutils-2.18/binutils/readelf.c
323 @@ -2469,6 +2469,7 @@ get_segment_type (unsigned long p_type)
324 return "GNU_EH_FRAME";
325 case PT_GNU_STACK: return "GNU_STACK";
326 case PT_GNU_RELRO: return "GNU_RELRO";
327 + case PT_PAX_FLAGS: return "PAX_FLAGS";
328
329 default:
330 if ((p_type >= PT_LOPROC) && (p_type <= PT_HIPROC))
331 --- binutils-2.18/include/bfdlink.h
332 +++ binutils-2.18/include/bfdlink.h
333 @@ -321,6 +321,14 @@ struct bfd_link_info
334 /* TRUE if PT_GNU_RELRO segment should be created. */
335 unsigned int relro: 1;
336
337 + /* TRUE if PT_PAX_FLAGS segment should be created with PF_NOMPROTECT
338 + flags. */
339 + unsigned int execheap: 1;
340 +
341 + /* TRUE if PT_PAX_FLAGS segment should be created with PF_MPROTECT
342 + flags. */
343 + unsigned int noexecheap: 1;
344 +
345 /* TRUE if we should warn when adding a DT_TEXTREL to a shared object. */
346 unsigned int warn_shared_textrel: 1;
347
348 --- binutils-2.18/include/elf/common.h
349 +++ binutils-2.18/include/elf/common.h
350 @@ -309,6 +309,7 @@
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_GNU_SHR (PT_LOOS + 0x474e554) /* Sharable segment */
354 +#define PT_PAX_FLAGS (PT_LOOS + 0x5041580) /* PaX flags */
355
356 /* Program segment permissions, in program header p_flags field. */
357
358 @@ -319,6 +320,21 @@
359 #define PF_MASKOS 0x0FF00000 /* New value, Oct 4, 1999 Draft */
360 #define PF_MASKPROC 0xF0000000 /* Processor-specific reserved bits */
361
362 +/* Flags to control PaX behavior. */
363 +
364 +#define PF_PAGEEXEC (1 << 4) /* Enable PAGEEXEC */
365 +#define PF_NOPAGEEXEC (1 << 5) /* Disable PAGEEXEC */
366 +#define PF_SEGMEXEC (1 << 6) /* Enable SEGMEXEC */
367 +#define PF_NOSEGMEXEC (1 << 7) /* Disable SEGMEXEC */
368 +#define PF_MPROTECT (1 << 8) /* Enable MPROTECT */
369 +#define PF_NOMPROTECT (1 << 9) /* Disable MPROTECT */
370 +#define PF_RANDEXEC (1 << 10) /* Enable RANDEXEC */
371 +#define PF_NORANDEXEC (1 << 11) /* Disable RANDEXEC */
372 +#define PF_EMUTRAMP (1 << 12) /* Enable EMUTRAMP */
373 +#define PF_NOEMUTRAMP (1 << 13) /* Disable EMUTRAMP */
374 +#define PF_RANDMMAP (1 << 14) /* Enable RANDMMAP */
375 +#define PF_NORANDMMAP (1 << 15) /* Disable RANDMMAP */
376 +
377 /* Values for section header, sh_type field. */
378
379 #define SHT_NULL 0 /* Section header table entry unused */
380 --- binutils-2.18/ld/emultempl/elf32.em
381 +++ binutils-2.18/ld/emultempl/elf32.em
382 @@ -2132,6 +2132,16 @@ fragment <<EOF
383 link_info.noexecstack = TRUE;
384 link_info.execstack = FALSE;
385 }
386 + else if (strcmp (optarg, "execheap") == 0)
387 + {
388 + link_info.execheap = TRUE;
389 + link_info.noexecheap = FALSE;
390 + }
391 + else if (strcmp (optarg, "noexecheap") == 0)
392 + {
393 + link_info.noexecheap = TRUE;
394 + link_info.execheap = FALSE;
395 + }
396 EOF
397
398 if test -n "$COMMONPAGESIZE"; then
399 @@ -2205,6 +2215,8 @@ fragment <<EOF
400 -z defs Report unresolved symbols in object files.\n"));
401 fprintf (file, _("\
402 -z execstack Mark executable as requiring executable stack\n"));
403 + fprintf (file, _("\
404 + -z execheap Mark executable as requiring executable heap\n"));
405 fprintf (file, _("\
406 -z initfirst Mark DSO to be initialized first at runtime\n"));
407 fprintf (file, _("\
408 @@ -2217,6 +2228,8 @@ fragment <<EOF
409 -z nodump Mark DSO not available to dldump\n"));
410 fprintf (file, _("\
411 -z noexecstack Mark executable as not requiring executable stack\n"));
412 + fprintf (file, _("\
413 + -z noexecheap Mark executable as not requiring executable heap\n"));
414 EOF
415
416 if test -n "$COMMONPAGESIZE"; then
417 --- binutils-2.18/ld/ldgram.y
418 +++ binutils-2.18/ld/ldgram.y
419 @@ -1099,6 +1099,8 @@ phdr_type:
420 $$ = exp_intop (0x6474e550);
421 else if (strcmp (s, "PT_GNU_STACK") == 0)
422 $$ = exp_intop (0x6474e551);
423 + else if (strcmp (s, "PT_PAX_FLAGS") == 0)
424 + $$ = exp_intop (0x65041580);
425 else
426 {
427 einfo (_("\
428
429
430
431 1.1 src/patchsets/binutils/2.19.51.0.10/65_all_binutils-2.18-amd64-32bit-path.patch
432
433 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19.51.0.10/65_all_binutils-2.18-amd64-32bit-path.patch?rev=1.1&view=markup
434 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19.51.0.10/65_all_binutils-2.18-amd64-32bit-path.patch?rev=1.1&content-type=text/plain
435
436 Index: 65_all_binutils-2.18-amd64-32bit-path.patch
437 ===================================================================
438 --- binutils/ld/emulparams/elf_i386.sh
439 +++ binutils/ld/emulparams/elf_i386.sh
440 @@ -13,3 +13,13 @@
441 NO_SMALL_DATA=yes
442 SEPARATE_GOTPLT=12
443 SHARABLE_SECTIONS=yes
444 +
445 +# In Gentoo, we install 32bit libs into /lib32 in an
446 +# ABI setup with amd64/x86
447 +case "$target" in
448 + x86_64*-linux*)
449 + case "$EMULATION_NAME" in
450 + *i386*) LIBPATH_SUFFIX=32 ;;
451 + esac
452 + ;;
453 +esac
454
455
456
457 1.1 src/patchsets/binutils/2.19.51.0.10/66_all_binutils-2.18.50.0.2-warn-textrel.patch
458
459 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19.51.0.10/66_all_binutils-2.18.50.0.2-warn-textrel.patch?rev=1.1&view=markup
460 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19.51.0.10/66_all_binutils-2.18.50.0.2-warn-textrel.patch?rev=1.1&content-type=text/plain
461
462 Index: 66_all_binutils-2.18.50.0.2-warn-textrel.patch
463 ===================================================================
464 textrels are bad for forcing copy-on-write (this affects everyone),
465 and for security/runtime code generation, this affects security ppl.
466 But in either case, it doesn't matter who needs textrels, it's
467 the very fact that they're needed at all.
468
469 2006-06-10 Ned Ludd <solar@g.o>, Mike Frysinger <vapier@g.o>
470
471 * bfd/elflink.c (bfd_elf_final_link): Check all objects for TEXTRELs.
472 * ld/ldmain.c (main): Change textrel warning default to true.
473 * ld/testsuite/lib/ld-lib.exp (default_ld_simple_link): Scrub TEXTREL
474 warnings from ld output.
475
476 --- bfd/elflink.c
477 +++ bfd/elflink.c
478 @@ -8652,14 +8652,12 @@
479 goto error_return;
480
481 /* Check for DT_TEXTREL (late, in case the backend removes it). */
482 - if (info->warn_shared_textrel && info->shared)
483 + o = bfd_get_section_by_name (dynobj, ".dynamic");
484 + if (info->warn_shared_textrel && o != NULL)
485 {
486 bfd_byte *dyncon, *dynconend;
487
488 /* Fix up .dynamic entries. */
489 - o = bfd_get_section_by_name (dynobj, ".dynamic");
490 - BFD_ASSERT (o != NULL);
491 -
492 dyncon = o->contents;
493 dynconend = o->contents + o->size;
494 for (; dyncon < dynconend; dyncon += bed->s->sizeof_dyn)
495 @@ -8702,7 +8702,7 @@ bfd_elf_final_link (bfd *abfd, struct bf
496 if (dyn.d_tag == DT_TEXTREL)
497 {
498 info->callbacks->einfo
499 - (_("%P: warning: creating a DT_TEXTREL in a shared object.\n"));
500 + (_("%P: warning: creating a DT_TEXTREL in object.\n"));
501 break;
502 }
503 }
504 --- ld/ldmain.c
505 +++ ld/ldmain.c
506 @@ -282,2 +282,3 @@ main (int argc, char **argv)
507 link_info.spare_dynamic_tags = 5;
508 + link_info.warn_shared_textrel = TRUE;
509 link_info.sharable_sections = FALSE;
510 --- ld/testsuite/lib/ld-lib.exp
511 +++ ld/testsuite/lib/ld-lib.exp
512 @@ -181,6 +181,10 @@ proc default_ld_simple_link { ld target
513 # symbol, since the default linker script might use ENTRY.
514 regsub -all "(^|\n)(\[^\n\]*: warning: cannot find entry symbol\[^\n\]*\n?)" $exec_output "\\1" exec_output
515
516 + # Gentoo tweak:
517 + # We want to ignore TEXTREL warnings since we force enable them by default
518 + regsub -all "^lt-ld-new: warning: creating a DT_TEXTREL in object\." $exec_output "\\1" exec_output
519 +
520 if [string match "" $exec_output] then {
521 return 1
522 } else {
523
524
525
526 1.1 src/patchsets/binutils/2.19.51.0.10/76_all_only-use-new-ld-dtags.patch.disabled
527
528 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19.51.0.10/76_all_only-use-new-ld-dtags.patch.disabled?rev=1.1&view=markup
529 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19.51.0.10/76_all_only-use-new-ld-dtags.patch.disabled?rev=1.1&content-type=text/plain
530
531 Index: 76_all_only-use-new-ld-dtags.patch.disabled
532 ===================================================================
533 Don't generate RPATH if we're going to be generating RUNPATH.
534
535 need to ponder what ramifications this has before enabling it
536
537 --- binutils/bfd/elflink.c
538 +++ binutils/bfd/elflink.c
539 @@ -5382,11 +5382,15 @@
540
541 indx = _bfd_elf_strtab_add (elf_hash_table (info)->dynstr, rpath,
542 TRUE);
543 - if (indx == (bfd_size_type) -1
544 - || !_bfd_elf_add_dynamic_entry (info, DT_RPATH, indx))
545 + if (indx == (bfd_size_type) -1)
546 return FALSE;
547
548 - if (info->new_dtags)
549 + if (!info->new_dtags)
550 + {
551 + if (!_bfd_elf_add_dynamic_entry (info, DT_RPATH, indx))
552 + return FALSE;
553 + }
554 + else
555 {
556 _bfd_elf_strtab_addref (elf_hash_table (info)->dynstr, indx);
557 if (!_bfd_elf_add_dynamic_entry (info, DT_RUNPATH, indx))
558
559
560
561 1.1 src/patchsets/binutils/2.19.51.0.10/76_all_use-new-ld-dtags.patch
562
563 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19.51.0.10/76_all_use-new-ld-dtags.patch?rev=1.1&view=markup
564 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19.51.0.10/76_all_use-new-ld-dtags.patch?rev=1.1&content-type=text/plain
565
566 Index: 76_all_use-new-ld-dtags.patch
567 ===================================================================
568 --- binutils/ld/ldmain.c
569 +++ binutils/ld/ldmain.c
570 @@ -296,6 +296,7 @@ main (int argc, char **argv)
571
572 link_info.allow_undefined_version = TRUE;
573 link_info.keep_memory = TRUE;
574 + link_info.new_dtags = TRUE;
575 link_info.combreloc = TRUE;
576 link_info.strip_discarded = TRUE;
577 link_info.callbacks = &link_callbacks;
578
579
580
581 1.1 src/patchsets/binutils/2.19.51.0.10/77_all_document-new-dtags-behaviour.patch
582
583 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19.51.0.10/77_all_document-new-dtags-behaviour.patch?rev=1.1&view=markup
584 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19.51.0.10/77_all_document-new-dtags-behaviour.patch?rev=1.1&content-type=text/plain
585
586 Index: 77_all_document-new-dtags-behaviour.patch
587 ===================================================================
588 Index: binutils-2.19.51.0.5/ld/ld.texinfo
589 ===================================================================
590 --- binutils-2.19.51.0.5.orig/ld/ld.texinfo
591 +++ binutils-2.19.51.0.5/ld/ld.texinfo
592 @@ -2036,8 +2036,9 @@ This linker can create the new dynamic t
593 systems may not understand them. If you specify
594 @option{--enable-new-dtags}, the dynamic tags will be created as needed.
595 If you specify @option{--disable-new-dtags}, no new dynamic tags will be
596 -created. By default, the new dynamic tags are not created. Note that
597 -those options are only available for ELF systems.
598 +created. On Gentoo, by default, the new dynamic tags are created (this
599 +differs from upstream behaviour). Note that those options are only
600 +available for ELF systems.
601
602 @kindex --hash-size=@var{number}
603 @item --hash-size=@var{number}
604
605
606
607 1.1 src/patchsets/binutils/2.19.51.0.10/77_all_generate-gnu-hash.patch
608
609 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19.51.0.10/77_all_generate-gnu-hash.patch?rev=1.1&view=markup
610 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19.51.0.10/77_all_generate-gnu-hash.patch?rev=1.1&content-type=text/plain
611
612 Index: 77_all_generate-gnu-hash.patch
613 ===================================================================
614 --- binutils/ld/ldmain.c
615 +++ binutils/ld/ldmain.c
616 @@ -273,2 +273,5 @@ main (int argc, char **argv)
617 link_info.emit_hash = TRUE;
618 +#ifndef __mips__
619 + link_info.emit_gnu_hash = TRUE;
620 +#endif
621 link_info.callbacks = &link_callbacks;
622
623
624
625 1.1 src/patchsets/binutils/2.19.51.0.10/78_all_use-relro.patch
626
627 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19.51.0.10/78_all_use-relro.patch?rev=1.1&view=markup
628 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19.51.0.10/78_all_use-relro.patch?rev=1.1&content-type=text/plain
629
630 Index: 78_all_use-relro.patch
631 ===================================================================
632 --- binutils/ld/ldmain.c
633 +++ binutils/ld/ldmain.c
634 @@ -293,2 +293,3 @@ main (int argc, char **argv)
635 link_info.combreloc = TRUE;
636 + link_info.relro = TRUE;
637 link_info.strip_discarded = TRUE;
638
639
640
641 1.1 src/patchsets/binutils/2.19.51.0.10/91_all_libiberty-pic.patch
642
643 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19.51.0.10/91_all_libiberty-pic.patch?rev=1.1&view=markup
644 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19.51.0.10/91_all_libiberty-pic.patch?rev=1.1&content-type=text/plain
645
646 Index: 91_all_libiberty-pic.patch
647 ===================================================================
648 --- libiberty/Makefile.in.mps 2004-05-13 15:53:17.000000000 +0200
649 +++ libiberty/Makefile.in 2004-05-13 15:52:53.000000000 +0200
650 @@ -224,6 +224,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA
651 $(AR) $(AR_FLAGS) $(TARGETLIB) \
652 $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
653 $(RANLIB) $(TARGETLIB); \
654 + cp $(TARGETLIB) ../ ; \
655 cd ..; \
656 else true; fi
657
658
659
660
661 1.1 src/patchsets/binutils/2.19.51.0.10/README.history
662
663 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19.51.0.10/README.history?rev=1.1&view=markup
664 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/binutils/2.19.51.0.10/README.history?rev=1.1&content-type=text/plain
665
666 Index: README.history
667 ===================================================================
668 1.0 19.06.2009
669 + 03_all_binutils-2.15.92.0.2-ppc64-pie.patch
670 + 08_all_binutils-RPATH_ENVVAR-smack.patch
671 + 12_all_sh-targets.patch
672 + 42_all_012_check_ldrunpath_length.patch
673 + 63_all_binutils-2.18-pt-pax-flags-20070828.patch
674 + 65_all_binutils-2.18-amd64-32bit-path.patch
675 + 66_all_binutils-2.18.50.0.2-warn-textrel.patch
676 + 76_all_use-new-ld-dtags.patch
677 + 77_all_document-new-dtags-behaviour.patch
678 + 77_all_generate-gnu-hash.patch
679 + 78_all_use-relro.patch
680 + 91_all_libiberty-pic.patch