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] New targets for H8300H and H8300S Normal mode


Hi,

With reference to discussion on  this subject at
http://sources.redhat.com/ml/binutils/2003-01/msg00059.html I am submitting 
a patch to add normal mode targets of H8300H and H8S. 
I have attached as well as inlined the changelog and diff files. 

As GCC and Newlib patches are dependant on Binutils, I am including those in one email. 

Regards,
Dhananjay

Binutils Changelog - 

include/ChangeLog 
2003-02-12 Dhananjay Deshpande <dhananjayd@kpit.com> 

	* coff/h8300.h (H8300HNMAGIC, H8300SNMAGIC): New.
	(H8300HNBADMAG, H8300SNBADMAG): New.
	* elf/h8.h (E_H8_MACH_H8300HN, E_H8_MACH_H8300SN): New

bfd/ChangeLog 
2003-02-12 Dhananjay Deshpande <dhananjayd@kpit.com> 

	* archures.c (bfd_mach_h8300hn, bfd_mach_h8300sn): Added.
	* bfd-in2.h: Rebuilt.
	* coff-h8300.c (BADMAG): Add check for H8300HNBADMAG & H8300SNBADMAG.
	* coffcode.h (coff_set_arch_mach_hook): Add case for H8300HNMAGIC 
	& H8300SNMAGIC.
	(coff_set_flags): Add case for bfd_mach_h8300hn & bfd_mach_h8300sn.
	* cpu-h8300.c (h8300_scan): Handle h8300hn, h8300sn.
	(h8300sn_info_struct, h8300hn_info_struct): New.
	* elf32-h8300.c (elf32_h8_mach): Handle case for h8300hn & h8300sn
	(elf32_h8_final_write_processing): Likewise.

gas/ChangeLog 
2003-02-12 Dhananjay Deshpande <dhananjayd@kpit.com> 

	* config/tc-h8300.c (Nmode, h8300hnmode, h8300snmode): New.
	(md_pseudo_table): Add h8300hn, h8300sn.
	* config/tc-h8300.h (COFF_MAGIC): Handle h8300hn, h8300sn.

ld/ChangeLog 
2003-02-12 Dhananjay Deshpande <dhananjayd@kpit.com> 
	
	* Makefile.am (ALL_EMULATIONS): Add eh8300hn.o, eh8300sn.o, 
	eh8300hnelf.o, eh8300snelf.o and respective rules.
	* Makefile.in: Regenerate.
	* configure.tgt: Add h8300hn, h8300sn, h8300hnelf, h8300snelf
	* emulparams/h8300hn.sh: New
	* emulparams/h8300sn.sh: New
	* emulparams/h8300hnelf.sh: New	
	* emulparams/h8300snelf.sh: New
	* scripttempl/h8300hn.sc: new
	* scripttempl/h8300sn.sc: new

==============================================================================
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 <<EOF
+OUTPUT_FORMAT("${OUTPUT_FORMAT}")
+OUTPUT_ARCH(h8300hn)
+ENTRY("_start")
+
+MEMORY
+{
+	/* 0xc4 is a magic entry.  We should have the linker just
+	   skip over it one day...  */
+	vectors : o = 0x0000, l = 0xc4
+	magicvectors : o = 0xc4, l = 0x3c
+	ram    : o = 0x0100, l = 0xfdfc
+	/* The stack starts at the top of main ram.  */
+	topram : o = 0xfefc, l = 0x4
+	/* At the very top of the address space is the 8-bit area.  */
+	eight : o = 0xff00, l = 0x100
+}
+
+SECTIONS
+{
+.vectors :
+	{
+	  /* Use something like this to place a specific
+	     function's address into the vector table.
+
+	     SHORT (ABSOLUTE (_foobar)).  */
+
+	  *(.vectors)
+	} ${RELOCATING+ > 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 <<EOF
+OUTPUT_FORMAT("${OUTPUT_FORMAT}")
+OUTPUT_ARCH(h8300sn)
+ENTRY("_start")
+
+MEMORY
+{
+	/* 0xc4 is a magic entry.  We should have the linker just
+	   skip over it one day...  */
+	vectors : o = 0x0000, l = 0xc4
+	magicvectors : o = 0xc4, l = 0x3c
+	ram    : o = 0x0100, l = 0xfdfc
+	/* The stack starts at the top of main ram.  */
+	topram : o = 0xfefc, l = 0x4
+	/* At the very top of the address space is the 8-bit area.  */
+	eight : o = 0xff00, l = 0x100
+}
+
+SECTIONS
+{
+.vectors :
+	{
+	  /* Use something like this to place a specific
+	     function's address into the vector table.
+
+	     SHORT (ABSOLUTE (_foobar)).  */
+
+	  *(.vectors)
+	} ${RELOCATING+ > 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

==============================================================================

GCC Changelog - 

2003-02-12 Dhananjay Deshpande <dhananjayd@kpit.com> 

	* config/h8300/crti.asm: Use .h8300hn and .h8300sn for normal mode
	* config/h8300/crtn.asm: Likewise
	* config/h8300/lib1funcs.asm: Likewise
	* config/h8300/h8300.c (asm_file_start): Likewise
	* config/h8300/elf.h (LINK_SPEC): Use h8300hnelf and h8300snelf 
	emulations for normal mode
	* config/h8300/h8300.h (LINK_SPEC): Use h8300hn and h8300sn emulations 
	for normal mode

============================================================================
diff -up -r h8300.old/crti.asm h8300/crti.asm
--- h8300.old/crti.asm	Fri Feb  7 12:18:45 2003
+++ h8300/crti.asm	Fri Feb  7 12:19:35 2003
@@ -38,11 +38,19 @@ Boston, MA 02111-1307, USA.  */
    such object files.  */
 
 #ifdef __H8300H__
+#ifdef __NORMAL_MODE__
+	.h8300hn
+#else
 	.h8300h
 #endif
+#endif
 
 #ifdef __H8300S__
+#ifdef __NORMAL_MODE__
+	.h8300sn
+#else
 	.h8300s
+#endif
 #endif
 
 	.section .init
diff -up -r h8300.old/crtn.asm h8300/crtn.asm
--- h8300.old/crtn.asm	Fri Feb  7 12:18:45 2003
+++ h8300/crtn.asm	Fri Feb  7 12:19:35 2003
@@ -30,11 +30,19 @@ Boston, MA 02111-1307, USA.  */
 /* See an explanation about .init and .fini in crti.asm.  */
 
 #ifdef __H8300H__
+#ifdef __NORMAL_MODE__
+	.h8300hn
+#else
 	.h8300h
 #endif
+#endif
 
 #ifdef __H8300S__
+#ifdef __NORMAL_MODE__
+	.h8300sn
+#else
 	.h8300s
+#endif
 #endif
 	.section .init
 	rts
diff -up -r h8300.old/elf.h h8300/elf.h
--- h8300.old/elf.h	Fri Feb  7 12:18:45 2003
+++ h8300/elf.h	Fri Feb  7 12:19:35 2003
@@ -51,4 +51,4 @@
 #define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
 
 #undef LINK_SPEC
-#define LINK_SPEC "%{mh:-m h8300helf} %{ms:-m h8300self}"
+#define LINK_SPEC "%{mh:%{mn:-m h8300hnelf}} %{mh:%{!mn:-m h8300helf}} %{ms:%{mn:-m h8300snelf}} %{ms:%{!mn:-m h8300self}}"
diff -up -r h8300.old/h8300.c h8300/h8300.c
--- h8300.old/h8300.c	Fri Feb  7 12:18:45 2003
+++ h8300/h8300.c	Fri Feb  7 12:19:35 2003
@@ -698,9 +698,15 @@ asm_file_start (file)
   else if (optimize)
     fprintf (file, "; -O%d\n", optimize);
   if (TARGET_H8300H)
-    fprintf (file, "\n\t.h8300h\n");
+    if (TARGET_NORMAL_MODE)
+      fprintf (file, "\n\t.h8300hn\n");
+    else
+      fprintf (file, "\n\t.h8300h\n");
   else if (TARGET_H8300S)
-    fprintf (file, "\n\t.h8300s\n");
+    if (TARGET_NORMAL_MODE)
+      fprintf (file, "\n\t.h8300sn\n");
+    else
+      fprintf (file, "\n\t.h8300s\n");
   else
     fprintf (file, "\n\n");
   output_file_directive (file, main_input_filename);
diff -up -r h8300.old/h8300.h h8300/h8300.h
--- h8300.old/h8300.h	Fri Feb  7 12:18:45 2003
+++ h8300/h8300.h	Fri Feb  7 12:19:35 2003
@@ -70,7 +70,7 @@ extern const char * const *h8_reg_names;
     }							\
   while (0)
 
-#define LINK_SPEC "%{mh:-m h8300h} %{ms:-m h8300s}"
+#define LINK_SPEC "%{mh:%{mn:-m h8300hn}} %{mh:%{!mn:-m h8300h}} %{ms:%{mn:-m h8300sn}} %{ms:%{!mn:-m h8300s}}"
 
 #define LIB_SPEC "%{mrelax:-relax} %{g:-lg} %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}"
 
diff -up -r h8300.old/lib1funcs.asm h8300/lib1funcs.asm
--- h8300.old/lib1funcs.asm	Fri Feb  7 12:18:45 2003
+++ h8300/lib1funcs.asm	Fri Feb  7 12:19:35 2003
@@ -96,11 +96,19 @@ Boston, MA 02111-1307, USA.  */
 #endif
 
 #ifdef __H8300H__
+#ifdef __NORMAL_MODE__
+	.h8300hn
+#else
 	.h8300h
 #endif
+#endif
 
 #ifdef __H8300S__
+#ifdef __NORMAL_MODE__
+	.h8300sn
+#else
 	.h8300s
+#endif
 #endif
 
 #ifdef L_cmpsi2
============================================================================

Newlib Changelog - 

2003-02-12 Dhananjay Deshpande <dhananjayd@kpit.com> 

	* newlib/libc/machine/h8300/memcpy.S: Use .h8300hn and .h8300sn for 
	normal mode
	* newlib/libc/machine/h8300/memset.S: Likewise
	* newlib/lib/machine/h8300/reg_memcpy.S: Likewise
	* newlib/lib/machine/h8300/reg_memset.S: Likewise
	* newlib/lib/machine/h8300/setjmp.S: Likewise
	* newlib/lib/machine/h8300/strcmp.S: Likewise
	* newlib/lib/sys/h8300hms/crt0.S: Likewise

==============================================================================
diff -uprN newlib.old/libc/machine/h8300/memcpy.S newlib/libc/machine/h8300/memcpy.S
--- newlib.old/libc/machine/h8300/memcpy.S	Wed Feb 12 11:44:59 2003
+++ newlib/libc/machine/h8300/memcpy.S	Wed Feb 12 11:45:18 2003
@@ -1,11 +1,19 @@
 #include "defines.h"
 
 #ifdef __H8300H__
+#ifdef __NORMAL_MODE__
+	.h8300hn
+#else
 	.h8300h
 #endif
+#endif
 
 #ifdef __H8300S__
+#ifdef __NORMAL_MODE__
+	.h8300sn
+#else
 	.h8300s
+#endif
 #endif
 
 	.global _memcpy
diff -uprN newlib.old/libc/machine/h8300/memset.S newlib/libc/machine/h8300/memset.S
--- newlib.old/libc/machine/h8300/memset.S	Wed Feb 12 11:44:59 2003
+++ newlib/libc/machine/h8300/memset.S	Wed Feb 12 11:45:18 2003
@@ -1,11 +1,19 @@
 #include "defines.h"
 
 #ifdef __H8300H__
+#ifdef __NORMAL_MODE__
+	.h8300hn
+#else
 	.h8300h
 #endif
+#endif
 
 #ifdef __H8300S__
+#ifdef __NORMAL_MODE__
+	.h8300sn
+#else
 	.h8300s
+#endif
 #endif
 
 
diff -uprN newlib.old/libc/machine/h8300/reg_memcpy.S newlib/libc/machine/h8300/reg_memcpy.S
--- newlib.old/libc/machine/h8300/reg_memcpy.S	Wed Feb 12 11:44:59 2003
+++ newlib/libc/machine/h8300/reg_memcpy.S	Wed Feb 12 11:45:18 2003
@@ -1,11 +1,19 @@
 #include "defines.h"
 
 #ifdef __H8300H__
+#ifdef __NORMAL_MODE__
+	.h8300hn
+#else
 	.h8300h
 #endif
+#endif
 
 #ifdef __H8300S__
+#ifdef __NORMAL_MODE__
+	.h8300sn
+#else
 	.h8300s
+#endif
 #endif
 
 
diff -uprN newlib.old/libc/machine/h8300/reg_memset.S newlib/libc/machine/h8300/reg_memset.S
--- newlib.old/libc/machine/h8300/reg_memset.S	Wed Feb 12 11:44:59 2003
+++ newlib/libc/machine/h8300/reg_memset.S	Wed Feb 12 11:45:18 2003
@@ -1,11 +1,19 @@
 #include "defines.h"
 
 #ifdef __H8300H__
+#ifdef __NORMAL_MODE__
+	.h8300hn
+#else
 	.h8300h
 #endif
+#endif
 
 #ifdef __H8300S__
+#ifdef __NORMAL_MODE__
+	.h8300sn
+#else
 	.h8300s
+#endif
 #endif
 
 
diff -uprN newlib.old/libc/machine/h8300/setjmp.S newlib/libc/machine/h8300/setjmp.S
--- newlib.old/libc/machine/h8300/setjmp.S	Wed Feb 12 11:44:59 2003
+++ newlib/libc/machine/h8300/setjmp.S	Wed Feb 12 11:45:18 2003
@@ -1,25 +1,40 @@
 	.file "setjmp.S"
 
 #ifdef __H8300H__
+#ifdef __NORMAL_MODE__
+	.h8300hn
+#else
 	.h8300h
 #endif
+#endif
 
 #ifdef __H8300S__
+#ifdef __NORMAL_MODE__
+	.h8300sn
+#else
 	.h8300s
 #endif
+#endif
 
 	.section .text
 	.align	2
 	.global	_setjmp
 _setjmp:
-#if defined(__H8300H__) || defined(__H8300S__)
+#ifdef __H8300H__
+	mov.l	er7,@er0
+	mov.l	er6,@(4,er0)
+	mov.l	er5,@(8,er0)
+	mov.l	er4,@(12,er0)
+	mov.l	@sp,er1
+	mov.l	er1,@(16,er0)
+#else
+#ifdef __H8300S__
 	mov.l	er7,@er0
 	mov.l	er6,@(4,er0)
 	mov.l	er5,@(8,er0)
 	mov.l	er4,@(12,er0)
 	mov.l	@sp,er1
 	mov.l	er1,@(16,er0)
-	sub.l   er0,er0
 #else
 	mov.w	r7,@r0
 	mov.w	r6,@(2,r0)
@@ -27,27 +42,28 @@ _setjmp:
 	mov.w	r4,@(6,r0)
 	mov.w   @sp,r1
 	mov.w	r1,@(8,r0)
-	sub.w	r0,r0
 #endif
+#endif
+	sub.w	r0,r0
 	rts
 
 	.global	_longjmp
 _longjmp:
-#if defined(__H8300H__) || defined (__H8300S__)
+#ifdef __H8300H__
 	mov.l	@er0+,er7
 	mov.l	@er0+,er6
 	mov.l	@er0+,er5
 	mov.l	@er0+,er4
 	mov.l	@er0,er2
 	mov.l	er2,@sp
-#if (__INT_MAX__ <= 32767)
-	mov.w	r1,r0
 #else
-	mov.l   er1,er0
-#endif
-	bne	.L1
-	sub	er0,er0
-	adds	#1,er0
+#ifdef __H8300S__
+	mov.l	@er0+,er7
+	mov.l	@er0+,er6
+	mov.l	@er0+,er5
+	mov.l	@er0+,er4
+	mov.l	@er0,er2
+	mov.l	er2,@sp
 #else
 	mov.w	@r0+,r7
 	mov.w	@r0+,r6
@@ -55,9 +71,10 @@ _longjmp:
 	mov.w	@r0+,r4
 	mov.w	@r0,r2
 	mov.w	r2,@sp
+#endif
+#endif
 	mov.w	r1,r0
 	bne	.L1
 	mov.w	#1,r0
-#endif
 .L1:
 	rts
diff -uprN newlib.old/libc/machine/h8300/strcmp.S newlib/libc/machine/h8300/strcmp.S
--- newlib.old/libc/machine/h8300/strcmp.S	Wed Feb 12 11:44:59 2003
+++ newlib/libc/machine/h8300/strcmp.S	Wed Feb 12 11:45:18 2003
@@ -1,11 +1,19 @@
 #include "defines.h"
 
 #ifdef __H8300H__
+#ifdef __NORMAL_MODE__
+	.h8300hn
+#else
 	.h8300h
 #endif
+#endif
 
 #ifdef __H8300S__
+#ifdef __NORMAL_MODE__
+	.h8300sn
+#else
 	.h8300s
+#endif
 #endif
 
 	.section .text
diff -uprN newlib.old/libc/sys/h8300hms/crt0.S newlib/libc/sys/h8300hms/crt0.S
--- newlib.old/libc/sys/h8300hms/crt0.S	Wed Feb 12 11:44:59 2003
+++ newlib/libc/sys/h8300hms/crt0.S	Wed Feb 12 11:45:18 2003
@@ -30,7 +30,11 @@ _stack:	.word 	1
 
 #ifdef __H8300H__
 
+#ifdef __NORMAL_MODE__
+	.h8300hn
+#else
 	.h8300h
+#endif
 	.section .text
 	.global	_start
 _start:
@@ -58,8 +62,11 @@ _stack:	.long 	1
 #endif
 
 #ifdef __H8300S__
-
+#ifdef __NORMAL_MODE__
+	.h8300sn
+#else
 	.h8300s
+#endif
 	.section .text
 	.global	_start
 _start:
==============================================================================

Attachment: normal.binutils.diff
Description: normal.binutils.diff

Attachment: binutils.changelog
Description: binutils.changelog

Attachment: normal.gcc.diff
Description: normal.gcc.diff

Attachment: newlib.changelog
Description: newlib.changelog

Attachment: normal.newlib.diff
Description: normal.newlib.diff

Attachment: gcc.changelog
Description: gcc.changelog


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