1 /* BFD support for the Altera Nios II processor.
2 Copyright (C) 2012-2019 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(BITS_WORD, BITS_ADDR, NUMBER, PRINT, DEFAULT, NEXT) \
49 BITS_WORD, /* bits in a word */ \
50 BITS_ADDR, /* bits in an address */ \
51 8, /* 8 bits in a byte */ \
60 bfd_arch_default_fill, \
64 #define NIOS2R1_NEXT &arch_info_struct[0]
65 #define NIOS2R2_NEXT &arch_info_struct[1]
67 static const bfd_arch_info_type arch_info_struct
[] =
69 N (32, 32, bfd_mach_nios2r1
, "nios2:r1", FALSE
, NIOS2R2_NEXT
),
70 N (32, 32, bfd_mach_nios2r2
, "nios2:r2", FALSE
, NULL
),
73 const bfd_arch_info_type bfd_nios2_arch
=
74 N (32, 32, 0, "nios2", TRUE
, NIOS2R1_NEXT
);