aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bfd/.Sanitize3
-rw-r--r--bfd/coffcode.h25
-rw-r--r--bfd/cpu-tic30.c39
-rw-r--r--bfd/reloc.c7
-rw-r--r--bfd/targets.c4
5 files changed, 76 insertions, 2 deletions
diff --git a/bfd/.Sanitize b/bfd/.Sanitize
index 570deaf..7a2cfac 100644
--- a/bfd/.Sanitize
+++ b/bfd/.Sanitize
@@ -58,6 +58,7 @@ aout-encap.c
aout-ns32k.c
aout-sparcle.c
aout-target.h
+aout-tic30.c
aout0.c
aout32.c
aout64.c
@@ -96,6 +97,7 @@ coff-sh.c
coff-sparc.c
coff-stgo32.c
coff-svm68k.c
+coff-tic30.c
coff-u68k.c
coff-we32k.c
coff-w65.c
@@ -134,6 +136,7 @@ cpu-powerpc.c
cpu-rs6000.c
cpu-sh.c
cpu-sparc.c
+cpu-tic30.c
cpu-v850.c
cpu-vax.c
cpu-we32k.c
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index 1172f57..fe89a1d 100644
--- a/bfd/coffcode.h
+++ b/bfd/coffcode.h
@@ -1604,6 +1604,12 @@ coff_set_arch_mach_hook (abfd, filehdr)
break;
#endif
+#ifdef TIC30MAGIC
+ case TIC30MAGIC:
+ arch = bfd_arch_tic30;
+ break;
+#endif
+
/* start-sanitize-tic80 */
#ifdef TIC80_ARCH_MAGIC
case TIC80_ARCH_MAGIC:
@@ -1982,6 +1988,12 @@ coff_set_flags (abfd, magicp, flagsp)
}
break;
#endif
+
+#ifdef TIC30MAGIC
+ case bfd_arch_tic30:
+ *magicp = TIC30MAGIC;
+ return true;
+#endif
/* start-sanitize-tic80 */
#ifdef TIC80_ARCH_MAGIC
case bfd_arch_tic80:
@@ -2168,6 +2180,15 @@ coff_set_arch_mach (abfd, arch, machine)
/* Calculate the file position for each section. */
+#ifndef I960
+#define ALIGN_SECTIONS_IN_FILE
+#endif
+/* start-sanitize-tic80 */
+#ifdef TIC80COFF
+#undef ALIGN_SECTIONS_IN_FILE
+#endif
+/* end-sanitize-tic80 */
+
static boolean
coff_compute_section_file_positions (abfd)
bfd * abfd;
@@ -2276,7 +2297,7 @@ coff_compute_section_file_positions (abfd)
which they are aligned in virtual memory. I960 doesn't
do this (FIXME) so we can stay in sync with Intel. 960
doesn't yet page from files... */
-#ifndef I960
+#ifdef ALIGN_SECTIONS_IN_FILE
if ((abfd->flags & EXEC_P) != 0)
{
/* make sure this section is aligned on the right boundary - by
@@ -2327,7 +2348,7 @@ coff_compute_section_file_positions (abfd)
sofar += current->_raw_size;
-#ifndef I960
+#ifdef ALIGN_SECTIONS_IN_FILE
/* make sure that this section is of the right size too */
if ((abfd->flags & EXEC_P) == 0)
{
diff --git a/bfd/cpu-tic30.c b/bfd/cpu-tic30.c
new file mode 100644
index 0000000..dd723f7
--- /dev/null
+++ b/bfd/cpu-tic30.c
@@ -0,0 +1,39 @@
+/* BFD support for the Texas Instruments TMS320C30 architecture.
+ Copyright 1998 Free Software Foundation, Inc.
+
+ This file is part of BFD, the Binary File Descriptor library.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+#include "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+
+const bfd_arch_info_type bfd_tic30_arch =
+{
+ 32, /* 32 bits in a word */
+ 32, /* 32 bits in an address */
+ 8, /* 8 bits in a byte */
+ bfd_arch_tic30,
+ 0, /* only 1 machine */
+ "tic30",
+ "tms320c30",
+ 2,
+ true, /* the one and only */
+ bfd_default_compatible,
+ bfd_default_scan,
+ 0,
+};
diff --git a/bfd/reloc.c b/bfd/reloc.c
index ce6e2bb..68fe459 100644
--- a/bfd/reloc.c
+++ b/bfd/reloc.c
@@ -2457,6 +2457,13 @@ ENUMDOC
This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the
instruction.
+ENUM
+ BFD_RELOC_TIC30_LDP
+ENUMDOC
+ This is a 8bit DP reloc for the tms320c30, where the most
+ significant 8 bits of a 24 bit word are placed into the least
+ significant 8 bits of the opcode.
+
ENDSENUM
BFD_RELOC_UNUSED
CODE_FRAGMENT
diff --git a/bfd/targets.c b/bfd/targets.c
index 069a8b7..65a2165 100644
--- a/bfd/targets.c
+++ b/bfd/targets.c
@@ -583,6 +583,8 @@ extern const bfd_target sparcnetbsd_vec;
extern const bfd_target sparccoff_vec;
extern const bfd_target sunos_big_vec;
extern const bfd_target tekhex_vec;
+extern const bfd_target tic30_aout_vec;
+extern const bfd_target tic30_coff_vec;
/* start-sanitize-tic80 */
extern const bfd_target tic80coff_vec;
/* end-sanitize-tic80 */
@@ -796,6 +798,8 @@ const bfd_target * const bfd_target_vector[] = {
&sunos_big_vec,
&aout0_big_vec,
&tekhex_vec,
+ &tic30_aout_vec,
+ &tic30_coff_vec,
/* start-sanitize-tic80 */
&tic80coff_vec,
/* end-sanitize-tic80 */