2002-08-28 18:38:51 +08:00
|
|
|
/* bfd back-end for TMS320C[34]x support
|
2019-01-01 18:31:27 +08:00
|
|
|
Copyright (C) 1996-2019 Free Software Foundation, Inc.
|
2002-08-28 18:38:51 +08:00
|
|
|
|
|
|
|
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz)
|
|
|
|
|
|
|
|
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
|
2007-07-03 22:26:43 +08:00
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
2002-08-28 18:38:51 +08:00
|
|
|
(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
|
2007-07-03 22:26:43 +08:00
|
|
|
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
|
|
|
|
MA 02110-1301, USA. */
|
2002-08-28 18:38:51 +08:00
|
|
|
|
|
|
|
#include "sysdep.h"
|
2007-04-26 22:47:00 +08:00
|
|
|
#include "bfd.h"
|
2002-08-28 18:38:51 +08:00
|
|
|
#include "libbfd.h"
|
|
|
|
|
2002-11-30 16:39:46 +08:00
|
|
|
static bfd_boolean
|
2012-07-13 22:22:50 +08:00
|
|
|
tic4x_scan (const struct bfd_arch_info *info,
|
|
|
|
const char *string)
|
2002-08-28 18:38:51 +08:00
|
|
|
{
|
|
|
|
/* Allow strings of form [ti][Cc][34][0-9], let's not be too picky
|
|
|
|
about strange numbered machines in C3x or C4x series. */
|
|
|
|
if (string[0] == 't' && string[1] == 'i')
|
|
|
|
string += 2;
|
|
|
|
if (*string == 'C' || *string == 'c')
|
|
|
|
string++;
|
|
|
|
if (string[1] < '0' && string[1] > '9')
|
2002-11-30 16:39:46 +08:00
|
|
|
return FALSE;
|
2002-08-28 18:38:51 +08:00
|
|
|
|
|
|
|
if (*string == '3')
|
2003-04-04 16:15:15 +08:00
|
|
|
return (info->mach == bfd_mach_tic3x);
|
2002-08-28 18:38:51 +08:00
|
|
|
else if (*string == '4')
|
2003-04-04 16:15:15 +08:00
|
|
|
return info->mach == bfd_mach_tic4x;
|
2002-08-28 18:38:51 +08:00
|
|
|
|
2002-11-30 16:39:46 +08:00
|
|
|
return FALSE;
|
2002-08-28 18:38:51 +08:00
|
|
|
}
|
|
|
|
|
2019-09-10 22:20:58 +08:00
|
|
|
#define N(NUMBER, NAME, PRINT, DEFAULT, NEXT) \
|
|
|
|
{ \
|
|
|
|
32, /* Bits in a word. */ \
|
|
|
|
32, /* Bits in an address. */ \
|
|
|
|
32, /* Bits in a byte. */ \
|
|
|
|
bfd_arch_tic4x, \
|
|
|
|
NUMBER, \
|
|
|
|
NAME, \
|
|
|
|
PRINT, \
|
|
|
|
0, /* Section alignment power. */ \
|
|
|
|
DEFAULT, \
|
|
|
|
bfd_default_compatible, \
|
|
|
|
tic4x_scan, \
|
|
|
|
bfd_arch_default_fill, \
|
|
|
|
NEXT, \
|
|
|
|
0 /* Maximum offset of a reloc from the start of an insn. */ \
|
|
|
|
}
|
2002-08-28 18:38:51 +08:00
|
|
|
|
|
|
|
const bfd_arch_info_type bfd_tic3x_arch =
|
2019-09-10 22:20:58 +08:00
|
|
|
N (bfd_mach_tic3x, "tic3x", "tms320c3x", FALSE, NULL);
|
2002-08-28 18:38:51 +08:00
|
|
|
|
|
|
|
const bfd_arch_info_type bfd_tic4x_arch =
|
2019-09-10 22:20:58 +08:00
|
|
|
N (bfd_mach_tic4x, "tic4x", "tms320c4x", TRUE, &bfd_tic3x_arch);
|