-# $OpenBSD: Makefile.bsd-wrapper,v 1.21 2020/05/30 19:22:00 drahn Exp $
+# $OpenBSD: Makefile.bsd-wrapper,v 1.22 2021/05/05 04:52:39 drahn Exp $
.include <bsd.own.mk>
MAN+= binutils/doc/ar.1 binutils/doc/ranlib.1 \
binutils/doc/strings.1 binutils/doc/strip.1
-.if (${TARGET_ARCH} != "aarch64" && ${TARGET_ARCH} != "powerpc64")
-SUBDIRS+= ld gas
-CONF_SUBDIRS+= ld gas
-INST_SUBDIRS+= ld gas
+.if (${TARGET_ARCH} != "aarch64" && ${TARGET_ARCH} != "powerpc64" && \
+ ${TARGET_ARCH} != "riscv64")
+SUBDIRS+= ld gas
+CONF_SUBDIRS+= ld gas
+INST_SUBDIRS+= ld gas
MAN+= gas/doc/as.1 ld/ld.bfd.1
.if ${LINKER_VERSION:L} == "bfd"
maninstall:
elf64-mmix.lo \
elf64-sh64.lo \
elf64-ppc.lo \
+ elf64-riscv.lo \
elf64-s390.lo \
elf64-sparc.lo \
elf64.lo \
elf64-mips.c \
elf64-mmix.c \
elf64-ppc.c \
+ elf64-riscv.c \
elf64-s390.c \
elf64-sh64.c \
elf64-sparc.c \
$(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/ppc64.h \
$(INCDIR)/elf/reloc-macros.h elf64-ppc.h elf64-target.h
+elf64-riscv.lo: elf64-riscv.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
+ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
+ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h elf64-target.h
elf64-s390.lo: elf64-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
$(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/s390.h \
elf64-mmix.lo \
elf64-sh64.lo \
elf64-ppc.lo \
+ elf64-riscv.lo \
elf64-s390.lo \
elf64-sparc.lo \
elf64.lo \
elf64-mips.c \
elf64-mmix.c \
elf64-ppc.c \
+ elf64-riscv.c \
elf64-s390.c \
elf64-sh64.c \
elf64-sparc.c \
$(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/ppc64.h \
$(INCDIR)/elf/reloc-macros.h elf64-ppc.h elf64-target.h
+elf64-riscv.lo: elf64-riscv.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
+ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
+ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h elf64-target.h
elf64-s390.lo: elf64-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
$(INCDIR)/hashtab.h elf-bfd.h $(INCDIR)/elf/common.h \
$(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/s390.h \
.#define bfd_mach_z80full 7 {* All undocumented instructions. *}
.#define bfd_mach_r800 11 {* R800: successor with multiplication. *}
. bfd_arch_aarch64,
+. bfd_arch_riscv64,
. bfd_arch_last
. };
*/
extern const bfd_arch_info_type bfd_powerpc_archs[];
#define bfd_powerpc_arch bfd_powerpc_archs[0]
extern const bfd_arch_info_type bfd_rs6000_arch;
+extern const bfd_arch_info_type bfd_riscv64_arch;
extern const bfd_arch_info_type bfd_s390_arch;
extern const bfd_arch_info_type bfd_sh_arch;
extern const bfd_arch_info_type bfd_sparc_arch;
&bfd_or32_arch,
&bfd_pdp11_arch,
&bfd_powerpc_arch,
+ &bfd_riscv_arch,
&bfd_rs6000_arch,
&bfd_s390_arch,
&bfd_sh_arch,
#define bfd_mach_z80full 7 /* All undocumented instructions. */
#define bfd_mach_r800 11 /* R800: successor with multiplication. */
bfd_arch_aarch64,
+ bfd_arch_riscv64,
bfd_arch_last
};
pdp11*) targ_archs=bfd_pdp11_arch ;;
pj*) targ_archs="bfd_pj_arch bfd_i386_arch";;
powerpc*) targ_archs="bfd_rs6000_arch bfd_powerpc_arch" ;;
+riscv64) targ_archs=bfd_riscv64_arch ;;
rs6000) targ_archs="bfd_rs6000_arch bfd_powerpc_arch" ;;
s390*) targ_archs=bfd_s390_arch ;;
sh*) targ_archs=bfd_sh_arch ;;
targ_defvec=bfd_elf32_ia64_hpux_big_vec
targ_selvecs="bfd_elf64_ia64_hpux_big_vec"
;;
+ riscv64-*-openbsd*)
+ targ_defvec=bfd_elf64_riscv_vec
+ ;;
sparc64-*-freebsd* | sparc64-*-netbsd* | sparc64-*-openbsd* | sparc64-*-kfreebsd*-gnu)
targ_defvec=bfd_elf64_sparc_vec
targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
bfd_elf64_mmix_vec) tb="$tb elf64-mmix.lo elf64.lo $elf" target_size=64 ;;
bfd_elf64_powerpc_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
bfd_elf64_powerpcle_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;;
+ bfd_elf64_riscv_vec) tb="$tb elf64-riscv.lo"; target_size=64 ;;
bfd_elf64_s390_vec) tb="$tb elf64-s390.lo elf64.lo $elf"; target_size=64 ;;
bfd_elf64_sh64_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
bfd_elf64_sh64l_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
--- /dev/null
+/* BFD Support for RISCV
+
+ Copyright 2005 Free Software Foundation, Inc.
+
+ 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 2 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 "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+
+const bfd_arch_info_type bfd_riscv64_arch =
+ {
+ 64, /* Bits in a word. */
+ 64, /* Bits in an address. */
+ 8, /* Bits in a byte. */
+ bfd_arch_riscv64,
+ 0, /* Only one machine. */
+ "riscv", /* Arch name. */
+ "riscv:rv64", /* Arch printable name. */
+ 4, /* Section align power. */
+ TRUE, /* The one and only. */
+ bfd_default_compatible,
+ bfd_default_scan ,
+ 0,
+ };
--- /dev/null
+/* Generic support for 64-bit ELF
+ Copyright 1993, 1995, 1998, 1999, 2001, 2002, 2004, 2005
+ Free Software Foundation, Inc.
+
+ 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 2 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 "bfd.h"
+#include "sysdep.h"
+#include "libbfd.h"
+#include "elf-bfd.h"
+
+/* This does not include any relocation information, but should be
+ good enough for GDB or objdump to read the file. */
+
+static reloc_howto_type dummy =
+ HOWTO (0, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ NULL, /* special_function */
+ "UNKNOWN", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE); /* pcrel_offset */
+
+static void
+elf_generic_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *bfd_reloc,
+ Elf_Internal_Rela *elf_reloc ATTRIBUTE_UNUSED)
+{
+ bfd_reloc->howto = &dummy;
+}
+
+static void
+elf_generic_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
+ arelent *bfd_reloc,
+ Elf_Internal_Rela *elf_reloc ATTRIBUTE_UNUSED)
+{
+ bfd_reloc->howto = &dummy;
+}
+
+#define TARGET_LITTLE_SYM bfd_elf64_riscv_vec
+#define TARGET_LITTLE_NAME "elf64-riscv"
+#define ELF_ARCH bfd_arch_riscv64
+#define ELF_MACHINE_CODE EM_RISCV
+#define ELF_MAXPAGESIZE 0x1000
+#define bfd_elf64_bfd_reloc_type_lookup bfd_default_reloc_type_lookup
+#define elf_info_to_howto elf_generic_info_to_howto
+#define elf_info_to_howto_rel elf_generic_info_to_howto_rel
+
+#include "elf64-target.h"
extern const bfd_target bfd_elf64_mmix_vec;
extern const bfd_target bfd_elf64_powerpc_vec;
extern const bfd_target bfd_elf64_powerpcle_vec;
+extern const bfd_target bfd_elf64_riscv_vec;
extern const bfd_target bfd_elf64_s390_vec;
extern const bfd_target bfd_elf64_sh64_vec;
extern const bfd_target bfd_elf64_sh64l_vec;
;;
esac
;;
+ riscv*-*-openbsd*)
+ noconfigdirs="ld gas"
+ ;;
*-*-netware*)
noconfigdirs="$noconfigdirs target-newlib target-libiberty target-libgloss ${libgcj} target-libmudflap"
;;
mips*-*-*)
noconfigdirs="$noconfigdirs gprof ${libgcj}"
;;
+ riscv*-*-openbsd*)
+ noconfigdirs="ld gas"
+ ;;
romp-*-*)
noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
;;
mips*-*-*)
noconfigdirs="$noconfigdirs gprof ${libgcj}"
;;
+ riscv*-*-openbsd*)
+ noconfigdirs="$noconfigdirs gas ld"
+ ;;
romp-*-*)
noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
;;
/* A lexical scanner generated by flex */
/* Scanner skeleton version:
- * $Header: /home/cvs/src/gnu/usr.bin/binutils-2.17/gas/bfin-lex.c,v 1.1.1.1 2011/04/24 20:14:44 miod Exp $
+ * $Header: /home/cvs/src/gnu/usr.bin/binutils-2.17/gas/bfin-lex.c,v 1.2 2021/05/05 04:52:39 drahn Exp $
*/
#define FLEX_SCANNER
bfd_powerpc_arch) ta="$ta ppc-dis.lo ppc-opc.lo" ;;
bfd_powerpc_64_arch) ta="$ta ppc-dis.lo ppc-opc.lo" ;;
bfd_pyramid_arch) ;;
+ bfd_riscv64_arch) ;;
bfd_romp_arch) ;;
bfd_rs6000_arch) ta="$ta ppc-dis.lo ppc-opc.lo" ;;
bfd_s390_arch) ta="$ta s390-dis.lo s390-opc.lo" ;;
bfd_powerpc_arch) ta="$ta ppc-dis.lo ppc-opc.lo" ;;
bfd_powerpc_64_arch) ta="$ta ppc-dis.lo ppc-opc.lo" ;;
bfd_pyramid_arch) ;;
+ bfd_riscv64_arch) ;;
bfd_romp_arch) ;;
bfd_rs6000_arch) ta="$ta ppc-dis.lo ppc-opc.lo" ;;
bfd_s390_arch) ta="$ta s390-dis.lo s390-opc.lo" ;;