1 /* BFD support for the Altera Nios II processor.
2 Copyright (C) 2012-2022 Free Software Foundation, Inc.
3 Contributed by Nigel Gray (ngray@altera.com).
4 Contributed by Mentor Graphics, Inc.
6 This file is part of BFD, the Binary File Descriptor library.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
21 MA 02110-1301, USA. */
27 static const bfd_arch_info_type
*
28 nios2_compatible (const bfd_arch_info_type
*a
,
29 const bfd_arch_info_type
*b
)
31 if (a
->arch
!= b
->arch
)
34 if (a
->bits_per_word
!= b
->bits_per_word
)
37 if (a
->mach
== bfd_mach_nios2
)
39 else if (b
->mach
== bfd_mach_nios2
)
41 else if (a
->mach
!= b
->mach
)
47 #define N(NUMBER, PRINT, DEFAULT, NEXT) \
49 32, /* Bits in a word. */ \
50 32, /* Bits in an address. */ \
51 8, /* Bits in a byte. */ \
60 bfd_arch_default_fill, \
62 0 /* Maximum offset of a reloc from the start of an insn. */ \
65 #define NIOS2R1_NEXT &arch_info_struct[0]
66 #define NIOS2R2_NEXT &arch_info_struct[1]
68 static const bfd_arch_info_type arch_info_struct
[2] =
70 N (bfd_mach_nios2r1
, "nios2:r1", false, NIOS2R2_NEXT
),
71 N (bfd_mach_nios2r2
, "nios2:r2", false, NULL
),
74 const bfd_arch_info_type bfd_nios2_arch
=
75 N (bfd_mach_nios2
, "nios2", true, NIOS2R1_NEXT
);