summaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2003-04-24 12:36:07 +0000
committerNick Clifton <nickc@redhat.com>2003-04-24 12:36:07 +0000
commit0f660ad3cd412e39637a36cc3a73011329f0a5a9 (patch)
treecd1165f655dfbf4288baa20f4e90a962d1c0ce68 /bfd
parentfbce82f56eee15bed511952656e7b28e58b9444d (diff)
downloadgdb-0f660ad3cd412e39637a36cc3a73011329f0a5a9.tar.gz
Add support for h8300hn and h8300sn
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog13
-rw-r--r--bfd/archures.c8
-rw-r--r--bfd/bfd-in2.h8
-rw-r--r--bfd/coff-h8300.c5
-rw-r--r--bfd/coffcode.h30
-rw-r--r--bfd/cpu-h8300.c83
-rw-r--r--bfd/elf32-h8300.c14
7 files changed, 128 insertions, 33 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 6b839799290..1deba073243 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,16 @@
+2003-04-24 Dhananjay Deshpande <dhananjayd@kpitcummins.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.
+
2003-04-23 Kaz Kojima <kkojima@rr.iij4u.or.jp>
* elf32-sh.c (tpoff): New.
diff --git a/bfd/archures.c b/bfd/archures.c
index 2aafa4990e8..3d473c3b8a2 100644
--- a/bfd/archures.c
+++ b/bfd/archures.c
@@ -164,9 +164,11 @@ DESCRIPTION
. bfd_arch_m98k, {* Motorola 98xxx *}
. bfd_arch_pyramid, {* Pyramid Technology *}
. bfd_arch_h8300, {* Renesas H8/300 (formerly Hitachi H8/300) *}
-.#define bfd_mach_h8300 1
-.#define bfd_mach_h8300h 2
-.#define bfd_mach_h8300s 3
+.#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 --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 802d39507f5..d23a0b7a6b0 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -1630,9 +1630,11 @@ enum bfd_architecture
bfd_arch_m98k, /* Motorola 98xxx */
bfd_arch_pyramid, /* Pyramid Technology */
bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */
-#define bfd_mach_h8300 1
-#define bfd_mach_h8300h 2
-#define bfd_mach_h8300s 3
+#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 --git a/bfd/coff-h8300.c b/bfd/coff-h8300.c
index dab7e017041..ac091533553 100644
--- a/bfd/coff-h8300.c
+++ b/bfd/coff-h8300.c
@@ -281,8 +281,9 @@ 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 H8300 1 /* Customize coffcode.h */
+#define BADMAG(x) (H8300BADMAG (x) && H8300HBADMAG (x) && H8300SBADMAG (x) \
+ && H8300HNBADMAG(x) && H8300SNBADMAG(x))
+#define H8300 1 /* Customize coffcode.h */
#define __A_MAGIC_SET__
/* Code to swap in the reloc. */
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index 5c6c286c064..31338ee99ea 100644
--- a/bfd/coffcode.h
+++ b/bfd/coffcode.h
@@ -2071,7 +2071,7 @@ coff_set_arch_mach_hook (abfd, filehdr)
case H8300MAGIC:
arch = bfd_arch_h8300;
machine = bfd_mach_h8300;
- /* !! FIXME this probably isn't the right place for this */
+ /* !! FIXME this probably isn't the right place for this. */
abfd->flags |= BFD_IS_RELAXABLE;
break;
#endif
@@ -2080,7 +2080,7 @@ coff_set_arch_mach_hook (abfd, filehdr)
case H8300HMAGIC:
arch = bfd_arch_h8300;
machine = bfd_mach_h8300h;
- /* !! FIXME this probably isn't the right place for this */
+ /* !! FIXME this probably isn't the right place for this. */
abfd->flags |= BFD_IS_RELAXABLE;
break;
#endif
@@ -2089,7 +2089,25 @@ coff_set_arch_mach_hook (abfd, filehdr)
case H8300SMAGIC:
arch = bfd_arch_h8300;
machine = bfd_mach_h8300s;
- /* !! FIXME this probably isn't the right place for this */
+ /* !! FIXME this probably isn't the right place for this. */
+ abfd->flags |= BFD_IS_RELAXABLE;
+ 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
@@ -2739,6 +2757,12 @@ coff_set_flags (abfd, magicp, flagsp)
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;
#endif
diff --git a/bfd/cpu-h8300.c b/bfd/cpu-h8300.c
index daef763a29b..2a5c604df64 100644
--- a/bfd/cpu-h8300.c
+++ b/bfd/cpu-h8300.c
@@ -69,16 +69,22 @@ 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
- {
- return info->mach == bfd_mach_h8300;
- }
+ return info->mach == bfd_mach_h8300;
}
/* This routine is provided two arch_infos and works out the machine
@@ -97,33 +103,66 @@ 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", /* Architecture 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", /* Architecture 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 */
- 32, /* 32 bits in an address */
- 8, /* 8 bits in a byte */
+ 32, /* 32 bits in a word. */
+ 32, /* 32 bits in an address. */
+ 8, /* 8 bits in a byte. */
bfd_arch_h8300,
bfd_mach_h8300s,
- "h8300s", /* arch_name */
- "h8300s", /* printable name */
+ "h8300s", /* Architecture name. */
+ "h8300s", /* Printable name. */
1,
- FALSE, /* the default machine */
+ FALSE, /* The default machine. */
compatible,
h8300_scan,
- 0
+ & h8300hn_info_struct
};
static const bfd_arch_info_type h8300h_info_struct =
{
- 32, /* 32 bits in a word */
- 32, /* 32 bits in an address */
- 8, /* 8 bits in a byte */
+ 32, /* 32 bits in a word. */
+ 32, /* 32 bits in an address. */
+ 8, /* 8 bits in a byte. */
bfd_arch_h8300,
bfd_mach_h8300h,
- "h8300h", /* arch_name */
- "h8300h", /* printable name */
+ "h8300h", /* Architecture name. */
+ "h8300h", /* Printable name. */
1,
- FALSE, /* the default machine */
+ FALSE, /* The default machine. */
compatible,
h8300_scan,
&h8300s_info_struct
@@ -131,15 +170,15 @@ static const bfd_arch_info_type h8300h_info_struct =
const bfd_arch_info_type bfd_h8300_arch =
{
- 16, /* 16 bits in a word */
- 16, /* 16 bits in an address */
- 8, /* 8 bits in a byte */
+ 16, /* 16 bits in a word. */
+ 16, /* 16 bits in an address. */
+ 8, /* 8 bits in a byte. */
bfd_arch_h8300,
bfd_mach_h8300,
- "h8300", /* arch_name */
- "h8300", /* printable name */
+ "h8300", /* Architecture name. */
+ "h8300", /* Printable name. */
1,
- TRUE, /* the default machine */
+ TRUE, /* The default machine. */
compatible,
h8300_scan,
&h8300h_info_struct
diff --git a/bfd/elf32-h8300.c b/bfd/elf32-h8300.c
index c79688a3959..6008d5dec2a 100644
--- a/bfd/elf32-h8300.c
+++ b/bfd/elf32-h8300.c
@@ -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;
}
}
@@ -601,6 +607,14 @@ elf32_h8_final_write_processing (abfd, linker)
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;
}
elf_elfheader (abfd)->e_flags &= ~ (EF_H8_MACH);