Retro68/binutils/bfd/cpu-tic4x.c

71 lines
2.2 KiB
C
Raw Normal View History

2012-03-26 19:18:29 +00:00
/* bfd back-end for TMS320C[34]x support
2022-10-27 18:45:45 +00:00
Copyright (C) 1996-2022 Free Software Foundation, Inc.
2012-03-26 19:18:29 +00: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
the Free Software Foundation; either version 3 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., 51 Franklin Street - Fifth Floor, Boston,
MA 02110-1301, USA. */
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
2022-10-27 18:45:45 +00:00
static bool
tic4x_scan (const struct bfd_arch_info *info,
const char *string)
2012-03-26 19:18:29 +00: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')
2022-10-27 18:45:45 +00:00
return false;
2012-03-26 19:18:29 +00:00
if (*string == '3')
return (info->mach == bfd_mach_tic3x);
else if (*string == '4')
return info->mach == bfd_mach_tic4x;
2022-10-27 18:45:45 +00:00
return false;
2012-03-26 19:18:29 +00:00
}
2022-10-27 18:45:45 +00: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. */ \
}
2012-03-26 19:18:29 +00:00
const bfd_arch_info_type bfd_tic3x_arch =
2022-10-27 18:45:45 +00:00
N (bfd_mach_tic3x, "tic3x", "tms320c3x", false, NULL);
2012-03-26 19:18:29 +00:00
const bfd_arch_info_type bfd_tic4x_arch =
2022-10-27 18:45:45 +00:00
N (bfd_mach_tic4x, "tic4x", "tms320c4x", true, &bfd_tic3x_arch);