aboutsummaryrefslogtreecommitdiff
path: root/bfd/cpu-nfp.c
diff options
context:
space:
mode:
authorFrancois H. Theron <francois.theron@netronome.com>2018-04-30 17:02:59 +0100
committerNick Clifton <nickc@redhat.com>2018-04-30 17:02:59 +0100
commitfe944acf8f858cfe6bcfd00670a88847a464717c (patch)
tree63cfbbb8631a3c6624f1263aa0608ea6c796c5c4 /bfd/cpu-nfp.c
parentd33bc52e51fdb6c464c1c8e8fdf9b2007b522b57 (diff)
downloadbinutils-fe944acf8f858cfe6bcfd00670a88847a464717c.zip
binutils-fe944acf8f858cfe6bcfd00670a88847a464717c.tar.gz
binutils-fe944acf8f858cfe6bcfd00670a88847a464717c.tar.bz2
This patch adds support to objdump for disassembly of NFP (Netronome Flow Processor) ELF files (.nffw) as well as some basic readelf support.
bfd * Makefile.am: Added NFP files to build. * archures.c: Added bfd_arch_nfp * config.bfd: Added NFP support. * configure.ac: Added NFP support. * cpu-nfp.c: New, for NFP support. * elf-bfd.h: Added elf_section_info() * elf64-nfp.c: New, for NFP support. * po/SRC-POTFILES.in: Added NFP source files. * targets.c: Added nfp_elf64_vec * bfd-in2.h: Regenerate. * Makefile.in: Regenerate. * configure: Regenerate. binutils* readelf.c: Very basic support for EM_NFP and its section types. * testsuite/binutils-all/nfp: New directory. * testsuite/binutils-all/nfp/objdump.exp: New file. Run new tests. * testsuite/binutils-all/nfp/test2_ctx8.d: New file. * testsuite/binutils-all/nfp/test2_no-pc_ctx4.d: New file. * testsuite/binutils-all/nfp/test1.d: New file. * testsuite/binutils-all/nfp/nfp6000.nffw: New file. * testsuite/binutils-all/nfp/test2_nfp6000.nffw: New file. * NEWS: Mention the new support. include * dis-asm.h: Added print_nfp_disassembler_options prototype. * elf/common.h: Added EM_NFP, officially assigned. See Google Group Generic System V Application Binary Interface. * elf/nfp.h: New, for NFP support. * opcode/nfp.h: New, for NFP support. opcodes Makefile.am: Added nfp-dis.c. configure.ac: Added bfd_nfp_arch. disassemble.h: Added print_insn_nfp prototype. disassemble.c: Added ARCH_nfp and call to print_insn_nfp nfp-dis.c: New, for NFP support. po/POTFILES.in: Added nfp-dis.c to the list. Makefile.in: Regenerate. configure: Regenerate.
Diffstat (limited to 'bfd/cpu-nfp.c')
-rw-r--r--bfd/cpu-nfp.c62
1 files changed, 62 insertions, 0 deletions
diff --git a/bfd/cpu-nfp.c b/bfd/cpu-nfp.c
new file mode 100644
index 0000000..ef97f86
--- /dev/null
+++ b/bfd/cpu-nfp.c
@@ -0,0 +1,62 @@
+/* BFD library support routines for the NFP.
+ Copyright (C) 2017 Free Software Foundation, Inc.
+ Contributed by Francois H. Theron <francois.theron@netronome.com>
+
+ 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"
+
+static const bfd_arch_info_type *
+bfd_nfp_compatible (const bfd_arch_info_type * a,
+ const bfd_arch_info_type * b)
+{
+ if (a->arch != b->arch)
+ return NULL;
+
+ if (a->mach != b->mach)
+ return NULL;
+
+ return a;
+}
+
+#define N(machine, print, default, next) \
+{ \
+ 32, \
+ 64, \
+ 8, \
+ bfd_arch_nfp, \
+ machine, \
+ "nfp", \
+ print, \
+ 3, \
+ default, \
+ bfd_nfp_compatible, \
+ bfd_default_scan, \
+ bfd_arch_default_fill, \
+ next \
+}
+
+static const bfd_arch_info_type arch_info_struct[] =
+{
+ N (bfd_mach_nfp3200, "NFP-32xx", FALSE, NULL)
+};
+
+const bfd_arch_info_type bfd_nfp_arch =
+ N (bfd_mach_nfp6000, "NFP-6xxx", TRUE, &arch_info_struct[0]);