1 1.1 christos /* BFD support for the score processor 2 1.10 christos Copyright (C) 2006-2025 Free Software Foundation, Inc. 3 1.1 christos Contributed by 4 1.1 christos Brain.lin (brain.lin (at) sunplusct.com) 5 1.1 christos Mei Ligang (ligang (at) sunnorth.com.cn) 6 1.1 christos Pei-Lin Tsai (pltsai (at) sunplus.com) 7 1.1 christos 8 1.1 christos This file is part of BFD, the Binary File Descriptor library. 9 1.1 christos 10 1.1 christos This program is free software; you can redistribute it and/or modify 11 1.1 christos it under the terms of the GNU General Public License as published by 12 1.1 christos the Free Software Foundation; either version 3 of the License, or 13 1.1 christos (at your option) any later version. 14 1.1 christos 15 1.1 christos This program is distributed in the hope that it will be useful, 16 1.1 christos but WITHOUT ANY WARRANTY; without even the implied warranty of 17 1.1 christos MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 1.1 christos GNU General Public License for more details. 19 1.1 christos 20 1.1 christos You should have received a copy of the GNU General Public License 21 1.1 christos along with this program; if not, write to the Free Software 22 1.1 christos Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, 23 1.1 christos MA 02110-1301, USA. */ 24 1.1 christos 25 1.1 christos #include "sysdep.h" 26 1.1 christos #include "bfd.h" 27 1.1 christos #include "libbfd.h" 28 1.1 christos 29 1.1 christos /* This routine is provided two arch_infos and works out which Score 30 1.1 christos machine which would be compatible with both and returns a pointer 31 1.1 christos to its info structure. */ 32 1.1 christos 33 1.1 christos static const bfd_arch_info_type * 34 1.1 christos compatible (const bfd_arch_info_type * a, const bfd_arch_info_type * b) 35 1.1 christos { 36 1.1 christos /* If a & b are for different architectures we can do nothing. */ 37 1.1 christos if (a->arch != b->arch) 38 1.1 christos return NULL; 39 1.1 christos 40 1.1 christos if (a->mach != b->mach) 41 1.1 christos return NULL; 42 1.1 christos 43 1.1 christos return a; 44 1.1 christos } 45 1.1 christos 46 1.7 christos #define N(machine, print, default, next) \ 47 1.1 christos { \ 48 1.7 christos 32, /* Bits in a word. */ \ 49 1.1 christos 32, /* Bits in an address. */ \ 50 1.7 christos 8, /* Bits in a byte. */ \ 51 1.1 christos bfd_arch_score, \ 52 1.1 christos machine, /* Machine number. */ \ 53 1.1 christos "score", /* Architecture name. */ \ 54 1.1 christos print, /* Printable name. */ \ 55 1.1 christos 4, /* Section align power. */ \ 56 1.1 christos default, /* The default machine. */ \ 57 1.1 christos compatible, \ 58 1.1 christos bfd_default_scan, \ 59 1.1 christos bfd_arch_default_fill, \ 60 1.7 christos next, \ 61 1.7 christos 0 /* Maximum offset of a reloc from the start of an insn. */ \ 62 1.1 christos } 63 1.1 christos 64 1.1 christos static const bfd_arch_info_type arch_info_struct[] = 65 1.1 christos { 66 1.8 christos N (bfd_mach_score3, "score3", false, NULL), 67 1.1 christos }; 68 1.1 christos 69 1.1 christos const bfd_arch_info_type bfd_score_arch = 70 1.8 christos N (bfd_mach_score7, "score7", true, & arch_info_struct[0]); 71