summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2017-01-25 08:56:09 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2017-01-25 08:56:09 +0000
commit9afb470771d444a374f28ba323fdb566d0a7f330 (patch)
tree9692e1765570a5a7fbb7e66cc3251e2c8486e25b
parent628c12d877379ceaeb363a7c352bdeb078c7d7a2 (diff)
Stub out aarch64 support and avoid building gas and ld on this architecture.
ok mpi@, patrick@
-rw-r--r--gnu/usr.bin/binutils-2.17/Makefile.bsd-wrapper28
-rw-r--r--gnu/usr.bin/binutils-2.17/bfd/Makefile.am5
-rw-r--r--gnu/usr.bin/binutils-2.17/bfd/Makefile.in5
-rw-r--r--gnu/usr.bin/binutils-2.17/bfd/archures.c2
-rw-r--r--gnu/usr.bin/binutils-2.17/bfd/bfd-in2.h1
-rw-r--r--gnu/usr.bin/binutils-2.17/bfd/config.bfd5
-rwxr-xr-xgnu/usr.bin/binutils-2.17/bfd/configure1
-rw-r--r--gnu/usr.bin/binutils-2.17/bfd/cpu-aarch64.c40
-rw-r--r--gnu/usr.bin/binutils-2.17/bfd/elf64-aarch64.c69
-rw-r--r--gnu/usr.bin/binutils-2.17/bfd/targets.c1
-rw-r--r--gnu/usr.bin/binutils-2.17/include/elf/common.h1
-rwxr-xr-xgnu/usr.bin/binutils-2.17/opcodes/configure1
-rw-r--r--gnu/usr.bin/binutils-2.17/opcodes/configure.in1
13 files changed, 150 insertions, 10 deletions
diff --git a/gnu/usr.bin/binutils-2.17/Makefile.bsd-wrapper b/gnu/usr.bin/binutils-2.17/Makefile.bsd-wrapper
index 723fe7e02a0..9fad0a2c74a 100644
--- a/gnu/usr.bin/binutils-2.17/Makefile.bsd-wrapper
+++ b/gnu/usr.bin/binutils-2.17/Makefile.bsd-wrapper
@@ -1,7 +1,9 @@
-# $OpenBSD: Makefile.bsd-wrapper,v 1.11 2016/10/03 21:24:40 natano Exp $
+# $OpenBSD: Makefile.bsd-wrapper,v 1.12 2017/01/25 08:56:07 kettenis Exp $
.include <bsd.own.mk>
+TARGET_ARCH?= ${MACHINE_ARCH}
+
SUBDIRS= opcodes bfd
CONF_SUBDIRS= opcodes bfd
@@ -23,12 +25,18 @@ MAN= binutils/doc/addr2line.1 binutils/doc/objcopy.1 \
###INST_SUBDIRS+= gdb
###MAN+= gdb/gdb.1
-SUBDIRS+= binutils ld gas
-CONF_SUBDIRS+= binutils ld gas
-INST_SUBDIRS+= binutils ld gas
+SUBDIRS+= binutils
+CONF_SUBDIRS+= binutils
+INST_SUBDIRS+= binutils
MAN+= binutils/doc/ar.1 binutils/doc/ranlib.1 \
- binutils/doc/strings.1 binutils/doc/strip.1 \
- gas/doc/as.1 ld/ld.1
+ binutils/doc/strings.1 binutils/doc/strip.1
+
+.if ${TARGET_ARCH} != "aarch64"
+SUBDIRS+= ld gas
+CONF_SUBDIRS+= ld gas
+INST_SUBDIRS+= ld gas
+MAN+= gas/doc/as.1 ld/ld.1
+.endif
# Used by the GNU Makefile
ALL_MODULES=${SUBDIRS:S/^/all-/g}
@@ -39,11 +47,11 @@ INSTALL_MODULES=${INST_SUBDIRS:S/^/install-/g}
INFO_HOST_MODULES=${SUBDIRS:S/^/info-/g}
INSTALL_INFO_HOST_MODULES=${INST_SUBDIRS:S/^/install-info-/g}
-# cross-compilation
-.if defined(TARGET_ARCH)
CONFIGTARGET=--target=${TARGET_ARCH}-unknown-openbsd${OSREV}
-.else
-CONFIGTARGET=
+
+.if ${TARGET_ARCH} == "aarch64"
+CONFIGTARGET+=--without-gnu-ld
+CONFIGTARGET+=--without-gnu-as
.endif
all: config.status
diff --git a/gnu/usr.bin/binutils-2.17/bfd/Makefile.am b/gnu/usr.bin/binutils-2.17/bfd/Makefile.am
index 790a880fada..bddd324b2c4 100644
--- a/gnu/usr.bin/binutils-2.17/bfd/Makefile.am
+++ b/gnu/usr.bin/binutils-2.17/bfd/Makefile.am
@@ -539,6 +539,7 @@ BFD64_BACKENDS = \
demo64.lo \
efi-app-ia64.lo \
elf64-x86-64.lo \
+ elf64-aarch64.lo \
elf64-alpha.lo \
elf64-hppa.lo \
elf32-ia64.lo \
@@ -565,6 +566,7 @@ BFD64_BACKENDS_CFILES = \
demo64.c \
efi-app-ia64.c \
elf64-x86-64.c \
+ elf64-aarch64.c \
elf64-alpha.c \
elf64-hppa.c \
elf64-gen.c \
@@ -1739,6 +1741,9 @@ elf64-x86-64.lo: elf64-x86-64.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/x86-64.h \
$(INCDIR)/elf/reloc-macros.h elf64-target.h
+elf64-aarch64.lo: elf64-aarch64.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-alpha.lo: elf64-alpha.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 \
diff --git a/gnu/usr.bin/binutils-2.17/bfd/Makefile.in b/gnu/usr.bin/binutils-2.17/bfd/Makefile.in
index 3194dcfde89..bc59208d688 100644
--- a/gnu/usr.bin/binutils-2.17/bfd/Makefile.in
+++ b/gnu/usr.bin/binutils-2.17/bfd/Makefile.in
@@ -778,6 +778,7 @@ BFD64_BACKENDS = \
efi-app-ia64.lo \
efi-app-x86_64.lo \
elf64-x86-64.lo \
+ elf64-aarch64.lo \
elf64-alpha.lo \
elf64-hppa.lo \
elf32-ia64.lo \
@@ -805,6 +806,7 @@ BFD64_BACKENDS_CFILES = \
efi-app-ia64.c \
efi-app-x86_64.c \
elf64-x86-64.c \
+ elf64-aarch64.c \
elf64-alpha.c \
elf64-hppa.c \
elf64-gen.c \
@@ -2313,6 +2315,9 @@ elf64-x86-64.lo: elf64-x86-64.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/x86-64.h \
$(INCDIR)/elf/reloc-macros.h elf64-target.h
+elf64-aarch64.lo: elf64-aarch64.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-alpha.lo: elf64-alpha.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 \
diff --git a/gnu/usr.bin/binutils-2.17/bfd/archures.c b/gnu/usr.bin/binutils-2.17/bfd/archures.c
index 140eacc15d6..64f60ff9a1d 100644
--- a/gnu/usr.bin/binutils-2.17/bfd/archures.c
+++ b/gnu/usr.bin/binutils-2.17/bfd/archures.c
@@ -382,6 +382,7 @@ DESCRIPTION
.#define bfd_mach_z80 3 {* With ixl, ixh, iyl, and iyh. *}
.#define bfd_mach_z80full 7 {* All undocumented instructions. *}
.#define bfd_mach_r800 11 {* R800: successor with multiplication. *}
+. bfd_arch_aarch64,
. bfd_arch_last
. };
*/
@@ -420,6 +421,7 @@ DESCRIPTION
.
*/
+extern const bfd_arch_info_type bfd_aarch64_arch;
extern const bfd_arch_info_type bfd_alpha_arch;
extern const bfd_arch_info_type bfd_arc_arch;
extern const bfd_arch_info_type bfd_arm_arch;
diff --git a/gnu/usr.bin/binutils-2.17/bfd/bfd-in2.h b/gnu/usr.bin/binutils-2.17/bfd/bfd-in2.h
index f8738070a4b..f710ee9838c 100644
--- a/gnu/usr.bin/binutils-2.17/bfd/bfd-in2.h
+++ b/gnu/usr.bin/binutils-2.17/bfd/bfd-in2.h
@@ -1980,6 +1980,7 @@ enum bfd_architecture
#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */
#define bfd_mach_z80full 7 /* All undocumented instructions. */
#define bfd_mach_r800 11 /* R800: successor with multiplication. */
+ bfd_arch_aarch64,
bfd_arch_last
};
diff --git a/gnu/usr.bin/binutils-2.17/bfd/config.bfd b/gnu/usr.bin/binutils-2.17/bfd/config.bfd
index 33d7ac950a3..3c20accbcfe 100644
--- a/gnu/usr.bin/binutils-2.17/bfd/config.bfd
+++ b/gnu/usr.bin/binutils-2.17/bfd/config.bfd
@@ -69,6 +69,7 @@ esac
targ_cpu=`echo $targ | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
case "${targ_cpu}" in
+aarch64) targ_archs=bfd_aarch64_arch ;;
alpha*) targ_archs=bfd_alpha_arch ;;
arm*) targ_archs=bfd_arm_arch ;;
bfin*) targ_archs=bfd_bfin_arch ;;
@@ -134,6 +135,10 @@ case "${targ}" in
# START OF targmatch.h
#ifdef BFD64
+ aarch64-*-openbsd*)
+ targ_defvec=bfd_elf64_aarch64_vec
+ ;;
+
alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
targ_defvec=bfd_elf64_alpha_freebsd_vec
targ_selvecs=ecoffalpha_little_vec
diff --git a/gnu/usr.bin/binutils-2.17/bfd/configure b/gnu/usr.bin/binutils-2.17/bfd/configure
index 26ae36ad730..ab6f6cd91c4 100755
--- a/gnu/usr.bin/binutils-2.17/bfd/configure
+++ b/gnu/usr.bin/binutils-2.17/bfd/configure
@@ -13177,6 +13177,7 @@ do
bfd_elf32_xc16x_vec) tb="$tb elf32-xc16x.lo elf32.lo $elf" ;;
bfd_elf32_xtensa_le_vec) tb="$tb xtensa-isa.lo xtensa-modules.lo elf32-xtensa.lo elf32.lo $elf" ;;
bfd_elf32_xtensa_be_vec) tb="$tb xtensa-isa.lo xtensa-modules.lo elf32-xtensa.lo elf32.lo $elf" ;;
+ bfd_elf64_aarch64_vec) tb="$tb elf64-aarch64.lo"; target_size=64 ;;
bfd_elf64_alpha_freebsd_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;;
bfd_elf64_alpha_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;;
bfd_elf64_big_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;;
diff --git a/gnu/usr.bin/binutils-2.17/bfd/cpu-aarch64.c b/gnu/usr.bin/binutils-2.17/bfd/cpu-aarch64.c
new file mode 100644
index 00000000000..0f71fe6faf6
--- /dev/null
+++ b/gnu/usr.bin/binutils-2.17/bfd/cpu-aarch64.c
@@ -0,0 +1,40 @@
+/* BFD Support for AArch64
+
+ 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_aarch64_arch =
+ {
+ 64, /* Bits in a word. */
+ 64, /* Bits in an address. */
+ 8, /* Bits in a byte. */
+ bfd_arch_aarch64,
+ 0, /* Only one machine. */
+ "aarch64", /* Arch name. */
+ "aarch64", /* Arch printable name. */
+ 4, /* Section align power. */
+ TRUE, /* The one and only. */
+ bfd_default_compatible,
+ bfd_default_scan ,
+ 0,
+ };
diff --git a/gnu/usr.bin/binutils-2.17/bfd/elf64-aarch64.c b/gnu/usr.bin/binutils-2.17/bfd/elf64-aarch64.c
new file mode 100644
index 00000000000..b3ad79f84b0
--- /dev/null
+++ b/gnu/usr.bin/binutils-2.17/bfd/elf64-aarch64.c
@@ -0,0 +1,69 @@
+/* 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_aarch64_vec
+#define TARGET_LITTLE_NAME "elf64-aarc64"
+#define ELF_ARCH bfd_arch_aarch64
+#define ELF_MACHINE_CODE EM_AARCH64
+#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"
diff --git a/gnu/usr.bin/binutils-2.17/bfd/targets.c b/gnu/usr.bin/binutils-2.17/bfd/targets.c
index 299d9c89021..f81449099f1 100644
--- a/gnu/usr.bin/binutils-2.17/bfd/targets.c
+++ b/gnu/usr.bin/binutils-2.17/bfd/targets.c
@@ -648,6 +648,7 @@ extern const bfd_target bfd_elf32_xc16x_vec;
extern const bfd_target bfd_elf32_xstormy16_vec;
extern const bfd_target bfd_elf32_xtensa_be_vec;
extern const bfd_target bfd_elf32_xtensa_le_vec;
+extern const bfd_target bfd_elf64_aarch64_vec;
extern const bfd_target bfd_elf64_alpha_freebsd_vec;
extern const bfd_target bfd_elf64_alpha_vec;
extern const bfd_target bfd_elf64_big_generic_vec;
diff --git a/gnu/usr.bin/binutils-2.17/include/elf/common.h b/gnu/usr.bin/binutils-2.17/include/elf/common.h
index 8f12f476c79..3942922335f 100644
--- a/gnu/usr.bin/binutils-2.17/include/elf/common.h
+++ b/gnu/usr.bin/binutils-2.17/include/elf/common.h
@@ -185,6 +185,7 @@
#define EM_BLACKFIN 106 /* ADI Blackfin */
#define EM_ALTERA_NIOS2 113 /* Altera Nios II soft-core processor */
#define EM_CRX 114 /* National Semiconductor CRX */
+#define EM_AARCH64 183
/* If it is necessary to assign new unofficial EM_* values, please pick large
random numbers (0x8523, 0xa7f2, etc.) to minimize the chances of collision
diff --git a/gnu/usr.bin/binutils-2.17/opcodes/configure b/gnu/usr.bin/binutils-2.17/opcodes/configure
index b692e838160..7849ffee738 100755
--- a/gnu/usr.bin/binutils-2.17/opcodes/configure
+++ b/gnu/usr.bin/binutils-2.17/opcodes/configure
@@ -8801,6 +8801,7 @@ if test x${all_targets} = xfalse ; then
ad=`echo $arch | sed -e s/bfd_//g -e s/_arch//g`
archdefs="$archdefs -DARCH_$ad"
case "$arch" in
+ bfd_aarch64_arch) ;;
bfd_alpha_arch) ta="$ta alpha-dis.lo alpha-opc.lo" ;;
bfd_arc_arch) ta="$ta arc-dis.lo arc-opc.lo arc-ext.lo" ;;
bfd_arm_arch) ta="$ta arm-dis.lo" ;;
diff --git a/gnu/usr.bin/binutils-2.17/opcodes/configure.in b/gnu/usr.bin/binutils-2.17/opcodes/configure.in
index d19d23cdbdc..c98802c9ac9 100644
--- a/gnu/usr.bin/binutils-2.17/opcodes/configure.in
+++ b/gnu/usr.bin/binutils-2.17/opcodes/configure.in
@@ -153,6 +153,7 @@ if test x${all_targets} = xfalse ; then
ad=`echo $arch | sed -e s/bfd_//g -e s/_arch//g`
archdefs="$archdefs -DARCH_$ad"
case "$arch" in
+ bfd_aarch64_arch) ;;
bfd_alpha_arch) ta="$ta alpha-dis.lo alpha-opc.lo" ;;
bfd_arc_arch) ta="$ta arc-dis.lo arc-opc.lo arc-ext.lo" ;;
bfd_arm_arch) ta="$ta arm-dis.lo" ;;