diff -Naurp bfd/archures.c bfd/archures.c --- bfd/archures.c 2012-09-04 18:23:41.000000000 +0530 +++ bfd/archures.c 2012-12-21 14:14:42.000000000 +0530 @@ -391,6 +391,7 @@ DESCRIPTION .#define bfd_mach_avr5 5 .#define bfd_mach_avr51 51 .#define bfd_mach_avr6 6 +.#define bfd_mach_avrtiny 90 .#define bfd_mach_avrxmega1 101 .#define bfd_mach_avrxmega2 102 .#define bfd_mach_avrxmega3 103 diff -Naurp bfd/cpu-avr.c bfd/cpu-avr.c --- bfd/cpu-avr.c 2012-01-31 23:24:35.000000000 +0530 +++ bfd/cpu-avr.c 2012-12-21 14:14:42.000000000 +0530 @@ -135,24 +135,27 @@ static const bfd_arch_info_type arch_inf /* 3-Byte PC. */ N (22, bfd_mach_avr6, "avr:6", FALSE, & arch_info_struct[10]), - + + /* Tiny core (ATTiny10 & similar) */ + N (16, bfd_mach_avrtiny, "avr:90", FALSE, & arch_info_struct[11]), + /* Xmega 1 */ - N (24, bfd_mach_avrxmega1, "avr:101", FALSE, & arch_info_struct[11]), + N (24, bfd_mach_avrxmega1, "avr:101", FALSE, & arch_info_struct[12]), /* Xmega 2 */ - N (24, bfd_mach_avrxmega2, "avr:102", FALSE, & arch_info_struct[12]), + N (24, bfd_mach_avrxmega2, "avr:102", FALSE, & arch_info_struct[13]), /* Xmega 3 */ - N (24, bfd_mach_avrxmega3, "avr:103", FALSE, & arch_info_struct[13]), + N (24, bfd_mach_avrxmega3, "avr:103", FALSE, & arch_info_struct[14]), /* Xmega 4 */ - N (24, bfd_mach_avrxmega4, "avr:104", FALSE, & arch_info_struct[14]), + N (24, bfd_mach_avrxmega4, "avr:104", FALSE, & arch_info_struct[15]), /* Xmega 5 */ - N (24, bfd_mach_avrxmega5, "avr:105", FALSE, & arch_info_struct[15]), + N (24, bfd_mach_avrxmega5, "avr:105", FALSE, & arch_info_struct[16]), /* Xmega 6 */ - N (24, bfd_mach_avrxmega6, "avr:106", FALSE, & arch_info_struct[16]), + N (24, bfd_mach_avrxmega6, "avr:106", FALSE, & arch_info_struct[17]), /* Xmega 7 */ N (24, bfd_mach_avrxmega7, "avr:107", FALSE, NULL) diff -Naurp bfd/elf32-avr.c bfd/elf32-avr.c --- bfd/elf32-avr.c 2012-07-25 03:14:44.000000000 +0530 +++ bfd/elf32-avr.c 2012-12-21 14:14:42.000000000 +0530 @@ -559,6 +559,20 @@ static reloc_howto_type elf_avr_howto_ta 0xffffff, /* src_mask */ 0xffffff, /* dst_mask */ FALSE), /* pcrel_offset */ + /* 7 bit immediate for LDS/STS in Tiny core */ + HOWTO (R_AVR_7_LDS16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 7, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_AVR_7_LDS16", /* name */ + FALSE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ }; /* Map BFD reloc types to AVR ELF reloc types. */ @@ -600,7 +614,8 @@ static const struct avr_reloc_map avr_re { BFD_RELOC_8, R_AVR_8 }, { BFD_RELOC_AVR_8_LO, R_AVR_8_LO8 }, { BFD_RELOC_AVR_8_HI, R_AVR_8_HI8 }, - { BFD_RELOC_AVR_8_HLO, R_AVR_8_HLO8 } + { BFD_RELOC_AVR_8_HLO, R_AVR_8_HLO8 }, + { BFD_RELOC_AVR_7_LDS16, R_AVR_7_LDS16 } }; /* Meant to be filled one day with the wrap around address for the @@ -1131,6 +1146,17 @@ avr_final_link_relocate (reloc_howto_typ bfd_put_16 (input_bfd, (bfd_vma) srel & 0xffff, contents+2); break; + case R_AVR_7_LDS16: + contents += rel->r_offset; + srel = (bfd_signed_vma) relocation + rel->r_addend; + if ((srel & 0xFFFF) < 0x40 || (srel & 0xFFFF) > 0xbf) + return bfd_reloc_outofrange; + srel = srel & 0x7f; + x = bfd_get_16 (input_bfd, contents); + x |= (srel & 0x0f) | ((srel & 0x30) << 5) | ((srel & 0x40) << 2); + bfd_put_16 (input_bfd, x, contents); + break; + case R_AVR_16_PM: use_stubs = (!htab->no_stubs); contents += rel->r_offset; @@ -1372,6 +1398,10 @@ bfd_elf_avr_final_write_processing (bfd case bfd_mach_avrxmega7: val = E_AVR_MACH_XMEGA7; break; + + case bfd_mach_avrtiny: + val = E_AVR_MACH_AVRTINY; + break; } elf_elfheader (abfd)->e_machine = EM_AVR; @@ -1462,6 +1492,10 @@ elf32_avr_object_p (bfd *abfd) case E_AVR_MACH_XMEGA7: e_set = bfd_mach_avrxmega7; break; + + case E_AVR_MACH_AVRTINY: + e_set = bfd_mach_avrtiny; + break; } } return bfd_default_set_arch_mach (abfd, bfd_arch_avr, diff -Naurp bfd/reloc.c bfd/reloc.c --- bfd/reloc.c 2012-09-04 18:23:42.000000000 +0530 +++ bfd/reloc.c 2012-12-21 14:14:42.000000000 +0530 @@ -4409,6 +4409,11 @@ ENUM ENUMDOC This is a 8 bit reloc for the AVR that stores bits 16..23 of a symbol in .byte hlo8(symbol) +ENUM + BFD_RELOC_AVR_7_LDS16 +ENUMDOC + This is a 7 bit reloc for the AVR that stores offset for 16bit sts/lds + instructions supported only by Tiny core ENUM BFD_RELOC_RL78_NEG8 diff -Naurp gas/config/tc-avr.c gas/config/tc-avr.c --- gas/config/tc-avr.c 2012-06-11 19:56:41.000000000 +0530 +++ gas/config/tc-avr.c 2012-12-21 14:14:42.000000000 +0530 @@ -89,6 +89,7 @@ static struct mcu_type_s mcu_types[] = {"avrxmega5", AVR_ISA_XMEGA, bfd_mach_avrxmega5}, {"avrxmega6", AVR_ISA_XMEGA, bfd_mach_avrxmega6}, {"avrxmega7", AVR_ISA_XMEGA, bfd_mach_avrxmega7}, + {"avrtiny", AVR_ISA_AVRTINY, bfd_mach_avrtiny}, {"at90s1200", AVR_ISA_1200, bfd_mach_avr1}, {"attiny11", AVR_ISA_AVR1, bfd_mach_avr1}, {"attiny12", AVR_ISA_AVR1, bfd_mach_avr1}, @@ -274,6 +275,12 @@ static struct mcu_type_s mcu_types[] = {"atxmega256d3", AVR_ISA_XMEGA, bfd_mach_avrxmega6}, {"atxmega128a1", AVR_ISA_XMEGA, bfd_mach_avrxmega7}, {"atxmega128a1u", AVR_ISA_XMEGA, bfd_mach_avrxmega7}, + {"attiny4", AVR_ISA_AVRTINY, bfd_mach_avrtiny}, + {"attiny5", AVR_ISA_AVRTINY, bfd_mach_avrtiny}, + {"attiny9", AVR_ISA_AVRTINY, bfd_mach_avrtiny}, + {"attiny10", AVR_ISA_AVRTINY, bfd_mach_avrtiny}, + {"attiny20", AVR_ISA_AVRTINY, bfd_mach_avrtiny}, + {"attiny40", AVR_ISA_AVRTINY, bfd_mach_avrtiny}, {NULL, 0, 0} }; @@ -455,6 +462,7 @@ md_show_usage (FILE *stream) " avrxmega5 - XMEGA, > 64K, <= 128K FLASH, > 64K RAM\n" " avrxmega6 - XMEGA, > 128K, <= 256K FLASH, <= 64K RAM\n" " avrxmega7 - XMEGA, > 128K, <= 256K FLASH, > 64K RAM\n" + " avrtiny - AVR Tiny core\n" " or immediate microcontroller name.\n")); fprintf (stream, _(" -mall-opcodes accept all AVR opcodes, even if not supported by MCU\n" @@ -803,6 +811,12 @@ avr_operand (struct avr_opcodes_s *opcod str = input_line_pointer; } + if (avr_mcu->mach == bfd_mach_avrtiny) + { + if (op_mask < 16 || op_mask > 31) + as_bad (_("register not supported")); + } + if (op_mask <= 31) { switch (*op) @@ -941,6 +955,12 @@ avr_operand (struct avr_opcodes_s *opcod &op_expr, FALSE, BFD_RELOC_16); break; + case 'j': + str = parse_exp (str, &op_expr); + fix_new_exp (frag_now, where, opcode->insn_size * 2, + &op_expr, FALSE, BFD_RELOC_AVR_7_LDS16); + break; + case 'M': { bfd_reloc_code_real_type r_type; @@ -1249,6 +1269,17 @@ md_apply_fix (fixS *fixP, valueT * valP, bfd_putl16 ((bfd_vma) insn | LDI_IMMEDIATE (value), where); break; + case BFD_RELOC_AVR_7_LDS16: + if ((value < 0x40) || (value > 0xBF)) + as_warn_where (fixP->fx_file, fixP->fx_line, + _("operand out of range: 0x%lx"), + (unsigned long)value); + insn |= value & 0xF; + insn |= (value & 0x30) << 5; + insn |= (value & 0x40) << 2; + bfd_putl16 ((bfd_vma) insn, where); + break; + case BFD_RELOC_AVR_6: if ((value > 63) || (value < 0)) as_bad_where (fixP->fx_file, fixP->fx_line, @@ -1448,6 +1479,28 @@ md_assemble (char *str) opcode = (struct avr_opcodes_s *) hash_find (avr_hash, op); + if (opcode && !avr_opt.all_opcodes) + { + /* Check if the instruction's ISA bit is ON in the ISA bits of the part + specified by the user. If not look for other instructions specifica- + -tions with same mnemonic who's ISA bits matches. + + This requires include/opcode/avr.h to have the instructions with + same mnenomic to be specified in sequence. */ + + while ((opcode->isa & avr_mcu->isa) != opcode->isa) + { + opcode++; + + if (opcode->name && strcmp(op, opcode->name)) + { + as_bad (_("illegal opcode %s for mcu %s"), + opcode->name, avr_mcu->name); + return; + } + } + } + if (opcode == NULL) { as_bad (_("unknown opcode `%s'"), op); @@ -1460,9 +1513,6 @@ md_assemble (char *str) if (*str && *opcode->constraints == '?') ++opcode; - if (!avr_opt.all_opcodes && (opcode->isa & avr_mcu->isa) != opcode->isa) - as_bad (_("illegal opcode %s for mcu %s"), opcode->name, avr_mcu->name); - dwarf2_emit_insn (0); /* We used to set input_line_pointer to the result of get_operands, diff -Naurp include/elf/avr.h include/elf/avr.h --- include/elf/avr.h 2012-05-16 20:22:16.000000000 +0530 +++ include/elf/avr.h 2012-12-21 14:14:42.000000000 +0530 @@ -41,13 +41,14 @@ #define E_AVR_MACH_AVR5 5 #define E_AVR_MACH_AVR51 51 #define E_AVR_MACH_AVR6 6 -#define E_AVR_MACH_XMEGA1 101 -#define E_AVR_MACH_XMEGA2 102 -#define E_AVR_MACH_XMEGA3 103 -#define E_AVR_MACH_XMEGA4 104 -#define E_AVR_MACH_XMEGA5 105 -#define E_AVR_MACH_XMEGA6 106 -#define E_AVR_MACH_XMEGA7 107 +#define E_AVR_MACH_AVRTINY 90 +#define E_AVR_MACH_XMEGA1 101 +#define E_AVR_MACH_XMEGA2 102 +#define E_AVR_MACH_XMEGA3 103 +#define E_AVR_MACH_XMEGA4 104 +#define E_AVR_MACH_XMEGA5 105 +#define E_AVR_MACH_XMEGA6 106 +#define E_AVR_MACH_XMEGA7 107 /* Relocations. */ START_RELOC_NUMBERS (elf_avr_reloc_type) @@ -81,6 +82,7 @@ START_RELOC_NUMBERS (elf_avr_reloc_type) RELOC_NUMBER (R_AVR_8_LO8, 27) RELOC_NUMBER (R_AVR_8_HI8, 28) RELOC_NUMBER (R_AVR_8_HLO8, 29) + RELOC_NUMBER (R_AVR_7_LDS16, 30) END_RELOC_NUMBERS (R_AVR_max) #endif /* _ELF_AVR_H */ diff -Naurp include/opcode/avr.h include/opcode/avr.h --- include/opcode/avr.h 2012-06-07 22:13:36.000000000 +0530 +++ include/opcode/avr.h 2012-12-21 14:14:42.000000000 +0530 @@ -22,6 +22,7 @@ #define AVR_ISA_LPM 0x0002 /* device has LPM */ #define AVR_ISA_LPMX 0x0004 /* device has LPM Rd,Z[+] */ #define AVR_ISA_SRAM 0x0008 /* device has SRAM (LD, ST, PUSH, POP, ...) */ +#define AVR_ISA_TINY 0x0010 /* device has Tiny core specific encodings */ #define AVR_ISA_MEGA 0x0020 /* device has >8K program memory (JMP and CALL supported, no 8K wrap on RJMP and RCALL) */ #define AVR_ISA_MUL 0x0040 /* device has new core (MUL, FMUL, ...) */ @@ -37,6 +38,7 @@ #define AVR_ISA_TINY1 (AVR_ISA_1200 | AVR_ISA_LPM) #define AVR_ISA_2xxx (AVR_ISA_TINY1 | AVR_ISA_SRAM) +#define AVR_ISA_2xxxa (AVR_ISA_1200 | AVR_ISA_SRAM) /* For the attiny26 which is missing LPM Rd,Z+. */ #define AVR_ISA_2xxe (AVR_ISA_2xxx | AVR_ISA_LPMX) #define AVR_ISA_RF401 (AVR_ISA_2xxx | AVR_ISA_MOVW | AVR_ISA_LPMX) @@ -71,6 +73,9 @@ AVR_ISA_ELPM | AVR_ISA_ELPMX | AVR_ISA_SPM | \ AVR_ISA_BRK | AVR_ISA_EIND | AVR_ISA_MOVW) +#define AVR_ISA_AVRTINY (AVR_ISA_1200 | AVR_ISA_BRK | AVR_ISA_SRAM | \ + AVR_ISA_TINY) + #define REGISTER_P(x) ((x) == 'r' \ || (x) == 'd' \ || (x) == 'w' \ @@ -109,6 +114,7 @@ p - Port address value from 0 to 31. (cbi, sbi, sbic, sbis) K - immediate value from 0 to 63 (used in `adiw', `sbiw') i - immediate value + j - 7 bit immediate value from 0x40 to 0xBF (for 16-bit 'lds'/'sts') l - signed pc relative offset from -64 to 63 L - signed pc relative offset from -2048 to 2047 h - absolute code address (call, jmp) @@ -159,8 +165,8 @@ AVR_INSN (sez, "", "1001010000011000 AVR_INSN (bclr, "S", "100101001SSS1000", 1, AVR_ISA_1200, 0x9488) AVR_INSN (bset, "S", "100101000SSS1000", 1, AVR_ISA_1200, 0x9408) -AVR_INSN (icall,"", "1001010100001001", 1, AVR_ISA_2xxx, 0x9509) -AVR_INSN (ijmp, "", "1001010000001001", 1, AVR_ISA_2xxx, 0x9409) +AVR_INSN (icall,"", "1001010100001001", 1, AVR_ISA_2xxxa,0x9509) +AVR_INSN (ijmp, "", "1001010000001001", 1, AVR_ISA_2xxxa,0x9409) AVR_INSN (lpm, "?", "1001010111001000", 1, AVR_ISA_TINY1,0x95c8) AVR_INSN (lpm, "r,z", "1001000ddddd010+", 1, AVR_ISA_LPMX, 0x9004) @@ -260,8 +266,8 @@ AVR_INSN (dec, "r", "1001010rrrrr1010 AVR_INSN (inc, "r", "1001010rrrrr0011", 1, AVR_ISA_1200, 0x9403) AVR_INSN (lsr, "r", "1001010rrrrr0110", 1, AVR_ISA_1200, 0x9406) AVR_INSN (neg, "r", "1001010rrrrr0001", 1, AVR_ISA_1200, 0x9401) -AVR_INSN (pop, "r", "1001000rrrrr1111", 1, AVR_ISA_2xxx, 0x900f) -AVR_INSN (push, "r", "1001001rrrrr1111", 1, AVR_ISA_2xxx, 0x920f) +AVR_INSN (pop, "r", "1001000rrrrr1111", 1, AVR_ISA_2xxxa,0x900f) +AVR_INSN (push, "r", "1001001rrrrr1111", 1, AVR_ISA_2xxxa,0x920f) AVR_INSN (ror, "r", "1001010rrrrr0111", 1, AVR_ISA_1200, 0x9407) AVR_INSN (swap, "r", "1001010rrrrr0010", 1, AVR_ISA_1200, 0x9402) @@ -279,8 +285,10 @@ AVR_INSN (fmul, "a,a", "000000110ddd1rrr AVR_INSN (fmuls,"a,a", "000000111ddd0rrr", 1, AVR_ISA_MUL, 0x0380) AVR_INSN (fmulsu,"a,a","000000111ddd1rrr", 1, AVR_ISA_MUL, 0x0388) -AVR_INSN (sts, "i,r", "1001001ddddd0000", 2, AVR_ISA_2xxx, 0x9200) -AVR_INSN (lds, "r,i", "1001000ddddd0000", 2, AVR_ISA_2xxx, 0x9000) +AVR_INSN (sts, "j,d", "10101kkkddddkkkk", 1, AVR_ISA_TINY, 0xA800) +AVR_INSN (sts, "i,r", "1001001ddddd0000", 2, AVR_ISA_2xxx, 0x9200) +AVR_INSN (lds, "d,j", "10100kkkddddkkkk", 1, AVR_ISA_TINY, 0xA000) +AVR_INSN (lds, "r,i", "1001000ddddd0000", 2, AVR_ISA_2xxx, 0x9000) /* Special case for b+0, `e' must be next entry after `b', b={Y=1,Z=0}, ee={X=11,Y=10,Z=00}, !=1 if -e or e+ or X. */ diff -Naurp ld/configure.tgt ld/configure.tgt --- ld/configure.tgt 2012-09-04 18:23:47.000000000 +0530 +++ ld/configure.tgt 2012-12-21 14:14:42.000000000 +0530 @@ -118,7 +118,7 @@ arm*-*-uclinux*) targ_emul=armelf_linux arm-*-vxworks) targ_emul=armelf_vxworks ;; arm*-*-conix*) targ_emul=armelf ;; avr-*-*) targ_emul=avr2 - targ_extra_emuls="avr1 avr25 avr3 avr31 avr35 avr4 avr5 avr51 avr6 avrxmega1 avrxmega2 avrxmega3 avrxmega4 avrxmega5 avrxmega6 avrxmega7" + targ_extra_emuls="avr1 avr25 avr3 avr31 avr35 avr4 avr5 avr51 avr6 avrxmega1 avrxmega2 avrxmega3 avrxmega4 avrxmega5 avrxmega6 avrxmega7 avrtiny" ;; bfin-*-elf) targ_emul=elf32bfin; targ_extra_emuls="elf32bfinfd" diff -Naurp ld/emulparams/avrtiny.sh ld/emulparams/avrtiny.sh --- ld/emulparams/avrtiny.sh 1970-01-01 05:30:00.000000000 +0530 +++ ld/emulparams/avrtiny.sh 2012-12-21 14:14:42.000000000 +0530 @@ -0,0 +1,13 @@ +ARCH=avr:90 +MACHINE= +SCRIPT_NAME=avrtiny +OUTPUT_FORMAT="elf32-avr" +MAXPAGESIZE=1 +EMBEDDED=yes +TEMPLATE_NAME=elf32 + +TEXT_ORIGIN=0x0 +TEXT_LENGTH=4K +DATA_ORIGIN=0x0800040 +DATA_LENGTH=0x100 +EXTRA_EM_FILE=avrelf diff -Naurp ld/Makefile.am ld/Makefile.am --- ld/Makefile.am 2012-12-21 14:15:39.000000000 +0530 +++ ld/Makefile.am 2012-12-21 14:14:42.000000000 +0530 @@ -172,6 +172,7 @@ ALL_EMULATION_SOURCES = \ eavrxmega5.c \ eavrxmega6.c \ eavrxmega7.c \ + eavrtiny.c \ ecoff_i860.c \ ecoff_sparc.c \ ecrisaout.c \ @@ -844,9 +845,13 @@ eavrxmega6.c: $(srcdir)/emulparams/avrxm ${GEN_DEPENDS} ${GENSCRIPTS} avrxmega6 "$(tdir_avr2)" eavrxmega7.c: $(srcdir)/emulparams/avrxmega7.sh \ - $(srcdir)/emultempl/avrelf.em $(ELF_DEPS) $(srcdir)/scripttempl/avr.sc \ + $(srcdir)/emultempl/avrelf.em $(ELF_DEPS) $(srcdir)/scripttempl/avrtiny.sc \ ${GEN_DEPENDS} ${GENSCRIPTS} avrxmega7 "$(tdir_avr2)" +eavrtiny.c: $(srcdir)/emulparams/avrtiny.sh \ + $(srcdir)/emultempl/avrelf.em $(ELF_DEPS) $(srcdir)/scripttempl/avr.sc \ + ${GEN_DEPENDS} + ${GENSCRIPTS} avrtiny "$(tdir_avr2)" ecoff_i860.c: $(srcdir)/emulparams/coff_i860.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i860coff.sc ${GEN_DEPENDS} ${GENSCRIPTS} coff_i860 "$(tdir_coff_i860)" diff -Naurp ld/scripttempl/avrtiny.sc ld/scripttempl/avrtiny.sc --- ld/scripttempl/avrtiny.sc 1970-01-01 05:30:00.000000000 +0530 +++ ld/scripttempl/avrtiny.sc 2012-12-21 14:14:42.000000000 +0530 @@ -0,0 +1,250 @@ +cat < text} + + .data ${RELOCATING-0} : ${RELOCATING+AT (ADDR (.text) + SIZEOF (.text))} + { + ${RELOCATING+ PROVIDE (__data_start = .) ; } + *(.data) + KEEP (*(.data)) + *(.data*) + *(.rodata) /* We need to include .rodata here if gcc is used */ + *(.rodata*) /* with -fdata-sections. */ + *(.gnu.linkonce.d*) + ${RELOCATING+. = ALIGN(2);} + ${RELOCATING+ _edata = . ; } + ${RELOCATING+ PROVIDE (__data_end = .) ; } + } ${RELOCATING+ > data} + + .bss ${RELOCATING-0} :${RELOCATING+ AT (ADDR (.bss))} + { + ${RELOCATING+ PROVIDE (__bss_start = .) ; } + *(.bss) + *(.bss*) + *(COMMON) + ${RELOCATING+ PROVIDE (__bss_end = .) ; } + } ${RELOCATING+ > data} + + ${RELOCATING+ __data_load_start = LOADADDR(.data); } + ${RELOCATING+ __data_load_end = __data_load_start + SIZEOF(.data); } + + /* Global data not cleared after reset. */ + .noinit ${RELOCATING-0}: + { + ${RELOCATING+ PROVIDE (__noinit_start = .) ; } + *(.noinit*) + ${RELOCATING+ PROVIDE (__noinit_end = .) ; } + ${RELOCATING+ _end = . ; } + ${RELOCATING+ PROVIDE (__heap_start = .) ; } + } ${RELOCATING+ > data} + + .lock ${RELOCATING-0}: + { + KEEP(*(.lock*)) + } ${RELOCATING+ > lock} + + .signature ${RELOCATING-0}: + { + KEEP(*(.signature*)) + } ${RELOCATING+ > signature} + + .config ${RELOCATING-0}: + { + KEEP(*(.config*)) + } ${RELOCATING+ > config} + + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } +} +EOF + diff -Naurp opcodes/avr-dis.c opcodes/avr-dis.c --- opcodes/avr-dis.c 2012-05-17 20:43:24.000000000 +0530 +++ opcodes/avr-dis.c 2012-12-21 14:15:31.000000000 +0530 @@ -187,6 +187,16 @@ avr_operand (unsigned int insn, unsigned case 'i': sprintf (buf, "0x%04X", insn2); break; + + case 'j': + { + unsigned int val = ((insn & 0xf) | ((insn & 0x600) >> 5) + | ((insn & 0x100) >> 2)); + if (val > 0 && !(insn & 0x100)) + val |= 0x80; + sprintf (buf, "0x%02x", val); + } + break; case 'M': sprintf (buf, "0x%02X", ((insn & 0xf00) >> 4) | (insn & 0xf)); @@ -330,8 +340,12 @@ print_insn_avr (bfd_vma addr, disassembl for (opcode = avr_opcodes, maskptr = avr_bin_masks; opcode->name; opcode++, maskptr++) - if ((insn & *maskptr) == opcode->bin_opcode) - break; + { + if ((opcode->isa == AVR_ISA_TINY) && (info->mach != bfd_mach_avrtiny)) + continue; + if ((insn & *maskptr) == opcode->bin_opcode) + break; + } /* Special case: disassemble `ldd r,b+0' as `ld r,b', and `std b+0,r' as `st b,r' (next entry in the table). */