From e8f2efef4d8222c0a60be544399b6edeea156734 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 2 Feb 1998 22:49:54 +0000 Subject: [PATCH] * Makefile.am ($(srcdir)/bfd-in2.h): Add dummy command to force make to reexamine the file timestamp. ($(srcdir)/libbfd.h, $(srcddir)/libcoff.h): Likewise. Mon Feb 2 17:39:39 1998 Steve Haworth Add tms320c30 support: * cpu-tic30.c: New file. * aout-tic30.c: New file. * coff-tic30.c: New file. * archures.c (bfd_arch_tic30): Define. (bfd_tic30_arch): Declare. (bfd_archures_list): Add bfd_tic30_arch. * targets.c (bfd_target_vector): Add tic30_aout_vec and tic30_coff_vec. * reloc.c (BFD_RELOC_TIC30_LDP): Define. * coffcode.h (coff_set_arch_mach_hook): Add tic30 case. (coff_set_flags): Likewise. * config.bfd (tic30-*-*aout*, tic30-*-*coff*): New targets. * configure.in (tic30_aout_vec, tic30_coff_vec): New vectors. * Makefile.am: Rebuild dependencies. (ALL_MACHINES): Add cpu-tic30.lo. (ALL_MACHINES_CFILES): Add cpu-tic30.c. (BFD32_BACKENDS): Add aout-tic30.lo and coff-tic30.lo. (BFD32_BACKENDS_CFILES): Add aout-tic30.c and coff-tic30.c. * configure, Makefile.in, bfd-in2.h, libbfd.h: Rebuild. --- bfd/.Sanitize | 3 +++ bfd/coffcode.h | 25 +++++++++++++++++++++++-- bfd/cpu-tic30.c | 39 +++++++++++++++++++++++++++++++++++++++ bfd/reloc.c | 7 +++++++ bfd/targets.c | 4 ++++ 5 files changed, 76 insertions(+), 2 deletions(-) create mode 100644 bfd/cpu-tic30.c diff --git a/bfd/.Sanitize b/bfd/.Sanitize index 570deaf8cea..7a2cfaca92b 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 1172f57dbc4..fe89a1d4cd5 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 00000000000..dd723f7b4a5 --- /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 ce6e2bba980..68fe4592f76 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 069a8b746d0..65a2165887d 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 */ -- 2.30.2