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