This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch to add h8300sxn target


Following on from Dhananjay's recent patch to add normal-mode
h8300s and h8300h targets, this patch adds one for h8300sx as well.
All boiler-plate stuff, nothing remotely interesting.

Tested on h8300-elf.  OK to install?

Richard


include/elf/
	* h8.h (E_H8_MACH_H8300SXN): New flag.

bfd/
	* archures.c (bfd_mach_h8300sxn): New architecture.
	* bfd-in2.h: Regenerate.
	* cpu-h8300.c (h8300_scan): Check for 'sxn'.
	(compatible): Allow h8300sn and h8300sxn code to be linked together,
	treating the result as h8300sxn code.
	(h8300sxn_info_struct): New.
	(h8300sx_info_struct): Link to it.
	* elf32-h8300.c (elf32_h8_mach): Add h8300sxn case.
	(elf32_h8_final_write_processing): Likewise.

gas/
	* config/tc-h8sx.c (h8300sxnmode): New.
	(md_pseudo_table): Add .h8300sxn entry.  Sync others with FSF version.

ld/
	* configure.tgt (h8300*): Add h8300sxn emulations.
	* Makefile.am (ALL_EMULATIONS): Add eh8300sxn.o and eh8300sxnelf.o.
	(eh8300sxn.c, eh8300sxnelf.c): New rules.
	* Makefile.in: Regenerate.
	* emulparams/h8300sxnelf.sh, emulparams/h8300sxn.sh: New files.

Index: include/elf/h8.h
===================================================================
RCS file: /cvs/src/src/include/elf/h8.h,v
retrieving revision 1.4
diff -c -d -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.4 h8.h
*** include/elf/h8.h	16 May 2003 23:40:08 -0000	1.4
--- include/elf/h8.h	9 Jun 2003 07:49:47 -0000
*************** #define E_H8_MACH_H8300S	0x00820000
*** 95,99 ****
--- 95,100 ----
  #define E_H8_MACH_H8300HN	0x00830000
  #define E_H8_MACH_H8300SN	0x00840000
  #define E_H8_MACH_H8300SX	0x00850000
+ #define E_H8_MACH_H8300SXN	0x00860000
  
  #endif
Index: bfd/archures.c
===================================================================
RCS file: /cvs/src/src/bfd/archures.c,v
retrieving revision 1.75
diff -c -d -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.75 archures.c
*** bfd/archures.c	16 May 2003 23:39:23 -0000	1.75
--- bfd/archures.c	9 Jun 2003 07:49:47 -0000
*************** DESCRIPTION
*** 170,175 ****
--- 170,176 ----
  .#define bfd_mach_h8300hn  4
  .#define bfd_mach_h8300sn  5
  .#define bfd_mach_h8300sx  6
+ .#define bfd_mach_h8300sxn 7
  .  bfd_arch_pdp11,     {* DEC PDP-11 *}
  .  bfd_arch_powerpc,   {* PowerPC *}
  .#define bfd_mach_ppc		32
Index: bfd/bfd-in2.h
===================================================================
RCS file: /cvs/src/src/bfd/bfd-in2.h,v
retrieving revision 1.219
diff -c -d -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.219 bfd-in2.h
*** bfd/bfd-in2.h	8 Jun 2003 14:06:38 -0000	1.219
--- bfd/bfd-in2.h	9 Jun 2003 07:49:49 -0000
*************** #define bfd_mach_h8300s   3
*** 1654,1659 ****
--- 1654,1660 ----
  #define bfd_mach_h8300hn  4
  #define bfd_mach_h8300sn  5
  #define bfd_mach_h8300sx  6
+ #define bfd_mach_h8300sxn 7
    bfd_arch_pdp11,     /* DEC PDP-11 */
    bfd_arch_powerpc,   /* PowerPC */
  #define bfd_mach_ppc           32
Index: bfd/cpu-h8300.c
===================================================================
RCS file: /cvs/src/src/bfd/cpu-h8300.c,v
retrieving revision 1.13
diff -c -d -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.13 cpu-h8300.c
*** bfd/cpu-h8300.c	16 May 2003 23:39:24 -0000	1.13
--- bfd/cpu-h8300.c	9 Jun 2003 07:49:49 -0000
*************** h8300_scan (info, string)
*** 82,88 ****
  	return (info->mach == bfd_mach_h8300sn);
  
        if (*string == 'x' || *string == 'X')
! 	return (info->mach == bfd_mach_h8300sx);
        
        return (info->mach == bfd_mach_h8300s);
      }
--- 82,94 ----
  	return (info->mach == bfd_mach_h8300sn);
  
        if (*string == 'x' || *string == 'X')
! 	{
! 	  string++;
! 	  if (*string == 'n' || *string == 'N')
! 	    return (info->mach == bfd_mach_h8300sxn);
! 
! 	  return (info->mach == bfd_mach_h8300sx);
! 	}
        
        return (info->mach == bfd_mach_h8300s);
      }
*************** compatible (in, out)
*** 106,111 ****
--- 112,133 ----
      return in;
  }
  
+ static const bfd_arch_info_type h8300sxn_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_h8300sxn,
+   "h8300sxn",			/* arch_name  */
+   "h8300sxn",			/* printable name */
+   1,
+   FALSE,			/* the default machine */
+   compatible,
+   h8300_scan,
+   0
+ };
+ 
  static const bfd_arch_info_type h8300sx_info_struct =
  {
    32,				/* 32 bits in a word */
*************** static const bfd_arch_info_type h8300sx_
*** 119,125 ****
    FALSE,			/* the default machine */
    compatible,
    h8300_scan,
!   0
  };
  
  static const bfd_arch_info_type h8300sn_info_struct =
--- 141,147 ----
    FALSE,			/* the default machine */
    compatible,
    h8300_scan,
!   &h8300sxn_info_struct
  };
  
  static const bfd_arch_info_type h8300sn_info_struct =
Index: bfd/elf32-h8300.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-h8300.c,v
retrieving revision 1.26
diff -c -d -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.26 elf32-h8300.c
*** bfd/elf32-h8300.c	16 May 2003 23:39:24 -0000	1.26
--- bfd/elf32-h8300.c	9 Jun 2003 07:49:49 -0000
*************** elf32_h8_mach (flags)
*** 582,587 ****
--- 582,590 ----
  
      case E_H8_MACH_H8300SX:
        return bfd_mach_h8300sx;
+ 
+     case E_H8_MACH_H8300SXN:
+       return bfd_mach_h8300sxn;
      }
  }
  
*************** elf32_h8_final_write_processing (abfd, l
*** 621,626 ****
--- 624,633 ----
  
      case bfd_mach_h8300sx:
        val = E_H8_MACH_H8300SX;
+       break;
+ 
+     case bfd_mach_h8300sxn:
+       val = E_H8_MACH_H8300SXN;
        break;
      }
  
Index: gas/config/tc-h8300.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-h8300.c,v
retrieving revision 1.30
diff -c -d -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.30 tc-h8300.c
*** gas/config/tc-h8300.c	5 Jun 2003 18:53:35 -0000	1.30
--- gas/config/tc-h8300.c	9 Jun 2003 07:49:49 -0000
*************** h8300sxmode (arg)
*** 137,142 ****
--- 137,156 ----
  }
  
  void
+ h8300sxnmode (arg)
+      int arg ATTRIBUTE_UNUSED;
+ {
+   Smode = 1;
+   Hmode = 1;
+   SXmode = 1;
+   Nmode = 1;
+ #ifdef BFD_ASSEMBLER
+   if (!bfd_set_arch_mach (stdoutput, bfd_arch_h8300, bfd_mach_h8300sxn))
+     as_warn (_("could not set architecture and machine"));
+ #endif
+ }
+ 
+ void
  sbranch (size)
       int size;
  {
*************** const pseudo_typeS md_pseudo_table[] =
*** 163,168 ****
--- 177,183 ----
    {"h8300s",  h8300smode,  0},
    {"h8300sn", h8300snmode, 0},
    {"h8300sx", h8300sxmode, 0},
+   {"h8300sxn", h8300sxnmode, 0},
    {"sbranch", sbranch, L_8},
    {"lbranch", sbranch, L_16},
  
Index: ld/configure.tgt
===================================================================
RCS file: /cvs/src/src/ld/configure.tgt,v
retrieving revision 1.129
diff -c -d -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.129 configure.tgt
*** ld/configure.tgt	3 Jun 2003 21:43:51 -0000	1.129
--- ld/configure.tgt	9 Jun 2003 07:49:50 -0000
*************** thumb-*-pe)		targ_emul=armpe ;
*** 263,273 ****
  xscale-*-coff)		targ_emul=armcoff ;;
  xscale-*-elf)		targ_emul=armelf ;;
  h8300-*-hms* | h8300-*-coff* | h8300-*-rtems*)
! 			targ_emul=h8300; targ_extra_emuls="h8300h h8300s h8300hn h8300sn h8300sx"
  			;;
  h8300-*-elf*)
  			targ_emul=h8300elf;
! 			targ_extra_emuls="h8300helf h8300self h8300hnelf h8300snelf h8300sxelf"
  			;;
  h8500-*-hms* | h8500-*-coff* | h8500-*-rtems*)
  			targ_emul=h8500
--- 263,273 ----
  xscale-*-coff)		targ_emul=armcoff ;;
  xscale-*-elf)		targ_emul=armelf ;;
  h8300-*-hms* | h8300-*-coff* | h8300-*-rtems*)
! 			targ_emul=h8300; targ_extra_emuls="h8300h h8300s h8300hn h8300sn h8300sx h8300sxn"
  			;;
  h8300-*-elf*)
  			targ_emul=h8300elf;
! 			targ_extra_emuls="h8300helf h8300self h8300hnelf h8300snelf h8300sxelf h8300sxnelf"
  			;;
  h8500-*-hms* | h8500-*-coff* | h8500-*-rtems*)
  			targ_emul=h8500
Index: ld/Makefile.am
===================================================================
RCS file: /cvs/src/src/ld/Makefile.am,v
retrieving revision 1.132
diff -c -d -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.132 Makefile.am
*** ld/Makefile.am	3 Jun 2003 21:43:51 -0000	1.132
--- ld/Makefile.am	9 Jun 2003 07:49:50 -0000
*************** ALL_EMULATIONS = \
*** 206,211 ****
--- 206,213 ----
  	eh8300hnelf.o \
  	eh8300snelf.o \
  	eh8300sxelf.o \
+ 	eh8300sxn.o \
+ 	eh8300sxnelf.o \
  	eh8500.o \
  	eh8500b.o \
  	eh8500c.o \
*************** eh8300sn.c: $(srcdir)/emulparams/h8300sn
*** 847,852 ****
--- 849,857 ----
  eh8300sx.c: $(srcdir)/emulparams/h8300sx.sh \
    $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300sx.sc ${GEN_DEPENDS}
  	${GENSCRIPTS} h8300sx "$(tdir_h8300sx)"
+ eh8300sxn.c: $(srcdir)/emulparams/h8300sxn.sh \
+   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300sxn.sc ${GEN_DEPENDS}
+ 	${GENSCRIPTS} h8300sxn "$(tdir_h8300sxn)"
  eh8300elf.c: $(srcdir)/emulparams/h8300elf.sh \
    $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
  	${GENSCRIPTS} h8300elf "$(tdir_h8300elf)"
*************** eh8300sxelf.c: $(srcdir)/emulparams/h830
*** 870,875 ****
--- 875,884 ----
    $(srcdir)/emulparams/h8300elf.sh \
    $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
  	${GENSCRIPTS} h8300sxelf "$(tdir_h8300sxelf)"
+ eh8300sxnelf.c: $(srcdir)/emulparams/h8300sxnelf.sh \
+   $(srcdir)/emulparams/h8300elf.sh \
+   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ 	${GENSCRIPTS} h8300sxnelf "$(tdir_h8300sxnelf)"
  eh8500.c: $(srcdir)/emulparams/h8500.sh \
    $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500.sc ${GEN_DEPENDS}
  	${GENSCRIPTS} h8500 "$(tdir_h8500)"
*** /dev/null	Thu Apr 11 15:25:15 2002
--- ld/emulparams/h8300sxnelf.sh	Mon Jun  9 08:40:34 2003
***************
*** 0 ****
--- 1,2 ----
+ . ${srcdir}/emulparams/h8300elf.sh
+ ARCH="h8300:h8300sxn"
*** /dev/null	Thu Apr 11 15:25:15 2002
--- ld/emulparams/h8300sxn.sh	Mon Jun  9 08:40:34 2003
***************
*** 0 ****
--- 1,5 ----
+ SCRIPT_NAME=h8300sxn
+ OUTPUT_FORMAT="coff-h8300"
+ TEXT_START_ADDR=0x8000
+ TARGET_PAGE_SIZE=128
+ ARCH=h8300


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]