This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[BFD] Add Hitachi/Renesas h8300sx target
- From: Michael Snyder <msnyder at redhat dot com>
- To: binutils at sources dot redhat dot com
- Cc: nickc at redhat dot com, dvenkat at noida dot hcltech dot com, kazu at cs dot umass dot edu, msnyder at redhat dot com
- Date: Thu, 15 May 2003 15:23:53 -0700
- Subject: [BFD] Add Hitachi/Renesas h8300sx target
- Organization: Red Hat, Inc.
This patch adds a bfd target for the h8300sx version of the Hitachi
(now Renesas) h8/300 architecture. Patches for gas/sim/ld will follow.
bfd:
2003-05-14 Michael Snyder <msnyder@redhat.com>
From Bernd Schmidt <bernds@redhat.com>
* archures.c (bfd_mach_h8300sx): New.
* bfd-in2.h: Regenerate.
* cpu-h8300.c (h8300_scan)): Add support for h8300sx.
(h8300sx_info_struct): New.
(h8300s_info_struct): Link to it.
* elf32-h8300.c (elf32_h8_mach): Add support for h8300sx.
(elf32_h8_final_write_processing): Likewise.
(elf32_h8_relax_section): Likewise.
include/elf:
2003-05-14 Michael Snyder <msnyder@redhat.com>
From Bernd Schmidt <bernds@redhat.com>
* h8.h (E_H8_MACH_H8300SX): New.
Index: bfd/archures.c
===================================================================
RCS file: /cvs/src/src/bfd/archures.c,v
retrieving revision 1.74
diff -p -r1.74 archures.c
*** bfd/archures.c 24 Apr 2003 12:36:06 -0000 1.74
--- bfd/archures.c 14 May 2003 17:58:11 -0000
*************** DESCRIPTION
*** 169,174 ****
--- 169,175 ----
.#define bfd_mach_h8300s 3
.#define bfd_mach_h8300hn 4
.#define bfd_mach_h8300sn 5
+ .#define bfd_mach_h8300sx 6
. 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.215
diff -p -r1.215 bfd-in2.h
*** bfd/bfd-in2.h 9 May 2003 02:26:59 -0000 1.215
--- bfd/bfd-in2.h 14 May 2003 17:58:13 -0000
*************** enum bfd_architecture
*** 1635,1640 ****
--- 1635,1641 ----
#define bfd_mach_h8300s 3
#define bfd_mach_h8300hn 4
#define bfd_mach_h8300sn 5
+ #define bfd_mach_h8300sx 6
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.12
diff -p -r1.12 cpu-h8300.c
*** bfd/cpu-h8300.c 24 Apr 2003 12:36:06 -0000 1.12
--- bfd/cpu-h8300.c 14 May 2003 17:58:13 -0000
*************** h8300_scan (info, string)
*** 81,86 ****
--- 81,89 ----
if (*string == 'n' || *string == 'N')
return (info->mach == bfd_mach_h8300sn);
+ if (*string == 'x' || *string == 'X')
+ return (info->mach == bfd_mach_h8300sx);
+
return (info->mach == bfd_mach_h8300s);
}
else
*************** compatible (in, out)
*** 103,108 ****
--- 106,127 ----
return in;
}
+ static const bfd_arch_info_type h8300sx_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_h8300sx,
+ "h8300sx", /* arch_name */
+ "h8300sx", /* printable name */
+ 1,
+ FALSE, /* the default machine */
+ compatible,
+ h8300_scan,
+ 0
+ };
+
static const bfd_arch_info_type h8300sn_info_struct =
{
32, /* 32 bits in a word. */
*************** static const bfd_arch_info_type h8300sn_
*** 116,122 ****
FALSE, /* The default machine. */
compatible,
h8300_scan,
! 0
};
--- 135,141 ----
FALSE, /* The default machine. */
compatible,
h8300_scan,
! &h8300sx_info_struct
};
Index: bfd/elf32-h8300.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-h8300.c,v
retrieving revision 1.25
diff -p -r1.25 elf32-h8300.c
*** bfd/elf32-h8300.c 12 May 2003 08:50:19 -0000 1.25
--- bfd/elf32-h8300.c 14 May 2003 17:58:13 -0000
*************** elf32_h8_mach (flags)
*** 579,584 ****
--- 579,587 ----
case E_H8_MACH_H8300SN:
return bfd_mach_h8300sn;
+
+ case E_H8_MACH_H8300SX:
+ return bfd_mach_h8300sx;
}
}
*************** elf32_h8_final_write_processing (abfd, l
*** 615,620 ****
--- 618,627 ----
case bfd_mach_h8300sn:
val = E_H8_MACH_H8300SN;
break;
+
+ case bfd_mach_h8300sx:
+ val = E_H8_MACH_H8300SX;
+ break;
}
elf_elfheader (abfd)->e_flags &= ~ (EF_H8_MACH);
*************** elf32_h8_relax_section (abfd, sec, link_
*** 1023,1029 ****
&& value >= 0xff00
&& value <= 0xffff)
|| ((bfd_get_mach (abfd) == bfd_mach_h8300h
! || bfd_get_mach (abfd) == bfd_mach_h8300s)
&& value >= 0xffff00
&& value <= 0xffffff))
{
--- 1030,1039 ----
&& value >= 0xff00
&& value <= 0xffff)
|| ((bfd_get_mach (abfd) == bfd_mach_h8300h
! /* FIXME: h8300hn? */
! || bfd_get_mach (abfd) == bfd_mach_h8300s
! /* FIXME: h8300sn? */
! || bfd_get_mach (abfd) == bfd_mach_h8300sx)
&& value >= 0xffff00
&& value <= 0xffffff))
{
*************** elf32_h8_relax_section (abfd, sec, link_
*** 1081,1087 ****
&& value >= 0xff00
&& value <= 0xffff)
|| ((bfd_get_mach (abfd) == bfd_mach_h8300h
! || bfd_get_mach (abfd) == bfd_mach_h8300s)
&& value >= 0xffff00
&& value <= 0xffffff))
{
--- 1091,1100 ----
&& value >= 0xff00
&& value <= 0xffff)
|| ((bfd_get_mach (abfd) == bfd_mach_h8300h
! /* FIXME: h8300hn? */
! || bfd_get_mach (abfd) == bfd_mach_h8300s
! /* FIXME: h8300sn? */
! || bfd_get_mach (abfd) == bfd_mach_h8300sx)
&& value >= 0xffff00
&& value <= 0xffffff))
{
Index: include/elf/h8.h
===================================================================
RCS file: /cvs/src/src/include/elf/h8.h,v
retrieving revision 1.3
diff -p -r1.3 h8.h
*** include/elf/h8.h 24 Apr 2003 12:36:07 -0000 1.3
--- include/elf/h8.h 14 May 2003 17:58:13 -0000
*************** END_RELOC_NUMBERS (R_H8_max)
*** 94,98 ****
--- 94,99 ----
#define E_H8_MACH_H8300S 0x00820000
#define E_H8_MACH_H8300HN 0x00830000
#define E_H8_MACH_H8300SN 0x00840000
+ #define E_H8_MACH_H8300SX 0x00850000
#endif