cornucopia: bump SRCREV
[openembedded.git] / recipes / binutils / binutils-2.20.1 / binutils-nios2.patch
blob83603db6ad8a0798b8bfa0a2c198a04d86526dbe
1 Only in .: .pc
2 Index: binutils-2.20.1/bfd/Makefile.am
3 ===================================================================
4 --- binutils-2.20.1.orig/bfd/Makefile.am
5 +++ binutils-2.20.1/bfd/Makefile.am
6 @@ -112,6 +112,7 @@ ALL_MACHINES = \
7 cpu-moxie.lo \
8 cpu-msp430.lo \
9 cpu-mt.lo \
10 + cpu-nios2.lo \
11 cpu-ns32k.lo \
12 cpu-openrisc.lo \
13 cpu-or32.lo \
14 @@ -183,6 +184,7 @@ ALL_MACHINES_CFILES = \
15 cpu-moxie.c \
16 cpu-msp430.c \
17 cpu-mt.c \
18 + cpu-nios2.c \
19 cpu-ns32k.c \
20 cpu-openrisc.c \
21 cpu-or32.c \
22 @@ -303,6 +305,7 @@ BFD32_BACKENDS = \
23 elf32-moxie.lo \
24 elf32-msp430.lo \
25 elf32-mt.lo \
26 + elf32-nios2.lo \
27 elf32-openrisc.lo \
28 elf32-or32.lo \
29 elf32-pj.lo \
30 @@ -486,6 +489,7 @@ BFD32_BACKENDS_CFILES = \
31 elf32-moxie.c \
32 elf32-msp430.c \
33 elf32-mt.c \
34 + elf32-nios2.c \
35 elf32-openrisc.c \
36 elf32-or32.c \
37 elf32-pj.c \
38 Index: binutils-2.20.1/bfd/Makefile.in
39 ===================================================================
40 --- binutils-2.20.1.orig/bfd/Makefile.in
41 +++ binutils-2.20.1/bfd/Makefile.in
42 @@ -407,6 +407,7 @@ ALL_MACHINES = \
43 cpu-moxie.lo \
44 cpu-msp430.lo \
45 cpu-mt.lo \
46 + cpu-nios2.lo \
47 cpu-ns32k.lo \
48 cpu-openrisc.lo \
49 cpu-or32.lo \
50 @@ -478,6 +479,7 @@ ALL_MACHINES_CFILES = \
51 cpu-moxie.c \
52 cpu-msp430.c \
53 cpu-mt.c \
54 + cpu-nios2.c \
55 cpu-ns32k.c \
56 cpu-openrisc.c \
57 cpu-or32.c \
58 @@ -599,6 +601,7 @@ BFD32_BACKENDS = \
59 elf32-moxie.lo \
60 elf32-msp430.lo \
61 elf32-mt.lo \
62 + elf32-nios2.lo \
63 elf32-openrisc.lo \
64 elf32-or32.lo \
65 elf32-pj.lo \
66 @@ -782,6 +785,7 @@ BFD32_BACKENDS_CFILES = \
67 elf32-moxie.c \
68 elf32-msp430.c \
69 elf32-mt.c \
70 + elf32-nios2.c \
71 elf32-openrisc.c \
72 elf32-or32.c \
73 elf32-pj.c \
74 @@ -1263,6 +1267,7 @@ distclean-compile:
75 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-moxie.Plo@am__quote@
76 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-msp430.Plo@am__quote@
77 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-mt.Plo@am__quote@
78 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-nios2.Plo@am__quote@
79 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-ns32k.Plo@am__quote@
80 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-openrisc.Plo@am__quote@
81 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-or32.Plo@am__quote@
82 @@ -1341,6 +1346,7 @@ distclean-compile:
83 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-moxie.Plo@am__quote@
84 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-msp430.Plo@am__quote@
85 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-mt.Plo@am__quote@
86 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-nios2.Plo@am__quote@
87 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-openrisc.Plo@am__quote@
88 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-or32.Plo@am__quote@
89 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-pj.Plo@am__quote@
90 Index: binutils-2.20.1/bfd/archures.c
91 ===================================================================
92 --- binutils-2.20.1.orig/bfd/archures.c
93 +++ binutils-2.20.1/bfd/archures.c
94 @@ -423,6 +423,8 @@ DESCRIPTION
95 . bfd_arch_lm32, {* Lattice Mico32 *}
96 .#define bfd_mach_lm32 1
97 . bfd_arch_microblaze,{* Xilinx MicroBlaze. *}
98 +bfd_arch_nios2,
99 +#define bfd_mach_nios2 1
100 . bfd_arch_last
101 . };
103 @@ -504,6 +506,7 @@ extern const bfd_arch_info_type bfd_mn10
104 extern const bfd_arch_info_type bfd_moxie_arch;
105 extern const bfd_arch_info_type bfd_msp430_arch;
106 extern const bfd_arch_info_type bfd_mt_arch;
107 +extern const bfd_arch_info_type bfd_nios2_arch;
108 extern const bfd_arch_info_type bfd_ns32k_arch;
109 extern const bfd_arch_info_type bfd_openrisc_arch;
110 extern const bfd_arch_info_type bfd_or32_arch;
111 @@ -531,6 +534,7 @@ extern const bfd_arch_info_type bfd_xten
112 extern const bfd_arch_info_type bfd_xc16x_arch;
113 extern const bfd_arch_info_type bfd_z80_arch;
114 extern const bfd_arch_info_type bfd_z8k_arch;
115 +extern const bfd_arch_info_type bfd_nios2_arch;
117 static const bfd_arch_info_type * const bfd_archures_list[] =
119 @@ -580,6 +584,7 @@ static const bfd_arch_info_type * const
120 &bfd_moxie_arch,
121 &bfd_msp430_arch,
122 &bfd_mt_arch,
123 + &bfd_nios2_arch,
124 &bfd_ns32k_arch,
125 &bfd_openrisc_arch,
126 &bfd_or32_arch,
127 Index: binutils-2.20.1/bfd/bfd-in2.h
128 ===================================================================
129 --- binutils-2.20.1.orig/bfd/bfd-in2.h
130 +++ binutils-2.20.1/bfd/bfd-in2.h
131 @@ -2094,6 +2094,8 @@ enum bfd_architecture
132 #define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */
133 #define bfd_mach_z80full 7 /* All undocumented instructions. */
134 #define bfd_mach_r800 11 /* R800: successor with multiplication. */
135 + bfd_arch_nios2,
136 +#define bfd_mach_nios2 1
137 bfd_arch_lm32, /* Lattice Mico32 */
138 #define bfd_mach_lm32 1
139 bfd_arch_microblaze,/* Xilinx MicroBlaze. */
140 @@ -4422,6 +4424,42 @@ This is the 5 bits of a value. */
141 BFD_RELOC_IQ2000_OFFSET_21,
142 BFD_RELOC_IQ2000_UHI16,
144 +/* Relocations used by the Altera New Jersey core */
145 + BFD_RELOC_NIOS2_S16,
146 + BFD_RELOC_NIOS2_U16,
147 + BFD_RELOC_NIOS2_CALL26,
148 + BFD_RELOC_NIOS2_IMM5,
149 + BFD_RELOC_NIOS2_CACHE_OPX,
150 + BFD_RELOC_NIOS2_IMM6,
151 + BFD_RELOC_NIOS2_IMM8,
152 + BFD_RELOC_NIOS2_HI16,
153 + BFD_RELOC_NIOS2_LO16,
154 + BFD_RELOC_NIOS2_HIADJ16,
155 + BFD_RELOC_NIOS2_GPREL,
156 + BFD_RELOC_NIOS2_UJMP,
157 + BFD_RELOC_NIOS2_CJMP,
158 + BFD_RELOC_NIOS2_CALLR,
159 + BFD_RELOC_NIOS2_ALIGN,
160 + BFD_RELOC_NIOS2_GOT16,
161 + BFD_RELOC_NIOS2_CALL16,
162 + BFD_RELOC_NIOS2_GOTOFF_LO,
163 + BFD_RELOC_NIOS2_GOTOFF_HA,
164 + BFD_RELOC_NIOS2_PCREL_LO,
165 + BFD_RELOC_NIOS2_PCREL_HA,
166 + BFD_RELOC_NIOS2_TLS_GD16,
167 + BFD_RELOC_NIOS2_TLS_LDM16,
168 + BFD_RELOC_NIOS2_TLS_LDO16,
169 + BFD_RELOC_NIOS2_TLS_IE16,
170 + BFD_RELOC_NIOS2_TLS_LE16,
171 + BFD_RELOC_NIOS2_TLS_DTPMOD,
172 + BFD_RELOC_NIOS2_TLS_DTPREL,
173 + BFD_RELOC_NIOS2_TLS_TPREL,
174 + BFD_RELOC_NIOS2_COPY,
175 + BFD_RELOC_NIOS2_GLOB_DAT,
176 + BFD_RELOC_NIOS2_JUMP_SLOT,
177 + BFD_RELOC_NIOS2_RELATIVE,
178 + BFD_RELOC_NIOS2_GOTOFF,
180 /* Special Xtensa relocation used only by PLT entries in ELF shared
181 objects to indicate that the runtime linker should set the value
182 to one of its own internal functions or data structures. */
183 Index: binutils-2.20.1/bfd/config.bfd
184 ===================================================================
185 --- binutils-2.20.1.orig/bfd/config.bfd
186 +++ binutils-2.20.1/bfd/config.bfd
187 @@ -93,6 +93,7 @@ m88*) targ_archs=bfd_m88k_arch ;;
188 maxq*) targ_archs=bfd_maxq_arch ;;
189 microblaze*) targ_archs=bfd_microblaze_arch ;;
190 mips*) targ_archs=bfd_mips_arch ;;
191 +nios2*) targ_archs=bfd_nios2_arch ;;
192 or32*) targ_archs=bfd_or32_arch ;;
193 pdp11*) targ_archs=bfd_pdp11_arch ;;
194 pj*) targ_archs="bfd_pj_arch bfd_i386_arch";;
195 @@ -1055,6 +1056,21 @@ case "${targ}" in
196 targ_underscore=yes
199 + nios2eb-*-*)
200 + targ_defvec=bfd_elf32_bignios2_vec
201 + targ_selvecs=bfd_elf32_littlenios2_vec
202 + ;;
204 + nios2el-*-*)
205 + targ_defvec=bfd_elf32_littlenios2_vec
206 + targ_selvecs=bfd_elf32_bignios2_vec
207 + ;;
209 + nios2-*-*)
210 + targ_defvec=bfd_elf32_littlenios2_vec
211 + targ_selvecs=bfd_elf32_bignios2_vec
212 + ;;
214 openrisc-*-elf)
215 targ_defvec=bfd_elf32_openrisc_vec
217 Index: binutils-2.20.1/bfd/configure
218 ===================================================================
219 --- binutils-2.20.1.orig/bfd/configure
220 +++ binutils-2.20.1/bfd/configure
221 @@ -14855,6 +14855,8 @@ do
222 bfd_elf32_microblaze_vec) tb="$tb elf32-microblaze.lo elf32.lo $elf" ;;
223 bfd_elf32_mn10200_vec) tb="$tb elf-m10200.lo elf32.lo $elf" ;;
224 bfd_elf32_mn10300_vec) tb="$tb elf-m10300.lo elf32.lo $elf" ;;
225 + bfd_elf32_littlenios2_vec) tb="$tb elf32-nios2.lo elf32.lo $elf" ;;
226 + bfd_elf32_bignios2_vec) tb="$tb elf32-nios2.lo elf32.lo $elf" ;;
227 bfd_elf32_mt_vec) tb="$tb elf32-mt.lo elf32.lo $elf" ;;
228 bfd_elf32_msp430_vec) tb="$tb elf32-msp430.lo elf32.lo $elf" ;;
229 bfd_elf32_nbigmips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
230 Index: binutils-2.20.1/bfd/configure.in
231 ===================================================================
232 --- binutils-2.20.1.orig/bfd/configure.in
233 +++ binutils-2.20.1/bfd/configure.in
234 @@ -743,6 +743,8 @@ do
235 bfd_elf32_microblaze_vec) tb="$tb elf32-microblaze.lo elf32.lo $elf" ;;
236 bfd_elf32_mn10200_vec) tb="$tb elf-m10200.lo elf32.lo $elf" ;;
237 bfd_elf32_mn10300_vec) tb="$tb elf-m10300.lo elf32.lo $elf" ;;
238 + bfd_elf32_littlenios2_vec) tb="$tb elf32-nios2.lo elf32.lo $elf" ;;
239 + bfd_elf32_bignios2_vec) tb="$tb elf32-nios2.lo elf32.lo $elf" ;;
240 bfd_elf32_mt_vec) tb="$tb elf32-mt.lo elf32.lo $elf" ;;
241 bfd_elf32_msp430_vec) tb="$tb elf32-msp430.lo elf32.lo $elf" ;;
242 bfd_elf32_nbigmips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;;
243 Index: binutils-2.20.1/bfd/targets.c
244 ===================================================================
245 --- binutils-2.20.1.orig/bfd/targets.c
246 +++ binutils-2.20.1/bfd/targets.c
247 @@ -634,6 +634,8 @@ extern const bfd_target bfd_elf32_nbigmi
248 extern const bfd_target bfd_elf32_nlittlemips_vec;
249 extern const bfd_target bfd_elf32_ntradbigmips_vec;
250 extern const bfd_target bfd_elf32_ntradlittlemips_vec;
251 +extern const bfd_target bfd_elf32_littlenios2_vec;
252 +extern const bfd_target bfd_elf32_bignios2_vec;
253 extern const bfd_target bfd_elf32_openrisc_vec;
254 extern const bfd_target bfd_elf32_or32_big_vec;
255 extern const bfd_target bfd_elf32_pj_vec;
256 @@ -971,6 +973,8 @@ static const bfd_target * const _bfd_tar
257 &bfd_elf32_ntradbigmips_vec,
258 &bfd_elf32_ntradlittlemips_vec,
259 #endif
260 + &bfd_elf32_littlenios2_vec,
261 + &bfd_elf32_bignios2_vec,
262 &bfd_elf32_openrisc_vec,
263 &bfd_elf32_or32_big_vec,
264 &bfd_elf32_pj_vec,
265 Index: binutils-2.20.1/ld/Makefile.am
266 ===================================================================
267 --- binutils-2.20.1.orig/ld/Makefile.am
268 +++ binutils-2.20.1/ld/Makefile.am
269 @@ -353,6 +353,7 @@ ALL_EMULATIONS = \
270 emsp430x448.o \
271 emsp430x449.o \
272 enews.o \
273 + enios2elf.o \
274 ens32knbsd.o \
275 eor32.o \
276 eor32elf.o \
277 @@ -1614,6 +1615,9 @@ emsp430x449.c: $(srcdir)/emulparams/msp4
278 enews.c: $(srcdir)/emulparams/news.sh \
279 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
280 ${GENSCRIPTS} news "$(tdir_news)"
281 +enios2elf.c: $(srcdir)/emulparams/nios2elf.sh \
282 + $(ELFDEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
283 + ${GENSCRIPTS} nios2elf "$(tdir_nios2)"
284 ens32knbsd.c: $(srcdir)/emulparams/ns32knbsd.sh \
285 $(srcdir)/emultempl/generic.em $(srcdir)/emultempl/netbsd.em \
286 $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
287 Index: binutils-2.20.1/ld/Makefile.in
288 ===================================================================
289 --- binutils-2.20.1.orig/ld/Makefile.in
290 +++ binutils-2.20.1/ld/Makefile.in
291 @@ -639,6 +639,7 @@ ALL_EMULATIONS = \
292 emsp430x448.o \
293 emsp430x449.o \
294 enews.o \
295 + enios2elf.o \
296 ens32knbsd.o \
297 eor32.o \
298 eor32elf.o \
299 @@ -2956,6 +2957,9 @@ emsp430x449.c: $(srcdir)/emulparams/msp4
300 enews.c: $(srcdir)/emulparams/news.sh \
301 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
302 ${GENSCRIPTS} news "$(tdir_news)"
303 +enios2elf.c: $(srcdir)/emulparams/nios2elf.sh \
304 + $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
305 + ${GENSCRIPTS} nios2elf "$(tdir_nios2)"
306 ens32knbsd.c: $(srcdir)/emulparams/ns32knbsd.sh \
307 $(srcdir)/emultempl/generic.em $(srcdir)/emultempl/netbsd.em \
308 $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
309 Index: binutils-2.20.1/ld/configure.tgt
310 ===================================================================
311 --- binutils-2.20.1.orig/ld/configure.tgt
312 +++ binutils-2.20.1/ld/configure.tgt
313 @@ -428,6 +428,7 @@ mt-*elf) targ_emul=elf32m
314 msp430-*-*) targ_emul=msp430x110
315 targ_extra_emuls="msp430x112 msp430x1101 msp430x1111 msp430x1121 msp430x1122 msp430x1132 msp430x122 msp430x123 msp430x1222 msp430x1232 msp430x133 msp430x135 msp430x1331 msp430x1351 msp430x147 msp430x148 msp430x149 msp430x155 msp430x156 msp430x157 msp430x167 msp430x168 msp430x169 msp430x1610 msp430x1611 msp430x1612 msp430x2101 msp430x2111 msp430x2121 msp430x2131 msp430x311 msp430x312 msp430x313 msp430x314 msp430x315 msp430x323 msp430x325 msp430x336 msp430x337 msp430x412 msp430x413 msp430x415 msp430x417 msp430xE423 msp430xE425 msp430xE427 msp430xW423 msp430xW425 msp430xW427 msp430xG437 msp430xG438 msp430xG439 msp430x435 msp430x436 msp430x437 msp430x447 msp430x448 msp430x449"
317 +nios2*-*-*) targ_emul=nios2elf ;;
318 ns32k-pc532-mach* | ns32k-pc532-ux*) targ_emul=pc532macha ;;
319 ns32k-*-netbsd* | ns32k-pc532-lites*) targ_emul=ns32knbsd
321 Index: binutils-2.20.1/opcodes/configure
322 ===================================================================
323 --- binutils-2.20.1.orig/opcodes/configure
324 +++ binutils-2.20.1/opcodes/configure
325 @@ -12323,6 +12323,7 @@ if test x${all_targets} = xfalse ; then
326 bfd_mt_arch) ta="$ta mt-asm.lo mt-desc.lo mt-dis.lo mt-ibld.lo mt-opc.lo" using_cgen=yes ;;
327 bfd_msp430_arch) ta="$ta msp430-dis.lo" ;;
328 bfd_ns32k_arch) ta="$ta ns32k-dis.lo" ;;
329 + bfd_nios2_arch) ta="$ta nios2-dis.lo nios2-opc.lo" ;;
330 bfd_openrisc_arch) ta="$ta openrisc-asm.lo openrisc-desc.lo openrisc-dis.lo openrisc-ibld.lo openrisc-opc.lo" using_cgen=yes ;;
331 bfd_or32_arch) ta="$ta or32-dis.lo or32-opc.lo" using_cgen=yes ;;
332 bfd_pdp11_arch) ta="$ta pdp11-dis.lo pdp11-opc.lo" ;;
333 Index: binutils-2.20.1/opcodes/configure.in
334 ===================================================================
335 --- binutils-2.20.1.orig/opcodes/configure.in
336 +++ binutils-2.20.1/opcodes/configure.in
337 @@ -262,6 +262,7 @@ if test x${all_targets} = xfalse ; then
338 bfd_mt_arch) ta="$ta mt-asm.lo mt-desc.lo mt-dis.lo mt-ibld.lo mt-opc.lo" using_cgen=yes ;;
339 bfd_msp430_arch) ta="$ta msp430-dis.lo" ;;
340 bfd_ns32k_arch) ta="$ta ns32k-dis.lo" ;;
341 + bfd_nios2_arch) ta="$ta nios2-dis.lo nios2-opc.lo" ;;
342 bfd_openrisc_arch) ta="$ta openrisc-asm.lo openrisc-desc.lo openrisc-dis.lo openrisc-ibld.lo openrisc-opc.lo" using_cgen=yes ;;
343 bfd_or32_arch) ta="$ta or32-dis.lo or32-opc.lo" using_cgen=yes ;;
344 bfd_pdp11_arch) ta="$ta pdp11-dis.lo pdp11-opc.lo" ;;
345 Index: binutils-2.20.1/binutils/readelf.c
346 ===================================================================
347 --- binutils-2.20.1.orig/binutils/readelf.c
348 +++ binutils-2.20.1/binutils/readelf.c
349 @@ -126,6 +126,7 @@
350 #include "elf/mn10300.h"
351 #include "elf/mt.h"
352 #include "elf/msp430.h"
353 +#include "elf/nios2.h"
354 #include "elf/or32.h"
355 #include "elf/pj.h"
356 #include "elf/ppc.h"
357 @@ -1593,6 +1594,17 @@ get_score_dynamic_type (unsigned long ty
361 +static const char *
362 +get_nios2_dynamic_type (unsigned long type)
364 + switch (type)
366 + case DT_NIOS2_GP: return "NIOS2_GP";
367 + default:
368 + return NULL;
373 static const char *
374 get_dynamic_type (unsigned long type)
375 @@ -1705,6 +1717,9 @@ get_dynamic_type (unsigned long type)
376 case EM_SCORE:
377 result = get_score_dynamic_type (type);
378 break;
379 + case EM_ALTERA_NIOS2:
380 + result = get_nios2_dynamic_type (type);
381 + break;
382 default:
383 result = NULL;
384 break;
385 Index: binutils-2.20.1/binutils/testsuite/binutils-all/bintest.s
386 ===================================================================
387 --- binutils-2.20.1.orig/binutils/testsuite/binutils-all/bintest.s
388 +++ binutils-2.20.1/binutils/testsuite/binutils-all/bintest.s
389 @@ -1,5 +1,8 @@
390 .globl text_symbol
391 .text
392 + # this is needed to get the readelf -s, -S and -r tests to work
393 + # with nios2 as it has relaxation on by default
394 + .set norelax
395 text_symbol:
396 static_text_symbol:
397 .long 1
398 Index: binutils-2.20.1/configure
399 ===================================================================
400 --- binutils-2.20.1.orig/configure
401 +++ binutils-2.20.1/configure
402 @@ -3387,6 +3387,10 @@ case "${target}" in
403 noconfigdirs="$noconfigdirs gprof ${libgcj}"
404 libgloss_dir=mips
406 + nios2*-*-*)
407 + skipdirs=`echo " ${skipdirs} " | sed -e 's/ gprof / /'`
408 + noconfigdirs="$noconfigdirs"
409 + ;;
410 romp-*-*)
411 noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
413 @@ -7275,7 +7279,7 @@ case " $build_configdirs " in
414 # For an installed makeinfo, we require it to be from texinfo 4.7 or
415 # higher, else we use the "missing" dummy.
416 if ${MAKEINFO} --version \
417 - | egrep 'texinfo[^0-9]*(4\.([7-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then
418 + | egrep 'texinfo[^0-9]*([1-3][0-9]|4.[4-9]|4.[1-9][0-9]+|[5-9])' >/dev/null 2>&1; then
420 else
421 MAKEINFO="$MISSING makeinfo"
422 Index: binutils-2.20.1/gas/config/obj-elf.c
423 ===================================================================
424 --- binutils-2.20.1.orig/gas/config/obj-elf.c
425 +++ binutils-2.20.1/gas/config/obj-elf.c
426 @@ -62,6 +62,10 @@
427 #include "elf/mep.h"
428 #endif
430 +#ifdef TC_NIOS2
431 +#include "elf/nios2.h"
432 +#endif
434 static void obj_elf_line (int);
435 static void obj_elf_size (int);
436 static void obj_elf_type (int);
437 Index: binutils-2.20.1/gas/configure.tgt
438 ===================================================================
439 --- binutils-2.20.1.orig/gas/configure.tgt
440 +++ binutils-2.20.1/gas/configure.tgt
441 @@ -313,6 +313,8 @@ case ${generic_target} in
443 msp430-*-*) fmt=elf ;;
445 + nios2*-linux*) fmt=elf em=linux ;;
447 ns32k-pc532-mach*) fmt=aout em=pc532mach ;;
448 ns32k-pc532-ux*) fmt=aout em=pc532mach ;;
449 ns32k-pc532-lites*) fmt=aout em=nbsd532 ;;
450 Index: binutils-2.20.1/gas/doc/Makefile.am
451 ===================================================================
452 --- binutils-2.20.1.orig/gas/doc/Makefile.am
453 +++ binutils-2.20.1/gas/doc/Makefile.am
454 @@ -54,6 +54,7 @@ CPU_DOCS = \
455 c-mmix.texi \
456 c-mt.texi \
457 c-msp430.texi \
458 + c-nios2.texi \
459 c-ns32k.texi \
460 c-pdp11.texi \
461 c-pj.texi \
462 Index: binutils-2.20.1/gas/doc/as.texinfo
463 ===================================================================
464 --- binutils-2.20.1.orig/gas/doc/as.texinfo
465 +++ binutils-2.20.1/gas/doc/as.texinfo
466 @@ -845,6 +845,21 @@ unit coprocessor. The default is to ass
467 @end table
468 @end ifset
470 +@ifset NIOSII
471 +The following options are available when @value{AS} is configured for
472 +an Altera Nios II processor.
474 +@table @gcctabopt
475 +@item -relax-all
476 +Replace all branch and call instructions with @code{jmp} and @code{callr} sequences
477 +@item -relax-section
478 +Replace identified out of range branches with @code{jmp} sequences (default)
479 +@item -no-relax
480 +Do not replace any branches or calls
481 +@end table
482 +@end ifset
485 @ifset PDP11
487 For details about the PDP-11 machine dependent features options,
488 @@ -6972,6 +6987,10 @@ family.
489 @include c-msp430.texi
490 @end ifset
492 +@ifset NIOSII
493 +@include c-nios2.texi
494 +@end ifset
496 @ifset NS32K
497 @include c-ns32k.texi
498 @end ifset
499 Index: binutils-2.20.1/include/dis-asm.h
500 ===================================================================
501 --- binutils-2.20.1.orig/include/dis-asm.h
502 +++ binutils-2.20.1/include/dis-asm.h
503 @@ -225,6 +225,7 @@ extern int print_insn_avr (bfd_vma, dis
504 extern int print_insn_bfin (bfd_vma, disassemble_info *);
505 extern int print_insn_big_arm (bfd_vma, disassemble_info *);
506 extern int print_insn_big_mips (bfd_vma, disassemble_info *);
507 +extern int print_insn_big_nios2 (bfd_vma, disassemble_info *);
508 extern int print_insn_big_or32 (bfd_vma, disassemble_info *);
509 extern int print_insn_big_powerpc (bfd_vma, disassemble_info *);
510 extern int print_insn_big_score (bfd_vma, disassemble_info *);
511 @@ -251,6 +252,7 @@ extern int print_insn_ip2k (bfd_vma, di
512 extern int print_insn_iq2000 (bfd_vma, disassemble_info *);
513 extern int print_insn_little_arm (bfd_vma, disassemble_info *);
514 extern int print_insn_little_mips (bfd_vma, disassemble_info *);
515 +extern int print_insn_little_nios2 (bfd_vma, disassemble_info *);
516 extern int print_insn_little_or32 (bfd_vma, disassemble_info *);
517 extern int print_insn_little_powerpc (bfd_vma, disassemble_info *);
518 extern int print_insn_little_score (bfd_vma, disassemble_info *);
519 Index: binutils-2.20.1/opcodes/disassemble.c
520 ===================================================================
521 --- binutils-2.20.1.orig/opcodes/disassemble.c
522 +++ binutils-2.20.1/opcodes/disassemble.c
523 @@ -65,6 +65,7 @@
524 #define ARCH_mt
525 #define ARCH_msp430
526 #define ARCH_ns32k
527 +#define ARCH_nios2
528 #define ARCH_openrisc
529 #define ARCH_or32
530 #define ARCH_pdp11
531 @@ -275,6 +276,14 @@ disassembler (abfd)
532 disassemble = print_insn_msp430;
533 break;
534 #endif
535 +#ifdef ARCH_nios2
536 + case bfd_arch_nios2:
537 + if (bfd_big_endian (abfd))
538 + disassemble = print_insn_big_nios2;
539 + else
540 + disassemble = print_insn_little_nios2;
541 + break;
542 +#endif
543 #ifdef ARCH_ns32k
544 case bfd_arch_ns32k:
545 disassemble = print_insn_ns32k;
546 Index: binutils-2.20.1/bfd/elf-bfd.h
547 ===================================================================
548 --- binutils-2.20.1.orig/bfd/elf-bfd.h
549 +++ binutils-2.20.1/bfd/elf-bfd.h
550 @@ -1417,6 +1417,7 @@ enum elf_object_id
551 HPPA_ELF_TDATA,
552 I386_ELF_TDATA,
553 MIPS_ELF_TDATA,
554 + NIOS2_ELF_TDATA,
555 PPC32_ELF_TDATA,
556 PPC64_ELF_TDATA,
557 S390_ELF_TDATA,
558 Index: binutils-2.20.1/gas/Makefile.am
559 ===================================================================
560 --- binutils-2.20.1.orig/gas/Makefile.am
561 +++ binutils-2.20.1/gas/Makefile.am
562 @@ -75,6 +75,7 @@ CPU_TYPES = \
563 mn10300 \
564 msp430 \
565 mt \
566 + nios2 \
567 ns32k \
568 openrisc \
569 or32 \
570 @@ -278,6 +279,7 @@ TARGET_CPU_CFILES = \
571 config/tc-moxie.c \
572 config/tc-msp430.c \
573 config/tc-mt.c \
574 + config/tc-nios2.c \
575 config/tc-ns32k.c \
576 config/tc-openrisc.c \
577 config/tc-or32.c \
578 @@ -340,6 +342,7 @@ TARGET_CPU_HFILES = \
579 config/tc-mn10300.h \
580 config/tc-msp430.h \
581 config/tc-mt.h \
582 + config/tc-nios2.h \
583 config/tc-ns32k.h \
584 config/tc-openrisc.h \
585 config/tc-or32.h \
586 Index: binutils-2.20.1/gas/Makefile.in
587 ===================================================================
588 --- binutils-2.20.1.orig/gas/Makefile.in
589 +++ binutils-2.20.1/gas/Makefile.in
590 @@ -340,7 +340,8 @@ CPU_TYPES = \
591 mn10200 \
592 mn10300 \
593 msp430 \
594 - mt \
595 + nios2 \
596 + nios2 \
597 ns32k \
598 openrisc \
599 or32 \
600 @@ -541,7 +542,8 @@ TARGET_CPU_CFILES = \
601 config/tc-mn10300.c \
602 config/tc-moxie.c \
603 config/tc-msp430.c \
604 - config/tc-mt.c \
605 + config/tc-nios2.c \
606 + config/tc-nios2.c \
607 config/tc-ns32k.c \
608 config/tc-openrisc.c \
609 config/tc-or32.c \
610 @@ -603,7 +605,8 @@ TARGET_CPU_HFILES = \
611 config/tc-mn10200.h \
612 config/tc-mn10300.h \
613 config/tc-msp430.h \
614 - config/tc-mt.h \
615 + config/tc-nios2.h \
616 + config/tc-nios2.h \
617 config/tc-ns32k.h \
618 config/tc-openrisc.h \
619 config/tc-or32.h \
620 @@ -982,7 +985,8 @@ distclean-compile:
621 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tc-mn10300.Po@am__quote@
622 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tc-moxie.Po@am__quote@
623 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tc-msp430.Po@am__quote@
624 -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tc-mt.Po@am__quote@
625 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tc-nios2.Po@am__quote@
626 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tc-nios2.Po@am__quote@
627 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tc-ns32k.Po@am__quote@
628 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tc-openrisc.Po@am__quote@
629 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tc-or32.Po@am__quote@
630 @@ -1562,6 +1566,20 @@ tc-mt.obj: config/tc-mt.c
631 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
632 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tc-mt.obj `if test -f 'config/tc-mt.c'; then $(CYGPATH_W) 'config/tc-mt.c'; else $(CYGPATH_W) '$(srcdir)/config/tc-mt.c'; fi`
634 +tc-nios2.o: config/tc-nios2.c
635 +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tc-nios2.o -MD -MP -MF $(DEPDIR)/tc-nios2.Tpo -c -o tc-nios2.o `test -f 'config/tc-nios2.c' || echo '$(srcdir)/'`config/tc-nios2.c
636 +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tc-nios2.Tpo $(DEPDIR)/tc-nios2.Po
637 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='config/tc-nios2.c' object='tc-nios2.o' libtool=no @AMDEPBACKSLASH@
638 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
639 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tc-nios2.o `test -f 'config/tc-nios2.c' || echo '$(srcdir)/'`config/tc-nios2.c
641 +tc-nios2.obj: config/tc-nios2.c
642 +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tc-nios2.obj -MD -MP -MF $(DEPDIR)/tc-nios2.Tpo -c -o tc-nios2.obj `if test -f 'config/tc-nios2.c'; then $(CYGPATH_W) 'config/tc-nios2.c'; else $(CYGPATH_W) '$(srcdir)/config/tc-nios2.c'; fi`
643 +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tc-nios2.Tpo $(DEPDIR)/tc-nios2.Po
644 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='config/tc-nios2.c' object='tc-nios2.obj' libtool=no @AMDEPBACKSLASH@
645 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
646 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tc-nios2.obj `if test -f 'config/tc-nios2.c'; then $(CYGPATH_W) 'config/tc-nios2.c'; else $(CYGPATH_W) '$(srcdir)/config/tc-nios2.c'; fi`
648 tc-ns32k.o: config/tc-ns32k.c
649 @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tc-ns32k.o -MD -MP -MF $(DEPDIR)/tc-ns32k.Tpo -c -o tc-ns32k.o `test -f 'config/tc-ns32k.c' || echo '$(srcdir)/'`config/tc-ns32k.c
650 @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tc-ns32k.Tpo $(DEPDIR)/tc-ns32k.Po