source: clfs-sysroot/patches/binutils-2.17-branch_update-2.patch@ 9401f22

Last change on this file since 9401f22 was e86bfc4, checked in by Joe Ciccone <jciccone@…>, 18 years ago

Update patches.

  • Property mode set to 100644
File size: 21.8 KB
RevLine 
[e86bfc4]1Submitted By: Jim Gifford jim at linuxfromscratch dot org>
2Orginally Submitted By: Robert Connolly <robert at linuxfromscratch dot org>
3Date: 2007-01-12
[16ca464]4Initial Package Version: 2.17
5Upstream Status: From Upstream
6Origin: cvs -z 9 -d :pserver:anoncvs@sourceware.org:/cvs/src co \
7 -rbinutils-2_17-branch binutils
8Description: This is the binutils-2_17-branch (bug fix branch) update,
9compared from binutils-2.17-release and binutils-2_17-branch with all
10the fluff removed (CVS entries, maintainer files, etc). This patch
11should be updated periodically.
12
[e86bfc4]13diff -Naur binutils-2.17.orig/bfd/bfd-in2.h binutils-2.17/bfd/bfd-in2.h
14--- binutils-2.17.orig/bfd/bfd-in2.h 2006-03-25 16:38:42.000000000 -0800
15+++ binutils-2.17/bfd/bfd-in2.h 2006-07-18 19:37:04.000000000 -0700
[16ca464]16@@ -643,6 +643,12 @@
17 DYN_NO_NEEDED = 8
18 };
19
20+enum notice_asneeded_action {
21+ notice_as_needed,
22+ notice_not_needed,
23+ notice_needed
24+};
25+
26 extern bfd_boolean bfd_elf_record_link_assignment
27 (bfd *, struct bfd_link_info *, const char *, bfd_boolean,
28 bfd_boolean);
[e86bfc4]29diff -Naur binutils-2.17.orig/bfd/bfd-in.h binutils-2.17/bfd/bfd-in.h
30--- binutils-2.17.orig/bfd/bfd-in.h 2006-03-16 04:20:15.000000000 -0800
31+++ binutils-2.17/bfd/bfd-in.h 2006-07-18 19:37:04.000000000 -0700
[16ca464]32@@ -636,6 +636,12 @@
33 DYN_NO_NEEDED = 8
34 };
35
36+enum notice_asneeded_action {
37+ notice_as_needed,
38+ notice_not_needed,
39+ notice_needed
40+};
41+
42 extern bfd_boolean bfd_elf_record_link_assignment
43 (bfd *, struct bfd_link_info *, const char *, bfd_boolean,
44 bfd_boolean);
[e86bfc4]45diff -Naur binutils-2.17.orig/bfd/ChangeLog binutils-2.17/bfd/ChangeLog
46--- binutils-2.17.orig/bfd/ChangeLog 2006-06-23 11:18:16.000000000 -0700
47+++ binutils-2.17/bfd/ChangeLog 2006-12-11 06:52:38.000000000 -0800
48@@ -1,3 +1,30 @@
49+2006-12-11 Eric Botcazou <ebotcazou@adacore.com>
50+
51+ * elflink.c (bfd_elf_gc_sections): Also search for corresponding
52+ sections with .gnu.linkonce.t. prefix.
53+
[16ca464]54+2006-08-08 Nick Clifton <nickc@redhat.com>
55+
56+ PR binutils/2724
57+ * coffcode.h (coff_new_section_hook): Only modify the section
58+ symbol of sections which were created by the user.
59+
60+2006-07-19 Alan Modra <amodra@bigpond.net.au>
61+
62+ * bfd-in.h (enum notice_asneeded_action): Define.
63+ * bfd-in2.h: Regenerate.
64+ * elflink.c (elf_link_add_object_symbols): Call linker "notice"
65+ function with NULL name for as-needed handling.
66+
67+2006-07-12 Matthew R. Dempsky <mrd@alkemio.org>
68+
69+ * cpu-m68k.c (bfd_m68k_compatible): Handle CPU32.
70+
71+2006-06-23 Daniel Jacobowitz <dan@codesourcery.com>
72+
73+ * Makefile.am: Clear RELEASE.
74+ * Makefile.in: Regenerated.
75+
76 2006-06-23 Daniel Jacobowitz <dan@codesourcery.com>
77
78 * configure.in: Update version to 2.17.
[e86bfc4]79diff -Naur binutils-2.17.orig/bfd/coffcode.h binutils-2.17/bfd/coffcode.h
80--- binutils-2.17.orig/bfd/coffcode.h 2005-10-25 10:40:09.000000000 -0700
81+++ binutils-2.17/bfd/coffcode.h 2006-08-08 01:19:57.000000000 -0700
[16ca464]82@@ -1546,9 +1546,6 @@
83 static bfd_boolean
84 coff_new_section_hook (bfd * abfd, asection * section)
85 {
86- combined_entry_type *native;
87- bfd_size_type amt;
88-
89 section->alignment_power = COFF_DEFAULT_SECTION_ALIGNMENT_POWER;
90
91 #ifdef RS6000COFF_C
92@@ -1560,27 +1557,34 @@
93 section->alignment_power = bfd_xcoff_data_align_power (abfd);
94 #endif
95
96- /* Allocate aux records for section symbols, to store size and
97- related info.
98-
99- @@ The 10 is a guess at a plausible maximum number of aux entries
100- (but shouldn't be a constant). */
101- amt = sizeof (combined_entry_type) * 10;
102- native = bfd_zalloc (abfd, amt);
103- if (native == NULL)
104- return FALSE;
105-
106- /* We don't need to set up n_name, n_value, or n_scnum in the native
107- symbol information, since they'll be overridden by the BFD symbol
108- anyhow. However, we do need to set the type and storage class,
109- in case this symbol winds up getting written out. The value 0
110- for n_numaux is already correct. */
111-
112- native->u.syment.n_type = T_NULL;
113- native->u.syment.n_sclass = C_STAT;
114+ /* PR binutils/2724: Only real sections have a symbol that
115+ has the coff_symbol_type structure allocated for it. */
116+ if (! bfd_is_const_section (section))
117+ {
118+ combined_entry_type *native;
119+ bfd_size_type amt;
120+
121+ /* Allocate aux records for section symbols, to store size and
122+ related info.
123+
124+ @@ The 10 is a guess at a plausible maximum number of aux entries
125+ (but shouldn't be a constant). */
126+ amt = sizeof (combined_entry_type) * 10;
127+ native = bfd_zalloc (abfd, amt);
128+ if (native == NULL)
129+ return FALSE;
130
131- coffsymbol (section->symbol)->native = native;
132+ /* We don't need to set up n_name, n_value, or n_scnum in the native
133+ symbol information, since they'll be overridden by the BFD symbol
134+ anyhow. However, we do need to set the type and storage class,
135+ in case this symbol winds up getting written out. The value 0
136+ for n_numaux is already correct. */
137+ native->u.syment.n_type = T_NULL;
138+ native->u.syment.n_sclass = C_STAT;
139
140+ coffsymbol (section->symbol)->native = native;
141+ }
142+
143 coff_set_custom_section_alignment (abfd, section,
144 coff_section_alignment_table,
145 coff_section_alignment_table_size);
[e86bfc4]146diff -Naur binutils-2.17.orig/bfd/cpu-m68k.c binutils-2.17/bfd/cpu-m68k.c
147--- binutils-2.17.orig/bfd/cpu-m68k.c 2006-03-25 02:24:27.000000000 -0800
148+++ binutils-2.17/bfd/cpu-m68k.c 2006-07-12 05:55:21.000000000 -0700
[16ca464]149@@ -202,6 +202,9 @@
150 if (a->mach <= bfd_mach_m68060 && b->mach <= bfd_mach_m68060)
151 /* Merge m68k machine. */
152 return a->mach > b->mach ? a : b;
153+ else if (a->mach == bfd_mach_cpu32 && b->mach == bfd_mach_cpu32)
154+ /* CPU32 is compatible with itself. */
155+ return a;
156 else if (a->mach >= bfd_mach_mcf_isa_a_nodiv
157 && b->mach >= bfd_mach_mcf_isa_a_nodiv)
158 {
[e86bfc4]159diff -Naur binutils-2.17.orig/bfd/elflink.c binutils-2.17/bfd/elflink.c
160--- binutils-2.17.orig/bfd/elflink.c 2006-05-22 08:06:36.000000000 -0700
161+++ binutils-2.17/bfd/elflink.c 2006-12-11 06:52:39.000000000 -0800
[16ca464]162@@ -3496,6 +3496,13 @@
163 if (alloc_mark == NULL)
164 goto error_free_vers;
165
166+ /* Make a special call to the linker "notice" function to
167+ tell it that we are about to handle an as-needed lib. */
168+ if (!(*info->callbacks->notice) (info, NULL, abfd, NULL,
169+ notice_as_needed))
170+ return FALSE;
171+
172+
173 /* Clone the symbol table and sym hashes. Remember some
174 pointers into the symbol table, and dynamic symbol count. */
175 old_hash = (char *) old_tab + tabsize;
176@@ -4169,6 +4176,12 @@
177 }
178 }
179
180+ /* Make a special call to the linker "notice" function to
181+ tell it that symbols added for crefs may need to be removed. */
182+ if (!(*info->callbacks->notice) (info, NULL, abfd, NULL,
183+ notice_not_needed))
184+ return FALSE;
185+
186 free (old_tab);
187 objalloc_free_block ((struct objalloc *) htab->root.table.memory,
188 alloc_mark);
189@@ -4179,6 +4192,9 @@
190
191 if (old_tab != NULL)
192 {
193+ if (!(*info->callbacks->notice) (info, NULL, abfd, NULL,
194+ notice_needed))
195+ return FALSE;
196 free (old_tab);
197 old_tab = NULL;
198 }
[e86bfc4]199@@ -9239,7 +9255,8 @@
200 if (bfd_get_flavour (sub) != bfd_target_elf_flavour)
201 continue;
[16ca464]202
[e86bfc4]203- /* Keep .gcc_except_table.* if the associated .text.* is
204+ /* Keep .gcc_except_table.* if the associated .text.* (or the
205+ associated .gnu.linkonce.t.* if .text.* doesn't exist) is
206 marked. This isn't very nice, but the proper solution,
207 splitting .eh_frame up and using comdat doesn't pan out
208 easily due to needing special relocs to handle the
209@@ -9255,12 +9272,23 @@
210 asection *fn_text;
[16ca464]211
[e86bfc4]212 len = strlen (o->name + 18) + 1;
213- fn_name = bfd_malloc (len + 6);
214+ fn_name = bfd_malloc (len + 16);
215 if (fn_name == NULL)
216 return FALSE;
217+
218+ /* Try the first prefix. */
219 memcpy (fn_name, ".text.", 6);
220 memcpy (fn_name + 6, o->name + 18, len);
221 fn_text = bfd_get_section_by_name (sub, fn_name);
222+
223+ /* Try the second prefix. */
224+ if (fn_text == NULL)
225+ {
226+ memcpy (fn_name, ".gnu.linkonce.t.", 16);
227+ memcpy (fn_name + 16, o->name + 18, len);
228+ fn_text = bfd_get_section_by_name (sub, fn_name);
229+ }
230+
231 free (fn_name);
232 if (fn_text == NULL || !fn_text->gc_mark)
233 continue;
234diff -Naur binutils-2.17.orig/bfd/version.h binutils-2.17/bfd/version.h
235--- binutils-2.17.orig/bfd/version.h 2006-06-23 11:14:41.000000000 -0700
236+++ binutils-2.17/bfd/version.h 2007-01-11 15:00:19.000000000 -0800
[16ca464]237@@ -1,3 +1,3 @@
238-#define BFD_VERSION_DATE 20060623
[e86bfc4]239+#define BFD_VERSION_DATE 20070112
[16ca464]240 #define BFD_VERSION @bfd_version@
241 #define BFD_VERSION_STRING @bfd_version_string@
[e86bfc4]242diff -Naur binutils-2.17.orig/binutils/ChangeLog binutils-2.17/binutils/ChangeLog
243--- binutils-2.17.orig/binutils/ChangeLog 2006-06-12 06:05:03.000000000 -0700
244+++ binutils-2.17/binutils/ChangeLog 2006-08-15 05:01:21.000000000 -0700
[16ca464]245@@ -1,3 +1,8 @@
246+2006-08-15 Nick Clifton <nickc@redhat.com>
247+
248+ PR binutils/3039
249+ * wrstabs.c (stab_tag_type): Initialize 'size'.
250+
251 2006-06-07 Joseph S. Myers <joseph@codesourcery.com>
252
253 * po/Make-in (pdf, ps): New dummy targets.
[e86bfc4]254diff -Naur binutils-2.17.orig/binutils/wrstabs.c binutils-2.17/binutils/wrstabs.c
255--- binutils-2.17.orig/binutils/wrstabs.c 2006-03-16 04:20:16.000000000 -0800
256+++ binutils-2.17/binutils/wrstabs.c 2006-08-15 05:01:21.000000000 -0700
[16ca464]257@@ -1869,7 +1869,7 @@
258 {
259 struct stab_write_handle *info = (struct stab_write_handle *) p;
260 long index;
261- unsigned int size;
262+ unsigned int size = 0;
263
264 index = stab_get_struct_index (info, name, id, kind, &size);
265 if (index < 0)
[e86bfc4]266diff -Naur binutils-2.17.orig/configure.in binutils-2.17/configure.in
267--- binutils-2.17.orig/configure.in 2006-06-23 11:19:53.000000000 -0700
268+++ binutils-2.17/configure.in 2006-04-06 14:49:25.000000000 -0700
[16ca464]269@@ -130,7 +130,7 @@
270 # know that we are building the simulator.
271 # binutils, gas and ld appear in that order because it makes sense to run
272 # "make check" in that particular order.
273-host_tools="byacc flex bison binutils gas ld fixincludes gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar gnattools"
274+host_tools="texinfo byacc flex bison binutils gas ld fixincludes gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar gnattools"
275
276 # libgcj represents the runtime libraries only used by gcj.
277 libgcj="target-libffi \
[e86bfc4]278diff -Naur binutils-2.17.orig/gas/ChangeLog binutils-2.17/gas/ChangeLog
279--- binutils-2.17.orig/gas/ChangeLog 2006-06-12 06:05:03.000000000 -0700
280+++ binutils-2.17/gas/ChangeLog 2006-07-18 19:06:08.000000000 -0700
[16ca464]281@@ -1,3 +1,8 @@
282+2006-07-19 Mat Hostetter <mat@lcs.mit.edu>
283+
284+ * symbols.c (report_op_error): Fix pasto. Don't use as_bad_where
285+ when file and line unknown.
286+
287 2006-06-07 Joseph S. Myers <joseph@codesourcery.com>
288
289 * po/Make-in (pdf, ps): New dummy targets.
[e86bfc4]290diff -Naur binutils-2.17.orig/gas/symbols.c binutils-2.17/gas/symbols.c
291--- binutils-2.17.orig/gas/symbols.c 2006-01-09 09:14:40.000000000 -0800
292+++ binutils-2.17/gas/symbols.c 2006-07-18 19:06:08.000000000 -0700
[16ca464]293@@ -928,13 +928,11 @@
294 && seg_right != undefined_section)
295 {
296 if (right)
297- as_bad_where (file, line,
298- _("invalid sections for operation on `%s' and `%s' setting `%s'"),
299- S_GET_NAME (left), S_GET_NAME (right), S_GET_NAME (symp));
300+ as_bad (_("invalid sections for operation on `%s' and `%s' setting `%s'"),
301+ S_GET_NAME (left), S_GET_NAME (right), S_GET_NAME (symp));
302 else
303- as_bad_where (file, line,
304- _("invalid section for operation on `%s' setting `%s'"),
305- S_GET_NAME (left), S_GET_NAME (symp));
306+ as_bad (_("invalid section for operation on `%s' setting `%s'"),
307+ S_GET_NAME (left), S_GET_NAME (symp));
308 }
309 }
310 }
[e86bfc4]311diff -Naur binutils-2.17.orig/ld/ChangeLog binutils-2.17/ld/ChangeLog
312--- binutils-2.17.orig/ld/ChangeLog 2006-06-12 06:07:28.000000000 -0700
313+++ binutils-2.17/ld/ChangeLog 2006-07-18 19:37:05.000000000 -0700
[16ca464]314@@ -1,3 +1,20 @@
315+2006-07-19 Alan Modra <amodra@bigpond.net.au>
316+
317+ * ld.h (handle_asneeded_cref): Declare.
318+ * ldcref.c: Include objalloc.h.
319+ (old_table, old_tab, alloc_mark): New variables.
320+ (tabsize, entsize, refsize, old_symcount): Likewise.
321+ (add_cref): Use bfd_hash_allocate for refs.
322+ (handle_asneeded_cref): New function.
323+ * ldmain.c (notice): Call handle_asneeded_cref for NULL name.
324+
325+2006-07-04 Daniel Jacobowitz <dan@codesourcery.com>
326+
327+ Backport:
328+ 2006-05-19 Alan Modra <amodra@bigpond.net.au>
329+ * ldlang.c (lang_size_sections_1): Don't check mem regions for
330+ os->ignored sections.
331+
332 2006-06-12 Fred Fish <fnf@specifix.com>
333
334 * emulparams/elf32bmip.sh (OTHER_SECTIONS): Keep the
[e86bfc4]335diff -Naur binutils-2.17.orig/ld/ldcref.c binutils-2.17/ld/ldcref.c
336--- binutils-2.17.orig/ld/ldcref.c 2006-03-16 04:20:16.000000000 -0800
337+++ binutils-2.17/ld/ldcref.c 2006-07-18 19:37:05.000000000 -0700
[16ca464]338@@ -27,6 +27,7 @@
339 #include "sysdep.h"
340 #include "bfdlink.h"
341 #include "libiberty.h"
342+#include "objalloc.h"
343
344 #include "ld.h"
345 #include "ldmain.h"
346@@ -101,6 +102,15 @@
347
348 static size_t cref_symcount;
349
350+/* Used to take a snapshot of the cref hash table when starting to
351+ add syms from an as-needed library. */
352+static struct bfd_hash_entry **old_table;
353+static unsigned int old_size;
354+static void *old_tab;
355+static void *alloc_mark;
356+static size_t tabsize, entsize, refsize;
357+static size_t old_symcount;
358+
359 /* Create an entry in a cref hash table. */
360
361 static struct bfd_hash_entry *
362@@ -165,7 +175,9 @@
363
364 if (r == NULL)
365 {
366- r = xmalloc (sizeof *r);
367+ r = bfd_hash_allocate (&cref_table.root, sizeof *r);
368+ if (r == NULL)
369+ einfo (_("%X%P: cref alloc failed: %E\n"));
370 r->next = h->refs;
371 h->refs = r;
372 r->abfd = abfd;
373@@ -182,6 +194,123 @@
374 r->def = TRUE;
375 }
376
377+/* Called before loading an as-needed library to take a snapshot of
378+ the cref hash table, and after we have loaded or found that the
379+ library was not needed. */
380+
381+bfd_boolean
382+handle_asneeded_cref (bfd *abfd ATTRIBUTE_UNUSED,
383+ enum notice_asneeded_action act)
384+{
385+ unsigned int i;
386+
387+ if (!cref_initialized)
388+ return TRUE;
389+
390+ if (act == notice_as_needed)
391+ {
392+ char *old_ent, *old_ref;
393+
394+ for (i = 0; i < cref_table.root.size; i++)
395+ {
396+ struct bfd_hash_entry *p;
397+ struct cref_hash_entry *c;
398+ struct cref_ref *r;
399+
400+ for (p = cref_table.root.table[i]; p != NULL; p = p->next)
401+ {
402+ entsize += cref_table.root.entsize;
403+ c = (struct cref_hash_entry *) p;
404+ for (r = c->refs; r != NULL; r = r->next)
405+ refsize += sizeof (struct cref_hash_entry);
406+ }
407+ }
408+
409+ tabsize = cref_table.root.size * sizeof (struct bfd_hash_entry *);
410+ old_tab = xmalloc (tabsize + entsize + refsize);
411+
412+ alloc_mark = bfd_hash_allocate (&cref_table.root, 1);
413+ if (alloc_mark == NULL)
414+ return FALSE;
415+
416+ memcpy (old_tab, cref_table.root.table, tabsize);
417+ old_ent = (char *) old_tab + tabsize;
418+ old_ref = (char *) old_ent + entsize;
419+ old_table = cref_table.root.table;
420+ old_size = cref_table.root.size;
421+ old_symcount = cref_symcount;
422+
423+ for (i = 0; i < cref_table.root.size; i++)
424+ {
425+ struct bfd_hash_entry *p;
426+ struct cref_hash_entry *c;
427+ struct cref_ref *r;
428+
429+ for (p = cref_table.root.table[i]; p != NULL; p = p->next)
430+ {
431+ memcpy (old_ent, p, cref_table.root.entsize);
432+ old_ent = (char *) old_ent + cref_table.root.entsize;
433+ c = (struct cref_hash_entry *) p;
434+ for (r = c->refs; r != NULL; r = r->next)
435+ {
436+ memcpy (old_ref, r, sizeof (struct cref_hash_entry));
437+ old_ref = (char *) old_ref + sizeof (struct cref_hash_entry);
438+ }
439+ }
440+ }
441+ return TRUE;
442+ }
443+
444+ if (act == notice_not_needed)
445+ {
446+ char *old_ent, *old_ref;
447+
448+ if (old_tab == NULL)
449+ {
450+ /* The only way old_tab can be NULL is if the cref hash table
451+ had not been initialised when notice_as_needed. */
452+ bfd_hash_table_free (&cref_table.root);
453+ cref_initialized = FALSE;
454+ return TRUE;
455+ }
456+
457+ old_ent = (char *) old_tab + tabsize;
458+ old_ref = (char *) old_ent + entsize;
459+ cref_table.root.table = old_table;
460+ cref_table.root.size = old_size;
461+ memcpy (cref_table.root.table, old_tab, tabsize);
462+ cref_symcount = old_symcount;
463+
464+ for (i = 0; i < cref_table.root.size; i++)
465+ {
466+ struct bfd_hash_entry *p;
467+ struct cref_hash_entry *c;
468+ struct cref_ref *r;
469+
470+ for (p = cref_table.root.table[i]; p != NULL; p = p->next)
471+ {
472+ memcpy (p, old_ent, cref_table.root.entsize);
473+ old_ent = (char *) old_ent + cref_table.root.entsize;
474+ c = (struct cref_hash_entry *) p;
475+ for (r = c->refs; r != NULL; r = r->next)
476+ {
477+ memcpy (r, old_ref, sizeof (struct cref_hash_entry));
478+ old_ref = (char *) old_ref + sizeof (struct cref_hash_entry);
479+ }
480+ }
481+ }
482+
483+ objalloc_free_block ((struct objalloc *) cref_table.root.memory,
484+ alloc_mark);
485+ }
486+ else if (act != notice_needed)
487+ return FALSE;
488+
489+ free (old_tab);
490+ old_tab = NULL;
491+ return TRUE;
492+}
493+
494 /* Copy the addresses of the hash table entries into an array. This
495 is called via cref_hash_traverse. We also fill in the demangled
496 name. */
[e86bfc4]497diff -Naur binutils-2.17.orig/ld/ld.h binutils-2.17/ld/ld.h
498--- binutils-2.17.orig/ld/ld.h 2005-09-30 04:42:04.000000000 -0700
499+++ binutils-2.17/ld/ld.h 2006-07-18 19:37:05.000000000 -0700
[16ca464]500@@ -1,6 +1,6 @@
501 /* ld.h -- general linker header file
502 Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
503- 2001, 2002, 2003, 2004, 2005
504+ 2001, 2002, 2003, 2004, 2005, 2006
505 Free Software Foundation, Inc.
506
507 This file is part of GLD, the Gnu Linker.
508@@ -282,6 +282,7 @@
509
510 extern int yyparse (void);
511 extern void add_cref (const char *, bfd *, asection *, bfd_vma);
512+extern bfd_boolean handle_asneeded_cref (bfd *, enum notice_asneeded_action);
513 extern void output_cref (FILE *);
514 extern void check_nocrossrefs (void);
515 extern void ld_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
[e86bfc4]516diff -Naur binutils-2.17.orig/ld/ldlang.c binutils-2.17/ld/ldlang.c
517--- binutils-2.17.orig/ld/ldlang.c 2006-06-12 06:05:04.000000000 -0700
518+++ binutils-2.17/ld/ldlang.c 2006-07-04 06:29:24.000000000 -0700
[16ca464]519@@ -4207,7 +4207,8 @@
520 /* If a loadable section is using the default memory
521 region, and some non default memory regions were
522 defined, issue an error message. */
523- if (!IGNORE_SECTION (os->bfd_section)
524+ if (!os->ignored
525+ && !IGNORE_SECTION (os->bfd_section)
526 && ! link_info.relocatable
527 && check_regions
528 && strcmp (os->region->name,
[e86bfc4]529diff -Naur binutils-2.17.orig/ld/ldmain.c binutils-2.17/ld/ldmain.c
530--- binutils-2.17.orig/ld/ldmain.c 2006-04-06 11:52:45.000000000 -0700
531+++ binutils-2.17/ld/ldmain.c 2006-07-18 19:37:05.000000000 -0700
[16ca464]532@@ -1511,6 +1511,13 @@
533 asection *section,
534 bfd_vma value)
535 {
536+ if (name == NULL)
537+ {
538+ if (command_line.cref || nocrossref_list != NULL)
539+ return handle_asneeded_cref (abfd, value);
540+ return TRUE;
541+ }
542+
543 if (! info->notice_all
544 || (info->notice_hash != NULL
545 && bfd_hash_lookup (info->notice_hash, name, FALSE, FALSE) != NULL))
[e86bfc4]546diff -Naur binutils-2.17.orig/ld/testsuite/ChangeLog binutils-2.17/ld/testsuite/ChangeLog
547--- binutils-2.17.orig/ld/testsuite/ChangeLog 2006-06-12 06:44:33.000000000 -0700
548+++ binutils-2.17/ld/testsuite/ChangeLog 2006-07-12 05:55:21.000000000 -0700
[16ca464]549@@ -1,3 +1,17 @@
550+2006-07-12 Richard Sandiford <richard@codesourcery.com>
551+
552+ * ld-m68k/merge-ok-1c.d: New test.
553+ * ld-m68k/m68k.exp: Run it.
554+
555+2006-07-04 Daniel Jacobowitz <dan@codesourcery.com>
556+
557+ Backport:
558+ 2006-05-19 Alan Modra <amodra@bigpond.net.au>
559+ * ld-scripts/empty-orphan.d: Update again.
560+
561+ * ld-scripts/empty-orphan.t: Discard .reginfo.
562+ * ld-scripts/empty-orphan.d: Update.
563+
564 2006-06-12 Daniel Jacobowitz <dan@codesourcery.com>
565
566 Backport:
[e86bfc4]567diff -Naur binutils-2.17.orig/ld/testsuite/ld-m68k/m68k.exp binutils-2.17/ld/testsuite/ld-m68k/m68k.exp
568--- binutils-2.17.orig/ld/testsuite/ld-m68k/m68k.exp 2006-03-25 02:24:27.000000000 -0800
569+++ binutils-2.17/ld/testsuite/ld-m68k/m68k.exp 2006-07-12 05:55:21.000000000 -0700
[16ca464]570@@ -53,3 +53,4 @@
571 run_dump_test "merge-error-1e"
572 run_dump_test "merge-ok-1a"
573 run_dump_test "merge-ok-1b"
574+run_dump_test "merge-ok-1c"
[e86bfc4]575diff -Naur binutils-2.17.orig/ld/testsuite/ld-m68k/merge-ok-1c.d binutils-2.17/ld/testsuite/ld-m68k/merge-ok-1c.d
576--- binutils-2.17.orig/ld/testsuite/ld-m68k/merge-ok-1c.d 1969-12-31 16:00:00.000000000 -0800
577+++ binutils-2.17/ld/testsuite/ld-m68k/merge-ok-1c.d 2006-07-12 05:55:21.000000000 -0700
[16ca464]578@@ -0,0 +1,6 @@
579+#source: merge-error-1a.s -march=cpu32
580+#source: merge-error-1b.s -march=cpu32
581+#ld: -r
582+#objdump: -p
583+#...
584+private flags = 810000: \[cpu32\]
[e86bfc4]585diff -Naur binutils-2.17.orig/ld/testsuite/ld-scripts/empty-orphan.d binutils-2.17/ld/testsuite/ld-scripts/empty-orphan.d
586--- binutils-2.17.orig/ld/testsuite/ld-scripts/empty-orphan.d 2005-03-17 08:20:39.000000000 -0800
587+++ binutils-2.17/ld/testsuite/ld-scripts/empty-orphan.d 2006-07-04 06:29:24.000000000 -0700
[16ca464]588@@ -1,3 +1,6 @@
589 #source: empty-orphan.s
590 #ld: -T empty-orphan.t
591-#error: no memory region specified for loadable section
592+#readelf: -l --wide
593+#...
594+ +LOAD +[x0-9a-f]+ [x0]+70000000 [x0]+70000000 [x0]+(2|4|8|10|20|40|80) .*
595+#pass
[e86bfc4]596diff -Naur binutils-2.17.orig/ld/testsuite/ld-scripts/empty-orphan.t binutils-2.17/ld/testsuite/ld-scripts/empty-orphan.t
597--- binutils-2.17.orig/ld/testsuite/ld-scripts/empty-orphan.t 2005-03-17 08:20:39.000000000 -0800
598+++ binutils-2.17/ld/testsuite/ld-scripts/empty-orphan.t 2006-07-04 06:29:24.000000000 -0700
[16ca464]599@@ -17,5 +17,6 @@
600 .text : { *(.text) } > text_mem : text_phdr
601 .data : { *(.data) } > data_mem : data_phdr
602 .bss : { *(.bss) } > data_mem : data_phdr
603+ /DISCARD/ : { *(.reginfo) }
604 /* .orphan_data is an orphan */
605 }
Note: See TracBrowser for help on using the repository browser.