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