summaryrefslogtreecommitdiff
path: root/tools/4.11/binutils/binutils-2.22-rtems4.11-20120427.diff
blob: 13311460f3b156a05560ab77f808bead19f338af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
diff -Naur binutils-2.22.orig/bfd/ChangeLog binutils-2.22/bfd/ChangeLog
--- binutils-2.22.orig/bfd/ChangeLog	2011-11-21 12:55:49.000000000 +0100
+++ binutils-2.22/bfd/ChangeLog	2012-04-27 06:43:05.275941484 +0200
@@ -1,3 +1,14 @@
+2012-04-27  Ralf Corsépius  <ralf.corsepius@rtems.org>
+
+	Backport from mainline:
+
+	2012-04-24  Alan Modra  <amodra@gmail.com>
+	PR ld/13991
+	* bfd/elf-bfd.h (_bfd_elf_link_just_syms): Define as
+	_bfd_generic_link_just_syms.
+	* bfd/elflink.c (_bfd_elf_link_just_syms): Delete.
+	* bfd/linker.c (_bfd_generic_link_just_syms): Set sec_info_type.
+
 2011-11-21  Tristan Gingold  <gingold@adacore.com>
 
 	* configure.in: Bump version to 2.22
diff -Naur binutils-2.22.orig/bfd/elf-bfd.h binutils-2.22/bfd/elf-bfd.h
--- binutils-2.22.orig/bfd/elf-bfd.h	2011-08-17 02:39:38.000000000 +0200
+++ binutils-2.22/bfd/elf-bfd.h	2012-04-27 06:43:05.275941484 +0200
@@ -1807,8 +1807,7 @@
   (bfd *, asection *, void *);
 extern asection *_bfd_elf_check_kept_section
   (asection *, struct bfd_link_info *);
-extern void _bfd_elf_link_just_syms
-  (asection *, struct bfd_link_info *);
+#define _bfd_elf_link_just_syms _bfd_generic_link_just_syms
 extern void _bfd_elf_copy_link_hash_symbol_type
   (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *);
 extern bfd_boolean _bfd_elf_size_group_sections
diff -Naur binutils-2.22.orig/bfd/elflink.c binutils-2.22/bfd/elflink.c
--- binutils-2.22.orig/bfd/elflink.c	2011-11-21 10:29:26.000000000 +0100
+++ binutils-2.22/bfd/elflink.c	2012-04-27 06:43:05.285941042 +0200
@@ -1,6 +1,6 @@
 /* ELF linking support for BFD.
    Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-   2005, 2006, 2007, 2008, 2009, 2010, 2011
+   2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
    Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -6644,17 +6644,6 @@
   return TRUE;
 }
 
-/* Indicate that we are only retrieving symbol values from this
-   section.  */
-
-void
-_bfd_elf_link_just_syms (asection *sec, struct bfd_link_info *info)
-{
-  if (is_elf_hash_table (info->hash))
-    sec->sec_info_type = ELF_INFO_TYPE_JUST_SYMS;
-  _bfd_generic_link_just_syms (sec, info);
-}
-
 /* Make sure sec_info_type is cleared if sec_info is cleared too.  */
 
 static void
diff -Naur binutils-2.22.orig/bfd/linker.c binutils-2.22/bfd/linker.c
--- binutils-2.22.orig/bfd/linker.c	2011-09-16 03:15:19.000000000 +0200
+++ binutils-2.22/bfd/linker.c	2012-04-27 06:43:05.287940980 +0200
@@ -1,6 +1,6 @@
 /* linker.c -- BFD linker routines
    Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-   2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+   2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
    Free Software Foundation, Inc.
    Written by Steve Chamberlain and Ian Lance Taylor, Cygnus Support
 
@@ -810,6 +810,7 @@
 _bfd_generic_link_just_syms (asection *sec,
 			     struct bfd_link_info *info ATTRIBUTE_UNUSED)
 {
+  sec->sec_info_type = ELF_INFO_TYPE_JUST_SYMS;
   sec->output_section = bfd_abs_section_ptr;
   sec->output_offset = sec->vma;
 }
diff -Naur binutils-2.22.orig/binutils/ar.c binutils-2.22/binutils/ar.c
--- binutils-2.22.orig/binutils/ar.c	2011-11-21 10:29:28.000000000 +0100
+++ binutils-2.22/binutils/ar.c	2012-04-27 06:43:05.288940951 +0200
@@ -37,7 +37,6 @@
 #include "filenames.h"
 #include "binemul.h"
 #include "plugin.h"
-#include <sys/stat.h>
 
 #ifdef __GO32___
 #define EXT_NAME_LEN 3		/* Bufflen of addition to name if it's MS-DOS.  */
diff -Naur binutils-2.22.orig/binutils/bucomm.c binutils-2.22/binutils/bucomm.c
--- binutils-2.22.orig/binutils/bucomm.c	2011-03-25 18:51:10.000000000 +0100
+++ binutils-2.22/binutils/bucomm.c	2012-04-27 06:43:05.289940923 +0200
@@ -1,6 +1,6 @@
 /* bucomm.c -- Bin Utils COMmon code.
    Copyright 1991, 1992, 1993, 1994, 1995, 1997, 1998, 2000, 2001, 2002,
-   2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+   2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
    Free Software Foundation, Inc.
 
    This file is part of GNU Binutils.
@@ -29,7 +29,6 @@
 #include "filenames.h"
 #include "libbfd.h"
 
-#include <sys/stat.h>
 #include <time.h>		/* ctime, maybe time_t */
 #include <assert.h>
 #include "bucomm.h"
diff -Naur binutils-2.22.orig/binutils/budbg.h binutils-2.22/binutils/budbg.h
--- binutils-2.22.orig/binutils/budbg.h	2009-09-02 09:22:31.000000000 +0200
+++ binutils-2.22/binutils/budbg.h	2012-04-27 06:43:05.289940923 +0200
@@ -1,5 +1,5 @@
 /* budbg.c -- Interfaces to the generic debugging information routines.
-   Copyright 1995, 1996, 2002, 2003, 2005, 2007, 2008
+   Copyright 1995, 1996, 2002, 2003, 2005, 2007, 2008, 2012
    Free Software Foundation, Inc.
    Written by Ian Lance Taylor <ian@cygnus.com>.
 
@@ -23,8 +23,6 @@
 #ifndef BUDBG_H
 #define BUDBG_H
 
-#include <stdio.h>
-
 /* Routine used to read generic debugging information.  */
 
 extern void *read_debugging_info (bfd *, asymbol **, long, bfd_boolean);
diff -Naur binutils-2.22.orig/binutils/ChangeLog binutils-2.22/binutils/ChangeLog
--- binutils-2.22.orig/binutils/ChangeLog	2011-11-21 10:29:28.000000000 +0100
+++ binutils-2.22/binutils/ChangeLog	2012-04-27 06:43:05.287940980 +0200
@@ -1,3 +1,25 @@
+2012-02-09  Alan Modra  <amodra@gmail.com>
+
+	* sysdep.h: Include sys/stat.h here.
+	* ar.c: Don't include headers already included by sysdep.h.
+	* bucomm.c: Likewise.
+	* budbg.h: Likewise.
+	* dlltool.h: Likewise.
+	* elfedit.c: Likewise.
+	* nlmconv.c: Likewise.
+	* objcopy.c: Likewise.
+	* objdump.c: Likewise.
+	* objdump.h: Likewise.
+	* readelf.c: Likewise.
+	* rename.c: Likewise.
+	* resrc.c: Likewise.
+	* strings.c: Likewise.
+	* windres.c: Likewise.
+	* od-xcoff.c: Likewise.
+	* dllwrap.c: Remove alloca pragma handled by sysdep.h, and
+	remove duplicate headers.
+	* dlltool.c: Likewise and ensure #include sysdep.h is first.
+
 2011-10-25  Alan Modra  <amodra@gmail.com>
 
 	Apply mainline patches
diff -Naur binutils-2.22.orig/binutils/dlltool.c binutils-2.22/binutils/dlltool.c
--- binutils-2.22.orig/binutils/dlltool.c	2010-12-01 15:15:06.000000000 +0100
+++ binutils-2.22/binutils/dlltool.c	2012-04-27 06:43:05.290940897 +0200
@@ -1,6 +1,6 @@
 /* dlltool.c -- tool to generate stuff for PE style DLLs
    Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-   2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+   2005, 2006, 2007, 2008, 2009, 2011, 2012 Free Software Foundation, Inc.
 
    This file is part of GNU Binutils.
 
@@ -232,15 +232,6 @@
 
    .idata$7 = dll name (eg: "kernel32.dll"). (.idata$6 for ppc).  */
 
-/* AIX requires this to be the first thing in the file.  */
-#ifndef __GNUC__
-# ifdef _AIX
- #pragma alloca
-#endif
-#endif
-
-#define show_allnames 0
-
 #include "sysdep.h"
 #include "bfd.h"
 #include "libiberty.h"
@@ -252,8 +243,6 @@
 #include "safe-ctype.h"
 
 #include <time.h>
-#include <sys/stat.h>
-#include <stdarg.h>
 #include <assert.h>
 
 #ifdef DLLTOOL_ARM
@@ -319,6 +308,8 @@
 #endif /* defined (_WIN32) && ! defined (__CYGWIN32__) */
 #endif /* ! HAVE_SYS_WAIT_H */
 
+#define show_allnames 0
+
 /* ifunc and ihead data structures: ttk@cygnus.com 1997
 
    When IMPORT declarations are encountered in a .def file the
diff -Naur binutils-2.22.orig/binutils/dlltool.h binutils-2.22/binutils/dlltool.h
--- binutils-2.22.orig/binutils/dlltool.h	2009-10-23 16:53:56.000000000 +0200
+++ binutils-2.22/binutils/dlltool.h	2012-04-27 06:43:05.291940872 +0200
@@ -1,5 +1,6 @@
 /* dlltool.h -- header file for dlltool
-   Copyright 1997, 1998, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+   Copyright 1997, 1998, 2003, 2004, 2005, 2007, 2009, 2012
+   Free Software Foundation, Inc.
 
    This file is part of GNU Binutils.
 
@@ -18,9 +19,6 @@
    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
    02110-1301, USA.  */
 
-#include "ansidecl.h"
-#include <stdio.h>
-
 extern void def_code (int);
 extern void def_data (int);
 extern void def_description (const char *);
diff -Naur binutils-2.22.orig/binutils/dllwrap.c binutils-2.22/binutils/dllwrap.c
--- binutils-2.22.orig/binutils/dllwrap.c	2010-07-15 09:58:47.000000000 +0200
+++ binutils-2.22/binutils/dllwrap.c	2012-04-27 06:43:05.291940872 +0200
@@ -1,6 +1,6 @@
 /* dllwrap.c -- wrapper for DLLTOOL and GCC to generate PE style DLLs
-   Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2009
-   Free Software Foundation, Inc.
+   Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2009,
+   2011, 2012 Free Software Foundation, Inc.
    Contributed by Mumit Khan (khan@xraylith.wisc.edu).
 
    This file is part of GNU Binutils.
@@ -20,13 +20,6 @@
    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
    02110-1301, USA.  */
 
-/* AIX requires this to be the first thing in the file.  */
-#ifndef __GNUC__
-# ifdef _AIX
- #pragma alloca
-#endif
-#endif
-
 #include "sysdep.h"
 #include "bfd.h"
 #include "libiberty.h"
@@ -35,7 +28,6 @@
 #include "bucomm.h"
 
 #include <time.h>
-#include <sys/stat.h>
 
 #ifdef HAVE_SYS_WAIT_H
 #include <sys/wait.h>
diff -Naur binutils-2.22.orig/binutils/elfedit.c binutils-2.22/binutils/elfedit.c
--- binutils-2.22.orig/binutils/elfedit.c	2011-07-22 22:22:34.000000000 +0200
+++ binutils-2.22/binutils/elfedit.c	2012-04-27 06:43:05.292940848 +0200
@@ -1,5 +1,5 @@
 /* elfedit.c -- Update the ELF header of an ELF format file
-   Copyright 2010
+   Copyright 2010, 2011, 2012
    Free Software Foundation, Inc.
 
    This file is part of GNU Binutils.
@@ -19,10 +19,8 @@
    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
    02110-1301, USA.  */
 
-#include "config.h"
 #include "sysdep.h"
 #include <assert.h>
-#include <sys/stat.h>
 
 #if __GNUC__ >= 2
 /* Define BFD64 here, even if our default architecture is 32 bit ELF
diff -Naur binutils-2.22.orig/binutils/nlmconv.c binutils-2.22/binutils/nlmconv.c
--- binutils-2.22.orig/binutils/nlmconv.c	2011-02-28 19:32:51.000000000 +0100
+++ binutils-2.22/binutils/nlmconv.c	2012-04-27 06:43:05.293940825 +0200
@@ -1,6 +1,7 @@
 /* nlmconv.c -- NLM conversion program
    Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-   2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+   2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012
+   Free Software Foundation, Inc.
 
    This file is part of GNU Binutils.
 
@@ -42,8 +43,6 @@
 
 #include "ansidecl.h"
 #include <time.h>
-#include <sys/stat.h>
-#include <sys/file.h>
 #include <assert.h>
 #include "getopt.h"
 
diff -Naur binutils-2.22.orig/binutils/objcopy.c binutils-2.22/binutils/objcopy.c
--- binutils-2.22.orig/binutils/objcopy.c	2011-09-16 06:23:17.000000000 +0200
+++ binutils-2.22/binutils/objcopy.c	2012-04-27 06:43:05.294940804 +0200
@@ -1,6 +1,6 @@
 /* objcopy.c -- copy object file from input to output, optionally massaging it.
    Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
    Free Software Foundation, Inc.
 
    This file is part of GNU Binutils.
@@ -30,7 +30,6 @@
 #include "filenames.h"
 #include "fnmatch.h"
 #include "elf-bfd.h"
-#include <sys/stat.h>
 #include "libbfd.h"
 #include "coff/internal.h"
 #include "libcoff.h"
diff -Naur binutils-2.22.orig/binutils/objdump.c binutils-2.22/binutils/objdump.c
--- binutils-2.22.orig/binutils/objdump.c	2011-05-16 14:22:12.000000000 +0200
+++ binutils-2.22/binutils/objdump.c	2012-04-27 06:43:05.295940784 +0200
@@ -1,7 +1,7 @@
 /* objdump.c -- dump information about an object file.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
-   Free Software Foundation, Inc.
+   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
+   2012 Free Software Foundation, Inc.
 
    This file is part of GNU Binutils.
 
@@ -71,8 +71,6 @@
 #include <sys/mman.h>
 #endif
 
-#include <sys/stat.h>
-
 /* Internal headers for the ELF .stab-dump code - sorry.  */
 #define	BYTES_IN_WORD	32
 #include "aout/aout64.h"
diff -Naur binutils-2.22.orig/binutils/objdump.h binutils-2.22/binutils/objdump.h
--- binutils-2.22.orig/binutils/objdump.h	2011-05-16 14:22:12.000000000 +0200
+++ binutils-2.22/binutils/objdump.h	2012-04-27 06:43:05.296940765 +0200
@@ -1,5 +1,5 @@
 /* objdump.h
-   Copyright 2011 Free Software Foundation, Inc.
+   Copyright 2011, 2012 Free Software Foundation, Inc.
 
    This file is part of GNU Binutils.
 
@@ -18,8 +18,6 @@
    Foundation, 51 Franklin Street - Fifth Floor, Boston,
    MA 02110-1301, USA.  */
 
-#include <stdio.h>
-
 struct objdump_private_option
 {
   /* Option name.  */
diff -Naur binutils-2.22.orig/binutils/od-xcoff.c binutils-2.22/binutils/od-xcoff.c
--- binutils-2.22.orig/binutils/od-xcoff.c	2011-06-09 17:29:05.000000000 +0200
+++ binutils-2.22/binutils/od-xcoff.c	2012-04-27 06:43:05.297940754 +0200
@@ -1,5 +1,5 @@
 /* od-xcoff.c -- dump information about an xcoff object file.
-   Copyright 2011 Free Software Foundation, Inc.
+   Copyright 2011, 2012 Free Software Foundation, Inc.
    Written by Tristan Gingold, Adacore.
 
    This file is part of GNU Binutils.
@@ -19,9 +19,9 @@
    Foundation, 51 Franklin Street - Fifth Floor, Boston,
    MA 02110-1301, USA.  */
 
+#include "sysdep.h"
 #include <stddef.h>
 #include <time.h>
-#include "sysdep.h"
 #include "safe-ctype.h"
 #include "bfd.h"
 #include "objdump.h"
diff -Naur binutils-2.22.orig/binutils/readelf.c binutils-2.22/binutils/readelf.c
--- binutils-2.22.orig/binutils/readelf.c	2011-09-21 22:49:13.000000000 +0200
+++ binutils-2.22/binutils/readelf.c	2012-04-27 06:43:05.301940592 +0200
@@ -42,10 +42,8 @@
   ELF file than is provided by objdump.  In particular it can display DWARF
   debugging information which (at the moment) objdump cannot.  */
 
-#include "config.h"
 #include "sysdep.h"
 #include <assert.h>
-#include <sys/stat.h>
 #include <time.h>
 #ifdef HAVE_ZLIB_H
 #include <zlib.h>
diff -Naur binutils-2.22.orig/binutils/rename.c binutils-2.22/binutils/rename.c
--- binutils-2.22.orig/binutils/rename.c	2009-09-02 09:22:32.000000000 +0200
+++ binutils-2.22/binutils/rename.c	2012-04-27 06:43:05.302940554 +0200
@@ -22,8 +22,6 @@
 #include "bfd.h"
 #include "bucomm.h"
 
-#include <sys/stat.h>
-
 #ifdef HAVE_GOOD_UTIME_H
 #include <utime.h>
 #else /* ! HAVE_GOOD_UTIME_H */
diff -Naur binutils-2.22.orig/binutils/resrc.c binutils-2.22/binutils/resrc.c
--- binutils-2.22.orig/binutils/resrc.c	2010-11-17 04:35:50.000000000 +0100
+++ binutils-2.22/binutils/resrc.c	2012-04-27 06:43:05.303940522 +0200
@@ -32,11 +32,6 @@
 #include "windres.h"
 
 #include <assert.h>
-#include <errno.h>
-#include <sys/stat.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
 
 #ifdef HAVE_SYS_WAIT_H
 #include <sys/wait.h>
diff -Naur binutils-2.22.orig/binutils/strings.c binutils-2.22/binutils/strings.c
--- binutils-2.22.orig/binutils/strings.c	2011-03-25 18:09:08.000000000 +0100
+++ binutils-2.22/binutils/strings.c	2012-04-27 06:43:05.303940522 +0200
@@ -1,6 +1,6 @@
 /* strings -- print the strings of printable characters in files
    Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-   2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011
+   2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012
    Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
@@ -65,7 +65,6 @@
 #include "getopt.h"
 #include "libiberty.h"
 #include "safe-ctype.h"
-#include <sys/stat.h>
 #include "bucomm.h"
 
 #define STRING_ISGRAPHIC(c) \
diff -Naur binutils-2.22.orig/binutils/sysdep.h binutils-2.22/binutils/sysdep.h
--- binutils-2.22.orig/binutils/sysdep.h	2009-03-18 12:27:17.000000000 +0100
+++ binutils-2.22/binutils/sysdep.h	2012-04-27 06:43:05.304940492 +0200
@@ -1,6 +1,6 @@
 /* sysdep.h -- handle host dependencies for binutils
    Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-   2001, 2002, 2003, 2005, 2006, 2007, 2008, 2009
+   2001, 2002, 2003, 2005, 2006, 2007, 2008, 2009, 2012
    Free Software Foundation, Inc.
 
    This file is part of GNU Binutils.
@@ -69,6 +69,10 @@
 #endif
 #endif
 
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
 #include "binary-io.h"
 
 #if !HAVE_DECL_STPCPY
diff -Naur binutils-2.22.orig/binutils/windres.c binutils-2.22/binutils/windres.c
--- binutils-2.22.orig/binutils/windres.c	2011-06-02 15:43:18.000000000 +0200
+++ binutils-2.22/binutils/windres.c	2012-04-27 06:43:05.304940492 +0200
@@ -1,6 +1,6 @@
 /* windres.c -- a program to manipulate Windows resources
    Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008,
-   2009, 2011 Free Software Foundation, Inc.
+   2009, 2011, 2012 Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Cygnus Support.
    Rewritten by Kai Tietz, Onevision.
 
@@ -45,7 +45,6 @@
 #include "safe-ctype.h"
 #include "obstack.h"
 #include "windres.h"
-#include <sys/stat.h>
 
 /* Used by resrc.c at least.  */
 
diff -Naur binutils-2.22.orig/gas/testsuite/ChangeLog binutils-2.22/gas/testsuite/ChangeLog
--- binutils-2.22.orig/gas/testsuite/ChangeLog	2011-11-21 10:29:32.000000000 +0100
+++ binutils-2.22/gas/testsuite/ChangeLog	2012-04-27 06:43:05.305940465 +0200
@@ -8,6 +8,12 @@
 	* gas/mips/relax-swap3.s: New test source.
 	* gas/mips/mips.exp: Run the new tests.
 
+2011-10-24  Julian Brown  <julian@codesourcery.com>
+
+	* gas/m68k/all.exp (movem-offset): Add test.
+	* gas/m68k/movem-offset.s: New test.
+	* gas/m68k/movem-offset.d: New.
+
 2011-10-25  Alan Modra  <amodra@gmail.com>
 
 	Apply mainline patches
diff -Naur binutils-2.22.orig/gas/testsuite/gas/m68k/all.exp binutils-2.22/gas/testsuite/gas/m68k/all.exp
--- binutils-2.22.orig/gas/testsuite/gas/m68k/all.exp	2011-09-07 22:56:09.000000000 +0200
+++ binutils-2.22/gas/testsuite/gas/m68k/all.exp	2012-04-27 06:43:05.305940465 +0200
@@ -52,6 +52,8 @@
     run_dump_test mcf-movsr
     run_dump_test mode5
     run_dump_test mode5 "{name {cf}} {as {-mcpu=5200}}"
+    run_dump_test movem-offset
+    run_dump_test movem-offset "{name {cf}} {as {-mcpu=5485}}"
     run_dump_test mcf-mac
     run_dump_test mcf-emac
     run_dump_test mcf-coproc
diff -Naur binutils-2.22.orig/gas/testsuite/gas/m68k/movem-offset.d binutils-2.22/gas/testsuite/gas/m68k/movem-offset.d
--- binutils-2.22.orig/gas/testsuite/gas/m68k/movem-offset.d	1970-01-01 01:00:00.000000000 +0100
+++ binutils-2.22/gas/testsuite/gas/m68k/movem-offset.d	2012-04-27 06:43:05.306940440 +0200
@@ -0,0 +1,14 @@
+#name: movem-offset
+#objdump: -d
+#as: 
+
+.*:     file format .*
+
+Disassembly of section \.text:
+
+0+ <.text>:
+   0:	4cee 047c ffe8 	moveml %fp@\(-24\),%d2-%d6/%a2
+   6:	48ee 047c 0010 	moveml %d2-%d6/%a2,%fp@\(16\)
+   c:	4cee 03ff ffe8 	moveml %fp@\(-24\),%d0-%a1
+  12:	48ee 03ff 0010 	moveml %d0-%a1,%fp@\(16\)
+	\.\.\.
diff -Naur binutils-2.22.orig/gas/testsuite/gas/m68k/movem-offset.s binutils-2.22/gas/testsuite/gas/m68k/movem-offset.s
--- binutils-2.22.orig/gas/testsuite/gas/m68k/movem-offset.s	1970-01-01 01:00:00.000000000 +0100
+++ binutils-2.22/gas/testsuite/gas/m68k/movem-offset.s	2012-04-27 06:43:05.306940440 +0200
@@ -0,0 +1,8 @@
+
+	| Check that non-zero displacements work for movem.
+	.text
+	movem.l -24(%a6),#1148
+	movem.l #1148,16(%a6)
+	movem.l -24(%a6),%d0-%d7/%a0-%a1
+	movem.l %d0-%d7/%a0-%a1,16(%a6)
+	.p2align 4
diff -Naur binutils-2.22.orig/opcodes/ChangeLog binutils-2.22/opcodes/ChangeLog
--- binutils-2.22.orig/opcodes/ChangeLog	2011-11-21 10:29:39.000000000 +0100
+++ binutils-2.22/opcodes/ChangeLog	2012-04-27 06:43:05.306940440 +0200
@@ -1,3 +1,7 @@
+2011-10-24  Julian Brown  <julian@codesourcery.com>
+
+	* m68k-opc.c (m68k_opcodes): Fix entries for ColdFire moveml.
+
 2011-10-27  Peter Bergner  <bergner@vnet.ibm.com>
 
 	* ppc-opc.c (powerpc_opcodes) <drrndq, drrndq., dtstexq, dctqpq,
diff -Naur binutils-2.22.orig/opcodes/m68k-opc.c binutils-2.22/opcodes/m68k-opc.c
--- binutils-2.22.orig/opcodes/m68k-opc.c	2011-09-07 22:56:09.000000000 +0200
+++ binutils-2.22/opcodes/m68k-opc.c	2012-04-27 06:43:05.307940418 +0200
@@ -1553,10 +1553,10 @@
 {"moveml", 4,	one(0044300),	one(0177700), "#w>s", m68000up },
 {"moveml", 4,	one(0046300),	one(0177700), "<sLw", m68000up },
 {"moveml", 4,	one(0046300),	one(0177700), "<s#w", m68000up },
-{"moveml", 4,	one(0044320),	one(0177770), "Lwys", mcfisa_a },
-{"moveml", 4,	one(0044320),	one(0177770), "#wys", mcfisa_a },
-{"moveml", 4,	one(0046320),	one(0177770), "ysLw", mcfisa_a },
-{"moveml", 4,	one(0046320),	one(0177770), "ys#w", mcfisa_a },
+{"moveml", 4,	one(0044300),	one(0177700), "Lwys", mcfisa_a },
+{"moveml", 4,	one(0044300),	one(0177700), "#wys", mcfisa_a },
+{"moveml", 4,	one(0046300),	one(0177700), "ysLw", mcfisa_a },
+{"moveml", 4,	one(0046300),	one(0177700), "ys#w", mcfisa_a },
 
 {"movepw", 2,	one(0000410),	one(0170770), "dsDd", m68000up },
 {"movepw", 2,	one(0000610),	one(0170770), "Ddds", m68000up },