107163879Schristos /* BFD library support routines for the NFP.
2*1424dfb3Schristos Copyright (C) 2017-2020 Free Software Foundation, Inc.
307163879Schristos Contributed by Francois H. Theron <francois.theron@netronome.com>
407163879Schristos
507163879Schristos This file is part of BFD, the Binary File Descriptor library.
607163879Schristos
707163879Schristos This program is free software; you can redistribute it and/or modify
807163879Schristos it under the terms of the GNU General Public License as published by
907163879Schristos the Free Software Foundation; either version 3 of the License, or
1007163879Schristos (at your option) any later version.
1107163879Schristos
1207163879Schristos This program is distributed in the hope that it will be useful,
1307163879Schristos but WITHOUT ANY WARRANTY; without even the implied warranty of
1407163879Schristos MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1507163879Schristos GNU General Public License for more details.
1607163879Schristos
1707163879Schristos You should have received a copy of the GNU General Public License
1807163879Schristos along with this program; if not, write to the Free Software
1907163879Schristos Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
2007163879Schristos MA 02110-1301, USA. */
2107163879Schristos
2207163879Schristos #include "sysdep.h"
2307163879Schristos #include "bfd.h"
2407163879Schristos #include "libbfd.h"
2507163879Schristos
2607163879Schristos static const bfd_arch_info_type *
bfd_nfp_compatible(const bfd_arch_info_type * a,const bfd_arch_info_type * b)2707163879Schristos bfd_nfp_compatible (const bfd_arch_info_type * a,
2807163879Schristos const bfd_arch_info_type * b)
2907163879Schristos {
3007163879Schristos if (a->arch != b->arch)
3107163879Schristos return NULL;
3207163879Schristos
3307163879Schristos if (a->mach != b->mach)
3407163879Schristos return NULL;
3507163879Schristos
3607163879Schristos return a;
3707163879Schristos }
3807163879Schristos
3907163879Schristos #define N(machine, print, default, next) \
4007163879Schristos { \
4107163879Schristos 32, \
4207163879Schristos 64, \
4307163879Schristos 8, \
4407163879Schristos bfd_arch_nfp, \
4507163879Schristos machine, \
4607163879Schristos "nfp", \
4707163879Schristos print, \
4807163879Schristos 3, \
4907163879Schristos default, \
5007163879Schristos bfd_nfp_compatible, \
5107163879Schristos bfd_default_scan, \
5207163879Schristos bfd_arch_default_fill, \
53*1424dfb3Schristos next, \
54*1424dfb3Schristos 0 /* Maximum offset of a reloc from the start of an insn. */ \
5507163879Schristos }
5607163879Schristos
57*1424dfb3Schristos static const bfd_arch_info_type arch_info_struct =
58*1424dfb3Schristos N (bfd_mach_nfp3200, "NFP-32xx", FALSE, NULL);
5907163879Schristos
6007163879Schristos const bfd_arch_info_type bfd_nfp_arch =
61*1424dfb3Schristos N (bfd_mach_nfp6000, "NFP-6xxx", TRUE, &arch_info_struct);
62