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 = \
14 @@ -183,6 +184,7 @@ ALL_MACHINES_CFILES = \
22 @@ -303,6 +305,7 @@ BFD32_BACKENDS = \
30 @@ -486,6 +489,7 @@ BFD32_BACKENDS_CFILES = \
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 = \
50 @@ -478,6 +479,7 @@ ALL_MACHINES_CFILES = \
58 @@ -599,6 +601,7 @@ BFD32_BACKENDS = \
66 @@ -782,6 +785,7 @@ BFD32_BACKENDS_CFILES = \
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. *}
99 +#define bfd_mach_nios2 1
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
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. */
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
200 + targ_defvec=bfd_elf32_bignios2_vec
201 + targ_selvecs=bfd_elf32_littlenios2_vec
205 + targ_defvec=bfd_elf32_littlenios2_vec
206 + targ_selvecs=bfd_elf32_bignios2_vec
210 + targ_defvec=bfd_elf32_littlenios2_vec
211 + targ_selvecs=bfd_elf32_bignios2_vec
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,
260 + &bfd_elf32_littlenios2_vec,
261 + &bfd_elf32_bignios2_vec,
262 &bfd_elf32_openrisc_vec,
263 &bfd_elf32_or32_big_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 = \
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 = \
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
350 #include "elf/mn10300.h"
352 #include "elf/msp430.h"
353 +#include "elf/nios2.h"
354 #include "elf/or32.h"
357 @@ -1593,6 +1594,17 @@ get_score_dynamic_type (unsigned long ty
362 +get_nios2_dynamic_type (unsigned long type)
366 + case DT_NIOS2_GP: return "NIOS2_GP";
374 get_dynamic_type (unsigned long type)
375 @@ -1705,6 +1717,9 @@ get_dynamic_type (unsigned long type)
377 result = get_score_dynamic_type (type);
379 + case EM_ALTERA_NIOS2:
380 + result = get_nios2_dynamic_type (type);
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
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
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}"
407 + skipdirs=`echo " ${skipdirs} " | sed -e 's/ gprof / /'`
408 + noconfigdirs="$noconfigdirs"
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
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
431 +#include "elf/nios2.h"
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 = \
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
471 +The following options are available when @value{AS} is configured for
472 +an Altera Nios II processor.
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)
480 +Do not replace any branches or calls
487 For details about the PDP-11 machine dependent features options,
488 @@ -6972,6 +6987,10 @@ family.
489 @include c-msp430.texi
493 +@include c-nios2.texi
497 @include c-ns32k.texi
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
528 #define ARCH_openrisc
531 @@ -275,6 +276,14 @@ disassembler (abfd)
532 disassemble = print_insn_msp430;
536 + case bfd_arch_nios2:
537 + if (bfd_big_endian (abfd))
538 + disassemble = print_insn_big_nios2;
540 + disassemble = print_insn_little_nios2;
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
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 = \
570 @@ -278,6 +279,7 @@ TARGET_CPU_CFILES = \
574 + config/tc-nios2.c \
576 config/tc-openrisc.c \
578 @@ -340,6 +342,7 @@ TARGET_CPU_HFILES = \
579 config/tc-mn10300.h \
582 + config/tc-nios2.h \
584 config/tc-openrisc.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 = \
600 @@ -541,7 +542,8 @@ TARGET_CPU_CFILES = \
601 config/tc-mn10300.c \
605 + config/tc-nios2.c \
606 + config/tc-nios2.c \
608 config/tc-openrisc.c \
610 @@ -603,7 +605,8 @@ TARGET_CPU_HFILES = \
611 config/tc-mn10200.h \
612 config/tc-mn10300.h \
615 + config/tc-nios2.h \
616 + config/tc-nios2.h \
618 config/tc-openrisc.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