diff -r -p -u binutils-030205/bfd/archures.c /home/dhananjayd/binutils-030205/bfd/archures.c --- binutils-030205/bfd/archures.c Fri Jan 24 00:20:56 2003 +++ /home/dhananjayd/binutils-030205/bfd/archures.c Thu Feb 6 12:02:25 2003 @@ -167,6 +167,8 @@ DESCRIPTION .#define bfd_mach_h8300 1 .#define bfd_mach_h8300h 2 .#define bfd_mach_h8300s 3 +.#define bfd_mach_h8300hn 4 +.#define bfd_mach_h8300sn 5 . bfd_arch_pdp11, {* DEC PDP-11 *} . bfd_arch_powerpc, {* PowerPC *} .#define bfd_mach_ppc 32 diff -r -p -u binutils-030205/bfd/coff-h8300.c /home/dhananjayd/binutils-030205/bfd/coff-h8300.c --- binutils-030205/bfd/coff-h8300.c Sat Dec 21 04:11:13 2002 +++ /home/dhananjayd/binutils-030205/bfd/coff-h8300.c Thu Feb 6 12:02:25 2003 @@ -281,7 +281,8 @@ static reloc_howto_type howto_table[] = #define SELECT_RELOC(x,howto) \ { x.r_type = select_reloc (howto); } -#define BADMAG(x) (H8300BADMAG (x) && H8300HBADMAG (x) && H8300SBADMAG (x)) +#define BADMAG(x) (H8300BADMAG (x) && H8300HBADMAG (x) && H8300SBADMAG (x) \ + && H8300HNBADMAG(x) && H8300SNBADMAG(x)) #define H8300 1 /* Customize coffcode.h */ #define __A_MAGIC_SET__ diff -r -p -u binutils-030205/bfd/coffcode.h /home/dhananjayd/binutils-030205/bfd/coffcode.h --- binutils-030205/bfd/coffcode.h Tue Jan 21 04:04:38 2003 +++ /home/dhananjayd/binutils-030205/bfd/coffcode.h Thu Feb 6 12:02:25 2003 @@ -2086,6 +2086,24 @@ coff_set_arch_mach_hook (abfd, filehdr) break; #endif +#ifdef H8300HNMAGIC + case H8300HNMAGIC: + arch = bfd_arch_h8300; + machine = bfd_mach_h8300hn; + /* !! FIXME this probably isn't the right place for this */ + abfd->flags |= BFD_IS_RELAXABLE; + break; +#endif + +#ifdef H8300SNMAGIC + case H8300SNMAGIC: + arch = bfd_arch_h8300; + machine = bfd_mach_h8300sn; + /* !! FIXME this probably isn't the right place for this */ + abfd->flags |= BFD_IS_RELAXABLE; + break; +#endif + #ifdef SH_ARCH_MAGIC_BIG case SH_ARCH_MAGIC_BIG: case SH_ARCH_MAGIC_LITTLE: @@ -2727,6 +2745,12 @@ coff_set_flags (abfd, magicp, flagsp) return TRUE; case bfd_mach_h8300s: *magicp = H8300SMAGIC; + return TRUE; + case bfd_mach_h8300hn: + *magicp = H8300HNMAGIC; + return TRUE; + case bfd_mach_h8300sn: + *magicp = H8300SNMAGIC; return TRUE; } break; diff -r -p -u binutils-030205/bfd/cpu-h8300.c /home/dhananjayd/binutils-030205/bfd/cpu-h8300.c --- binutils-030205/bfd/cpu-h8300.c Sat Nov 30 14:09:36 2002 +++ /home/dhananjayd/binutils-030205/bfd/cpu-h8300.c Thu Feb 6 12:02:25 2003 @@ -69,10 +69,20 @@ h8300_scan (info, string) if (*string == 'h' || *string == 'H') { + string++; + if (*string == 'n' || *string == 'N') + { + return (info->mach == bfd_mach_h8300hn); + } return (info->mach == bfd_mach_h8300h); } else if (*string == 's' || *string == 'S') { + string++; + if (*string == 'n' || *string == 'N') + { + return (info->mach == bfd_mach_h8300sn); + } return (info->mach == bfd_mach_h8300s); } else @@ -97,6 +107,39 @@ compatible (in, out) return in; } +static const bfd_arch_info_type h8300sn_info_struct = +{ + 32, /* 32 bits in a word */ + 32, /* 32 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_h8300, + bfd_mach_h8300sn, + "h8300sn", /* arch_name */ + "h8300sn", /* printable name */ + 1, + FALSE, /* the default machine */ + compatible, + h8300_scan, + 0 +}; + + +static const bfd_arch_info_type h8300hn_info_struct = +{ + 32, /* 32 bits in a word */ + 32, /* 32 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_h8300, + bfd_mach_h8300hn, + "h8300hn", /* arch_name */ + "h8300hn", /* printable name */ + 1, + FALSE, /* the default machine */ + compatible, + h8300_scan, + &h8300sn_info_struct +}; + static const bfd_arch_info_type h8300s_info_struct = { 32, /* 32 bits in a word */ @@ -110,7 +153,7 @@ static const bfd_arch_info_type h8300s_i FALSE, /* the default machine */ compatible, h8300_scan, - 0 + &h8300hn_info_struct }; static const bfd_arch_info_type h8300h_info_struct = diff -r -p -u binutils-030205/bfd/elf32-h8300.c /home/dhananjayd/binutils-030205/bfd/elf32-h8300.c --- binutils-030205/bfd/elf32-h8300.c Sat Nov 30 14:09:37 2002 +++ /home/dhananjayd/binutils-030205/bfd/elf32-h8300.c Thu Feb 6 12:02:25 2003 @@ -573,6 +573,12 @@ elf32_h8_mach (flags) case E_H8_MACH_H8300S: return bfd_mach_h8300s; + + case E_H8_MACH_H8300HN: + return bfd_mach_h8300hn; + + case E_H8_MACH_H8300SN: + return bfd_mach_h8300sn; } } @@ -600,6 +606,14 @@ elf32_h8_final_write_processing (abfd, l case bfd_mach_h8300s: val = E_H8_MACH_H8300S; + break; + + case bfd_mach_h8300hn: + val = E_H8_MACH_H8300HN; + break; + + case bfd_mach_h8300sn: + val = E_H8_MACH_H8300SN; break; } diff -r -p -u binutils-030205/gas/config/tc-h8300.c /home/dhananjayd/binutils-030205/gas/config/tc-h8300.c --- binutils-030205/gas/config/tc-h8300.c Wed Nov 20 04:26:42 2002 +++ /home/dhananjayd/binutils-030205/gas/config/tc-h8300.c Thu Feb 6 12:02:25 2003 @@ -42,10 +42,13 @@ void cons PARAMS ((int)); void sbranch PARAMS ((int)); void h8300hmode PARAMS ((int)); void h8300smode PARAMS ((int)); +void h8300hnmode PARAMS ((int)); +void h8300snmode PARAMS ((int)); static void pint PARAMS ((int)); int Hmode; int Smode; +int Nmode; #define PSIZE (Hmode ? L_32 : L_16) #define DMODE (L_16) @@ -77,6 +80,19 @@ h8300hmode (arg) } void +h8300hnmode (arg) + int arg ATTRIBUTE_UNUSED; +{ + Hmode = 1; + Smode = 0; + Nmode = 1; +#ifdef BFD_ASSEMBLER + if (!bfd_set_arch_mach (stdoutput, bfd_arch_h8300, bfd_mach_h8300hn)) + as_warn (_("could not set architecture and machine")); +#endif +} + +void h8300smode (arg) int arg ATTRIBUTE_UNUSED; { @@ -89,6 +105,19 @@ h8300smode (arg) } void +h8300snmode (arg) + int arg ATTRIBUTE_UNUSED; +{ + Smode = 1; + Hmode = 1; + Nmode = 1; +#ifdef BFD_ASSEMBLER + if (!bfd_set_arch_mach (stdoutput, bfd_arch_h8300, bfd_mach_h8300sn)) + as_warn (_("could not set architecture and machine")); +#endif +} + +void sbranch (size) int size; { @@ -111,7 +140,9 @@ pint (arg) const pseudo_typeS md_pseudo_table[] = { {"h8300h", h8300hmode, 0}, + {"h8300hn", h8300hnmode, 0}, {"h8300s", h8300smode, 0}, + {"h8300sn", h8300snmode, 0}, {"sbranch", sbranch, L_8}, {"lbranch", sbranch, L_16}, diff -r -p -u binutils-030205/gas/config/tc-h8300.h /home/dhananjayd/binutils-030205/gas/config/tc-h8300.h --- binutils-030205/gas/config/tc-h8300.h Tue Dec 17 06:43:55 2002 +++ /home/dhananjayd/binutils-030205/gas/config/tc-h8300.h Thu Feb 6 12:02:25 2003 @@ -45,7 +45,7 @@ struct internal_reloc; #define TC_COFF_FIX2RTYPE(fixP) abort (); #define BFD_ARCH bfd_arch_h8300 -#define COFF_MAGIC ( Smode ? 0x8302 : Hmode ? 0x8301 : 0x8300) +#define COFF_MAGIC ( Smode && Nmode ? 0x8304 : Hmode && Nmode ? 0x8303 : Smode ? 0x8302 : Hmode ? 0x8301 : 0x8300) #define TC_COUNT_RELOC(x) (1) #define IGNORE_NONSTANDARD_ESCAPES @@ -92,5 +92,6 @@ extern void tc_reloc_mangle extern int Hmode; extern int Smode; +extern int Nmode; #define md_operand(x) diff -r -p -u binutils-030205/include/coff/h8300.h /home/dhananjayd/binutils-030205/include/coff/h8300.h --- binutils-030205/include/coff/h8300.h Wed Mar 14 07:57:43 2001 +++ /home/dhananjayd/binutils-030205/include/coff/h8300.h Thu Feb 6 12:02:25 2003 @@ -22,10 +22,14 @@ #define H8300MAGIC 0x8300 #define H8300HMAGIC 0x8301 #define H8300SMAGIC 0x8302 +#define H8300HNMAGIC 0x8303 +#define H8300SNMAGIC 0x8304 #define H8300BADMAG(x) (((x).f_magic != H8300MAGIC)) #define H8300HBADMAG(x) (((x).f_magic != H8300HMAGIC)) #define H8300SBADMAG(x) (((x).f_magic != H8300SMAGIC)) +#define H8300HNBADMAG(x) (((x).f_magic != H8300HNMAGIC)) +#define H8300SNBADMAG(x) (((x).f_magic != H8300SNMAGIC)) /********************** RELOCATION DIRECTIVES **********************/ diff -r -p -u binutils-030205/include/elf/h8.h /home/dhananjayd/binutils-030205/include/elf/h8.h --- binutils-030205/include/elf/h8.h Wed Aug 29 22:53:39 2001 +++ /home/dhananjayd/binutils-030205/include/elf/h8.h Thu Feb 6 12:02:25 2003 @@ -92,5 +92,7 @@ END_RELOC_NUMBERS (R_H8_max) #define E_H8_MACH_H8300 0x00800000 #define E_H8_MACH_H8300H 0x00810000 #define E_H8_MACH_H8300S 0x00820000 +#define E_H8_MACH_H8300HN 0x00830000 +#define E_H8_MACH_H8300SN 0x00840000 #endif diff -r -p -u binutils-030205/ld/Makefile.am /home/dhananjayd/binutils-030205/ld/Makefile.am --- binutils-030205/ld/Makefile.am Tue Jan 21 22:39:46 2003 +++ /home/dhananjayd/binutils-030205/ld/Makefile.am Thu Feb 6 12:02:25 2003 @@ -194,9 +194,13 @@ ALL_EMULATIONS = \ eh8300.o \ eh8300h.o \ eh8300s.o \ + eh8300hn.o \ + eh8300sn.o \ eh8300elf.o \ eh8300helf.o \ eh8300self.o \ + eh8300hnelf.o \ + eh8300snelf.o \ eh8500.o \ eh8500b.o \ eh8500c.o \ @@ -811,6 +815,12 @@ eh8300h.c: $(srcdir)/emulparams/h8300h.s eh8300s.c: $(srcdir)/emulparams/h8300s.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300s.sc ${GEN_DEPENDS} ${GENSCRIPTS} h8300s "$(tdir_h8300s)" +eh8300hn.c: $(srcdir)/emulparams/h8300hn.sh \ + $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300hn.sc ${GEN_DEPENDS} + ${GENSCRIPTS} h8300hn "$(tdir_h8300hn)" +eh8300sn.c: $(srcdir)/emulparams/h8300sn.sh \ + $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300sn.sc ${GEN_DEPENDS} + ${GENSCRIPTS} h8300sn "$(tdir_h8300sn)" eh8300elf.c: $(srcdir)/emulparams/h8300elf.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} h8300elf "$(tdir_h8300elf)" @@ -822,6 +832,14 @@ eh8300self.c: $(srcdir)/emulparams/h8300 $(srcdir)/emulparams/h8300elf.sh \ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} ${GENSCRIPTS} h8300self "$(tdir_h8300self)" +eh8300hnelf.c: $(srcdir)/emulparams/h8300hnelf.sh \ + $(srcdir)/emulparams/h8300elf.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} h8300hnelf "$(tdir_h8300hnelf)" +eh8300snelf.c: $(srcdir)/emulparams/h8300snelf.sh \ + $(srcdir)/emulparams/h8300elf.sh \ + $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} + ${GENSCRIPTS} h8300snelf "$(tdir_h8300snelf)" eh8500.c: $(srcdir)/emulparams/h8500.sh \ $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500.sc ${GEN_DEPENDS} ${GENSCRIPTS} h8500 "$(tdir_h8500)" diff -r -p -u binutils-030205/ld/configure.tgt /home/dhananjayd/binutils-030205/ld/configure.tgt --- binutils-030205/ld/configure.tgt Tue Jan 21 21:38:31 2003 +++ /home/dhananjayd/binutils-030205/ld/configure.tgt Thu Feb 6 12:03:13 2003 @@ -258,11 +258,11 @@ thumb-*-pe) targ_emul=armpe ; xscale-*-coff) targ_emul=armcoff ;; xscale-*-elf) targ_emul=armelf ;; h8300-*-hms* | h8300-*-coff* | h8300-*-rtems*) - targ_emul=h8300; targ_extra_emuls="h8300h h8300s" + targ_emul=h8300; targ_extra_emuls="h8300h h8300s h8300hn h8300sn" ;; h8300-*-elf*) targ_emul=h8300elf; - targ_extra_emuls="h8300helf h8300self" + targ_extra_emuls="h8300helf h8300self h8300hnelf h8300snelf" ;; h8500-*-hms* | h8500-*-coff* | h8500-*-rtems*) targ_emul=h8500 --- /dev/null Wed May 6 02:02:27 1998 +++ binutils-030205/ld/emulparams/h8300hn.sh Mon Jan 27 12:45:36 2003 @@ -0,0 +1,5 @@ +SCRIPT_NAME=h8300hn +OUTPUT_FORMAT="coff-h8300" +TEXT_START_ADDR=0x8000 +TARGET_PAGE_SIZE=128 +ARCH=h8300 --- /dev/null Wed May 6 02:02:27 1998 +++ binutils-030205/ld/emulparams/h8300sn.sh Mon Jan 27 12:46:03 2003 @@ -0,0 +1,5 @@ +SCRIPT_NAME=h8300sn +OUTPUT_FORMAT="coff-h8300" +TEXT_START_ADDR=0x8000 +TARGET_PAGE_SIZE=128 +ARCH=h8300 --- /dev/null Wed May 6 02:02:27 1998 +++ binutils-030205/ld/emulparams/h8300hnelf.sh Mon Jan 27 12:46:58 2003 @@ -0,0 +1,2 @@ +. ${srcdir}/emulparams/h8300elf.sh +ARCH="h8300:h8300hn" --- /dev/null Wed May 6 02:02:27 1998 +++ binutils-030205/ld/emulparams/h8300snelf.sh Mon Jan 27 12:47:21 2003 @@ -0,0 +1,2 @@ +. ${srcdir}/emulparams/h8300elf.sh +ARCH="h8300:h8300sn" --- /dev/null Wed May 6 02:02:27 1998 +++ binutils-030205/ld/scripttempl/h8300hn.sc Mon Jan 27 12:52:31 2003 @@ -0,0 +1,87 @@ +TORS=".tors : + { + ___ctors = . ; + *(.ctors) + ___ctors_end = . ; + ___dtors = . ; + *(.dtors) + ___dtors_end = . ; + } > ram" + +cat < vectors} + +.text : + { + *(.rodata) + *(.text) + *(.strings) + ${RELOCATING+ _etext = . ; } + } ${RELOCATING+ > ram} + +${CONSTRUCTING+${TORS}} + +.data : + { + *(.data) + *(.tiny) + ${RELOCATING+ _edata = . ; } + } ${RELOCATING+ > ram} + +.bss : + { + ${RELOCATING+ _bss_start = . ;} + *(.bss) + *(COMMON) + ${RELOCATING+ _end = . ; } + } ${RELOCATING+ >ram} + +.stack : + { + ${RELOCATING+ _stack = . ; } + *(.stack) + } ${RELOCATING+ > topram} + +.eight : + { + *(.eight) + } ${RELOCATING+ > eight} + +.stab 0 ${RELOCATING+(NOLOAD)} : + { + [ .stab ] + } + +.stabstr 0 ${RELOCATING+(NOLOAD)} : + { + [ .stabstr ] + } +} +EOF --- /dev/null Wed May 6 02:02:27 1998 +++ binutils-030205/ld/scripttempl/h8300sn.sc Mon Jan 27 12:55:28 2003 @@ -0,0 +1,87 @@ +TORS=".tors : + { + ___ctors = . ; + *(.ctors) + ___ctors_end = . ; + ___dtors = . ; + *(.dtors) + ___dtors_end = . ; + } > ram" + +cat < vectors} + +.text : + { + *(.rodata) + *(.text) + *(.strings) + ${RELOCATING+ _etext = . ; } + } ${RELOCATING+ > ram} + +${CONSTRUCTING+${TORS}} + +.data : + { + *(.data) + *(.tiny) + ${RELOCATING+ _edata = . ; } + } ${RELOCATING+ > ram} + +.bss : + { + ${RELOCATING+ _bss_start = . ;} + *(.bss) + *(COMMON) + ${RELOCATING+ _end = . ; } + } ${RELOCATING+ >ram} + +.stack : + { + ${RELOCATING+ _stack = . ; } + *(.stack) + } ${RELOCATING+ > topram} + +.eight : + { + *(.eight) + } ${RELOCATING+ > eight} + +.stab 0 ${RELOCATING+(NOLOAD)} : + { + [ .stab ] + } + +.stabstr 0 ${RELOCATING+(NOLOAD)} : + { + [ .stabstr ] + } +} +EOF