This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
PATCH: Add Intel K1OM support
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: binutils at sourceware dot org
- Date: Fri, 22 Jul 2011 13:15:48 -0700
- Subject: PATCH: Add Intel K1OM support
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
Hi,
This is the first patch to support Intel K1OM, which is the machine
type for the Intel Many Integrated Core architecture:
http://www.intel.com/technology/architecture-silicon/mic/index.htm
Only ELF format is supported. This patch introduces a new machine type,
EM_K1OM, for Intel K1OM. The new ELF/K1OM targets will be enabled for
ELF/x86-64 targets.
To generate Intel K1OM object file, -march=k1om should be passed to
assembler. To generate Intel K1OM executable or shared library, "-m
elf_k1om" should be passed to linker.
I will check it in shortly.
H.J.
---
bfd/
2011-07-22 H.J. Lu <hongjiu.lu@intel.com>
* Makefile.am (ALL_MACHINES): Add cpu-k1om.lo.
(ALL_MACHINES_CFILES): Add cpu-k1om.c.
* Makefile.in: Regenerated.
* archures.c (bfd_architecture): Add bfd_arch_k1om.
(bfd_k1om_arch): New.
(bfd_archures_list): Add &bfd_k1om_arch.
* bfd-in2.h: Regenerated.
* config.bfd (targ64_selvecs): Add bfd_elf64_k1om_vec if
bfd_elf64_x86_64_vec is supported. Add bfd_elf64_k1om_freebsd_vec
if bfd_elf64_x86_64_freebsd_vec is supported.
(targ_selvecs): Likewise.
* configure.in: Support bfd_elf64_k1om_vec and
bfd_elf64_k1om_freebsd_vec.
* configure: Regenerated.
* cpu-k1om.c: New.
* elf64-x86-64.c (elf64_k1om_elf_object_p): New.
(bfd_elf64_k1om_vec): Likewise.
(bfd_elf64_k1om_freebsd_vec): Likewise.
* targets.c (bfd_elf64_k1om_vec): New.
(bfd_elf64_k1om_freebsd_vec): Likewise.
(_bfd_target_vector): Add bfd_elf64_k1om_vec and
bfd_elf64_k1om_freebsd_vec.
binutils/
2011-07-22 H.J. Lu <hongjiu.lu@intel.com>
* dwarf.c (init_dwarf_regnames): Handle EM_K1OM.
* elfedit.c (elf_machine): Support EM_K1OM.
(elf_class): Likewise.
* readelf.c (guess_is_rela): Handle EM_K1OM.
(dump_relocations): Likewise.
(get_machine_name): Likewise.
(get_section_type_name): Likewise.
(get_elf_section_flags): Likewise.
(process_section_headers): Likewise.
(get_symbol_index_type): Likewise.
(is_32bit_abs_reloc): Likewise.
(is_32bit_pcrel_reloc): Likewise.
(is_64bit_abs_reloc): Likewise.
(is_64bit_pcrel_reloc): Likewise.
(is_none_reloc): Likewise.
* doc/binutils.texi: Mention K1OM for elfedit.
binutils/testsuite/
2011-07-22 H.J. Lu <hongjiu.lu@intel.com>
* binutils-all/elfedit.exp: Run elfedit-4.
* binutils-all/elfedit-4.d: New.
gas/
2011-07-22 H.J. Lu <hongjiu.lu@intel.com>
* config/tc-i386.c (cpu_arch): Add k1om.
(i386_align_code): Handle PROCESSOR_K1OM.
(check_cpu_arch_compatible): Check EM_K1OM.
(i386_arch): Handle Intel K1OM.
(i386_mach): Return bfd_mach_k1om for Intel K1OM.
(i386_target_format): Return ELF_TARGET_K1OM_FORMAT for Intel
K1OM.
* config/tc-i386.h (ELF_TARGET_K1OM_FORMAT): New.
(processor_type): Add PROCESSOR_K1OM.
* doc/c-i386.texi: Document k1om.
gas/testsuite/
2011-07-22 H.J. Lu <hongjiu.lu@intel.com>
* gas/i386/k1om.d: New.
* gas/i386/k1om-inval.l: Likewise.
* gas/i386/k1om-inval.s: Likewise.
* gas/i386/i386.exp: Run k1om-inval and k1om.
include/elf/
2011-07-22 H.J. Lu <hongjiu.lu@intel.com>
* common.h (EM_K1OM): New.
ld/
2011-07-22 H.J. Lu <hongjiu.lu@intel.com>
* Makefile.am (ALL_64_EMULATIONS): Add eelf_k1om.o and
eelf_k1om_fbsd.o
(eelf_k1om.c): New.
(eelf_k1om_fbsd.c): Likewise.
* Makefile.in: Regenerated.
* configure.tgt (targ64_extra_emuls): Add elf_k1om if elf_x86_64
is supported. Add elf_k1om_fbsd if elf_x86_64_fbsd is supported.
(targ_extra_emuls): Likewise.
* emulparams/elf_k1om.sh: New.
* emulparams/elf_k1om_fbsd.sh: Likewise.
ld/testsuite/
2011-07-22 H.J. Lu <hongjiu.lu@intel.com>
* ld-x86-64/abs-k1om.d: New.
* ld-x86-64/protected2-k1om.d: Likewise.
* ld-x86-64/protected3-k1om.d: Likewise.
* ld-x86-64/x86-64.exp: Run abs-k1om, protected2-k1om and
protected3-k1om.
opcodes/
2011-07-22 H.J. Lu <hongjiu.lu@intel.com>
* configure.in: Handle bfd_k1om_arch.
* configure: Regenerated.
* disassemble.c (disassembler): Handle bfd_k1om_arch.
* i386-dis.c (print_insn): Handle bfd_mach_k1om and
bfd_mach_k1om_intel_syntax.
* i386-gen.c (cpu_flag_init): Set CPU_UNKNOWN_FLAGS to
~(CpuL1OM|CpuK1OM). Add CPU_K1OM_FLAGS.
(cpu_flags): Add CpuK1OM.
* i386-opc.h (CpuK1OM): New.
(i386_cpu_flags): Add cpuk1om.
* i386-init.h: Regenerated.
* i386-tbl.h: Likewise.
diff --git a/bfd/Makefile.am b/bfd/Makefile.am
index 90c0dd5..8610d5e 100644
--- a/bfd/Makefile.am
+++ b/bfd/Makefile.am
@@ -91,6 +91,7 @@ ALL_MACHINES = \
cpu-i370.lo \
cpu-i386.lo \
cpu-l1om.lo \
+ cpu-k1om.lo \
cpu-i860.lo \
cpu-i960.lo \
cpu-ia64.lo \
@@ -165,6 +166,7 @@ ALL_MACHINES_CFILES = \
cpu-i370.c \
cpu-i386.c \
cpu-l1om.c \
+ cpu-k1om.c \
cpu-i860.c \
cpu-i960.c \
cpu-ia64.c \
diff --git a/bfd/Makefile.in b/bfd/Makefile.in
index e2df7d2..34196aa 100644
--- a/bfd/Makefile.in
+++ b/bfd/Makefile.in
@@ -390,6 +390,7 @@ ALL_MACHINES = \
cpu-i370.lo \
cpu-i386.lo \
cpu-l1om.lo \
+ cpu-k1om.lo \
cpu-i860.lo \
cpu-i960.lo \
cpu-ia64.lo \
@@ -464,6 +465,7 @@ ALL_MACHINES_CFILES = \
cpu-i370.c \
cpu-i386.c \
cpu-l1om.c \
+ cpu-k1om.c \
cpu-i860.c \
cpu-i960.c \
cpu-ia64.c \
@@ -1270,6 +1272,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-ia64.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-ip2k.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-iq2000.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-k1om.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-l1om.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-lm32.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-m10200.Plo@am__quote@
diff --git a/bfd/archures.c b/bfd/archures.c
index ffe3a15..4b5f11d 100644
--- a/bfd/archures.c
+++ b/bfd/archures.c
@@ -192,6 +192,9 @@ DESCRIPTION
. bfd_arch_l1om, {* Intel L1OM *}
.#define bfd_mach_l1om 66
.#define bfd_mach_l1om_intel_syntax 67
+. bfd_arch_k1om, {* Intel K1OM *}
+.#define bfd_mach_k1om 68
+.#define bfd_mach_k1om_intel_syntax 69
. bfd_arch_we32k, {* AT&T WE32xxx *}
. bfd_arch_tahoe, {* CCI/Harris Tahoe *}
. bfd_arch_i860, {* Intel 860 *}
@@ -503,6 +506,7 @@ extern const bfd_arch_info_type bfd_i960_arch;
extern const bfd_arch_info_type bfd_ia64_arch;
extern const bfd_arch_info_type bfd_ip2k_arch;
extern const bfd_arch_info_type bfd_iq2000_arch;
+extern const bfd_arch_info_type bfd_k1om_arch;
extern const bfd_arch_info_type bfd_l1om_arch;
extern const bfd_arch_info_type bfd_lm32_arch;
extern const bfd_arch_info_type bfd_m32c_arch;
@@ -582,6 +586,7 @@ static const bfd_arch_info_type * const bfd_archures_list[] =
&bfd_ia64_arch,
&bfd_ip2k_arch,
&bfd_iq2000_arch,
+ &bfd_k1om_arch,
&bfd_l1om_arch,
&bfd_lm32_arch,
&bfd_m32c_arch,
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 867d052..b6dfadf 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -1895,6 +1895,9 @@ enum bfd_architecture
bfd_arch_l1om, /* Intel L1OM */
#define bfd_mach_l1om 66
#define bfd_mach_l1om_intel_syntax 67
+ bfd_arch_k1om, /* Intel K1OM */
+#define bfd_mach_k1om 68
+#define bfd_mach_k1om_intel_syntax 69
bfd_arch_we32k, /* AT&T WE32xxx */
bfd_arch_tahoe, /* CCI/Harris Tahoe */
bfd_arch_i860, /* Intel 860 */
diff --git a/bfd/config.bfd b/bfd/config.bfd
index 404c80f..3f5b9a1 100644
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -460,13 +460,13 @@ case "${targ}" in
i[3-7]86-*-solaris2*)
targ_defvec=bfd_elf32_i386_sol2_vec
targ_selvecs="i386coff_vec"
- targ64_selvecs="bfd_elf64_x86_64_sol2_vec bfd_elf64_l1om_vec"
+ targ64_selvecs="bfd_elf64_x86_64_sol2_vec bfd_elf64_l1om_vec bfd_elf64_k1om_vec"
want64=true
;;
#ifdef BFD64
x86_64-*-solaris2*)
targ_defvec=bfd_elf32_i386_sol2_vec
- targ_selvecs="bfd_elf64_x86_64_sol2_vec bfd_elf64_l1om_vec i386coff_vec"
+ targ_selvecs="bfd_elf64_x86_64_sol2_vec bfd_elf64_l1om_vec bfd_elf64_k1om_vec i386coff_vec"
want64=true
;;
#endif
@@ -486,7 +486,7 @@ case "${targ}" in
;;
i[3-7]86-*-dicos*)
targ_defvec=bfd_elf32_i386_vec
- targ64_selvecs="bfd_elf64_x86_64_vec bfd_elf64_l1om_vec"
+ targ64_selvecs="bfd_elf64_x86_64_vec bfd_elf64_l1om_vec bfd_elf64_k1om_vec"
;;
*-*-msdosdjgpp* | *-*-go32* )
targ_defvec=go32coff_vec
@@ -515,7 +515,7 @@ case "${targ}" in
;;
i[3-7]86-*-dragonfly*)
targ_defvec=bfd_elf32_i386_vec
- targ64_selvecs="bfd_elf64_x86_64_vec bfd_elf64_l1om_vec"
+ targ64_selvecs="bfd_elf64_x86_64_vec bfd_elf64_l1om_vec bfd_elf64_k1om_vec"
;;
i[3-7]86-*-freebsdaout* | i[3-7]86-*-freebsd[12].* | \
i[3-7]86-*-freebsd[12])
@@ -526,7 +526,7 @@ case "${targ}" in
i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu)
targ_defvec=bfd_elf32_i386_freebsd_vec
targ_selvecs="bfd_elf32_i386_vec i386pei_vec i386coff_vec"
- targ64_selvecs="bfd_elf64_x86_64_freebsd_vec bfd_elf64_x86_64_vec x86_64pei_vec bfd_elf64_l1om_vec bfd_elf64_l1om_freebsd_vec"
+ targ64_selvecs="bfd_elf64_x86_64_freebsd_vec bfd_elf64_x86_64_vec x86_64pei_vec bfd_elf64_l1om_vec bfd_elf64_l1om_freebsd_vec bfd_elf64_k1om_vec bfd_elf64_k1om_freebsd_vec"
# FreeBSD <= 4.0 supports only the old nonstandard way of ABI labelling.
case "${targ}" in
i[3-7]86-*-freebsd3* | i[3-7]86-*-freebsd4 | i[3-7]86-*-freebsd4.0*)
@@ -536,7 +536,7 @@ case "${targ}" in
i[3-7]86-*-netbsdelf* | i[3-7]86-*-netbsd*-gnu* | i[3-7]86-*-knetbsd*-gnu)
targ_defvec=bfd_elf32_i386_vec
targ_selvecs=i386netbsd_vec
- targ64_selvecs="bfd_elf64_x86_64_vec bfd_elf64_l1om_vec"
+ targ64_selvecs="bfd_elf64_x86_64_vec bfd_elf64_l1om_vec bfd_elf64_k1om_vec"
;;
i[3-7]86-*-netbsdpe*)
targ_defvec=i386pe_vec
@@ -564,7 +564,7 @@ case "${targ}" in
i[3-7]86-*-linux-*)
targ_defvec=bfd_elf32_i386_vec
targ_selvecs="i386linux_vec i386pei_vec"
- targ64_selvecs="bfd_elf64_x86_64_vec bfd_elf32_x86_64_vec bfd_elf64_l1om_vec"
+ targ64_selvecs="bfd_elf64_x86_64_vec bfd_elf32_x86_64_vec bfd_elf64_l1om_vec bfd_elf64_k1om_vec"
;;
#ifdef BFD64
x86_64-*-darwin*)
@@ -575,37 +575,37 @@ case "${targ}" in
;;
x86_64-*-dicos*)
targ_defvec=bfd_elf64_x86_64_vec
- targ_selvecs="bfd_elf32_i386_vec bfd_elf64_l1om_vec"
+ targ_selvecs="bfd_elf32_i386_vec bfd_elf64_l1om_vec bfd_elf64_k1om_vec"
want64=true
;;
x86_64-*-elf*)
targ_defvec=bfd_elf64_x86_64_vec
- targ_selvecs="bfd_elf32_i386_vec bfd_elf64_l1om_vec i386coff_vec"
+ targ_selvecs="bfd_elf32_i386_vec bfd_elf64_l1om_vec bfd_elf64_k1om_vec i386coff_vec"
want64=true
;;
x86_64-*-dragonfly*)
targ_defvec=bfd_elf64_x86_64_vec
- targ_selvecs="bfd_elf32_i386_vec bfd_elf64_l1om_vec"
+ targ_selvecs="bfd_elf32_i386_vec bfd_elf64_l1om_vec bfd_elf64_k1om_vec"
want64=true
;;
x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu)
targ_defvec=bfd_elf64_x86_64_freebsd_vec
- targ_selvecs="bfd_elf32_i386_freebsd_vec i386coff_vec i386pei_vec x86_64pei_vec bfd_elf32_i386_vec bfd_elf64_x86_64_vec bfd_elf64_l1om_vec bfd_elf64_l1om_freebsd_vec"
+ targ_selvecs="bfd_elf32_i386_freebsd_vec i386coff_vec i386pei_vec x86_64pei_vec bfd_elf32_i386_vec bfd_elf64_x86_64_vec bfd_elf64_l1om_vec bfd_elf64_l1om_freebsd_vec bfd_elf64_k1om_vec bfd_elf64_k1om_freebsd_vec"
want64=true
;;
x86_64-*-netbsd* | x86_64-*-openbsd*)
targ_defvec=bfd_elf64_x86_64_vec
- targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec i386pei_vec x86_64pei_vec bfd_elf64_l1om_vec"
+ targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec i386pei_vec x86_64pei_vec bfd_elf64_l1om_vec bfd_elf64_k1om_vec"
want64=true
;;
x86_64-*-linux-*)
targ_defvec=bfd_elf64_x86_64_vec
- targ_selvecs="bfd_elf32_i386_vec bfd_elf32_x86_64_vec i386linux_vec i386pei_vec x86_64pei_vec bfd_elf64_l1om_vec"
+ targ_selvecs="bfd_elf32_i386_vec bfd_elf32_x86_64_vec i386linux_vec i386pei_vec x86_64pei_vec bfd_elf64_l1om_vec bfd_elf64_k1om_vec"
want64=true
;;
x86_64-*-mingw* | x86_64-*-pe | x86_64-*-pep)
targ_defvec=x86_64pe_vec
- targ_selvecs="x86_64pe_vec x86_64pei_vec bfd_elf64_x86_64_vec bfd_elf64_l1om_vec i386pe_vec i386pei_vec bfd_elf32_i386_vec"
+ targ_selvecs="x86_64pe_vec x86_64pei_vec bfd_elf64_x86_64_vec bfd_elf64_l1om_vec bfd_elf64_k1om_vec i386pe_vec i386pei_vec bfd_elf32_i386_vec"
want64=true
targ_underscore=no
;;
@@ -1603,3 +1603,10 @@ case "${targ_defvec} ${targ_selvecs}" in
targ_archs="$targ_archs bfd_l1om_arch"
;;
esac
+
+# If we support Intel K1OM target, then add support for bfd_k1om_arch.
+case "${targ_defvec} ${targ_selvecs}" in
+ *bfd_elf64_k1om_vec*)
+ targ_archs="$targ_archs bfd_k1om_arch"
+ ;;
+esac
diff --git a/bfd/configure b/bfd/configure
index 36103a6..40c17db 100755
--- a/bfd/configure
+++ b/bfd/configure
@@ -15347,6 +15347,8 @@ do
bfd_elf32_x86_64_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf64.lo elf32.lo $elf"; target_size=64 ;;
bfd_elf64_l1om_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;;
bfd_elf64_l1om_freebsd_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;;
+ bfd_elf64_k1om_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;;
+ bfd_elf64_k1om_freebsd_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;;
bfd_mmo_vec) tb="$tb mmo.lo" target_size=64 ;;
bfd_powerpc_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;
bfd_powerpc_pei_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;;
diff --git a/bfd/configure.in b/bfd/configure.in
index d966e31..e1ae5fc 100644
--- a/bfd/configure.in
+++ b/bfd/configure.in
@@ -846,6 +846,8 @@ do
bfd_elf32_x86_64_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf64.lo elf32.lo $elf"; target_size=64 ;;
bfd_elf64_l1om_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;;
bfd_elf64_l1om_freebsd_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;;
+ bfd_elf64_k1om_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;;
+ bfd_elf64_k1om_freebsd_vec) tb="$tb elf64-x86-64.lo elf-ifunc.lo elf64.lo $elf"; target_size=64 ;;
bfd_mmo_vec) tb="$tb mmo.lo" target_size=64 ;;
bfd_powerpc_pe_vec) tb="$tb pe-ppc.lo peigen.lo cofflink.lo" ;;
bfd_powerpc_pei_vec) tb="$tb pei-ppc.lo peigen.lo cofflink.lo" ;;
diff --git a/bfd/cpu-k1om.c b/bfd/cpu-k1om.c
new file mode 100644
index 0000000..fa030ae
--- /dev/null
+++ b/bfd/cpu-k1om.c
@@ -0,0 +1,56 @@
+/* BFD support for the Intel K1OM architecture.
+ Copyright 2011
+ 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 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_k1om_arch_intel_syntax =
+{
+ 64, /* 64 bits in a word */
+ 64, /* 64 bits in an address */
+ 8, /* 8 bits in a byte */
+ bfd_arch_k1om,
+ bfd_mach_k1om_intel_syntax,
+ "k1om:intel",
+ "k1om:intel",
+ 3,
+ TRUE,
+ bfd_default_compatible,
+ bfd_default_scan,
+ 0
+};
+
+const bfd_arch_info_type bfd_k1om_arch =
+{
+ 64, /* 64 bits in a word */
+ 64, /* 64 bits in an address */
+ 8, /* 8 bits in a byte */
+ bfd_arch_k1om,
+ bfd_mach_k1om,
+ "k1om",
+ "k1om",
+ 3,
+ TRUE,
+ bfd_default_compatible,
+ bfd_default_scan,
+ &bfd_k1om_arch_intel_syntax
+};
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index 12748d8..975b558 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -5037,6 +5037,56 @@ elf64_l1om_elf_object_p (bfd *abfd)
#include "elf64-target.h"
+/* Intel K1OM support. */
+
+static bfd_boolean
+elf64_k1om_elf_object_p (bfd *abfd)
+{
+ /* Set the right machine number for an K1OM elf64 file. */
+ bfd_default_set_arch_mach (abfd, bfd_arch_k1om, bfd_mach_k1om);
+ return TRUE;
+}
+
+#undef TARGET_LITTLE_SYM
+#define TARGET_LITTLE_SYM bfd_elf64_k1om_vec
+#undef TARGET_LITTLE_NAME
+#define TARGET_LITTLE_NAME "elf64-k1om"
+#undef ELF_ARCH
+#define ELF_ARCH bfd_arch_k1om
+
+#undef ELF_MACHINE_CODE
+#define ELF_MACHINE_CODE EM_K1OM
+
+#undef ELF_OSABI
+
+#undef elf64_bed
+#define elf64_bed elf64_k1om_bed
+
+#undef elf_backend_object_p
+#define elf_backend_object_p elf64_k1om_elf_object_p
+
+#undef elf_backend_static_tls_alignment
+
+#undef elf_backend_want_plt_sym
+#define elf_backend_want_plt_sym 0
+
+#include "elf64-target.h"
+
+/* FreeBSD K1OM support. */
+
+#undef TARGET_LITTLE_SYM
+#define TARGET_LITTLE_SYM bfd_elf64_k1om_freebsd_vec
+#undef TARGET_LITTLE_NAME
+#define TARGET_LITTLE_NAME "elf64-k1om-freebsd"
+
+#undef ELF_OSABI
+#define ELF_OSABI ELFOSABI_FREEBSD
+
+#undef elf64_bed
+#define elf64_bed elf64_k1om_fbsd_bed
+
+#include "elf64-target.h"
+
/* 32bit x86-64 support. */
static bfd_boolean
diff --git a/bfd/targets.c b/bfd/targets.c
index 241ff9c..0bfc104 100644
--- a/bfd/targets.c
+++ b/bfd/targets.c
@@ -750,6 +750,8 @@ extern const bfd_target bfd_elf64_x86_64_vec;
extern const bfd_target bfd_elf32_x86_64_vec;
extern const bfd_target bfd_elf64_l1om_freebsd_vec;
extern const bfd_target bfd_elf64_l1om_vec;
+extern const bfd_target bfd_elf64_k1om_freebsd_vec;
+extern const bfd_target bfd_elf64_k1om_vec;
extern const bfd_target bfd_mmo_vec;
extern const bfd_target bfd_powerpc_pe_vec;
extern const bfd_target bfd_powerpc_pei_vec;
@@ -1113,6 +1115,8 @@ static const bfd_target * const _bfd_target_vector[] =
&bfd_elf32_x86_64_vec,
&bfd_elf64_l1om_freebsd_vec,
&bfd_elf64_l1om_vec,
+ &bfd_elf64_k1om_freebsd_vec,
+ &bfd_elf64_k1om_vec,
&bfd_mmo_vec,
#endif
&bfd_powerpc_pe_vec,
diff --git a/binutils/doc/binutils.texi b/binutils/doc/binutils.texi
index 64abcf2..35ccb87 100644
--- a/binutils/doc/binutils.texi
+++ b/binutils/doc/binutils.texi
@@ -4274,7 +4274,8 @@ Set the matching input ELF machine type to @var{machine}. If
@option{--input-mach} isn't specified, it will match any ELF
machine types.
-The supported ELF machine types are, @var{L1OM} and @var{x86-64}.
+The supported ELF machine types are, @var{L1OM}, @var{K1OM} and
+@var{x86-64}.
@itemx --output-mach=@var{machine}
Change the ELF machine type in the ELF header to @var{machine}. The
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index f5a8d7b..08febad 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -4233,6 +4233,7 @@ init_dwarf_regnames (unsigned int e_machine)
case EM_X86_64:
case EM_L1OM:
+ case EM_K1OM:
init_dwarf_regnames_x86_64 ();
break;
diff --git a/binutils/elfedit.c b/binutils/elfedit.c
index 4cc2846..f7bf9e9 100644
--- a/binutils/elfedit.c
+++ b/binutils/elfedit.c
@@ -556,6 +556,8 @@ elf_machine (const char *mach)
{
if (strcasecmp (mach, "l1om") == 0)
return EM_L1OM;
+ if (strcasecmp (mach, "k1om") == 0)
+ return EM_K1OM;
if (strcasecmp (mach, "x86_64") == 0)
return EM_X86_64;
if (strcasecmp (mach, "x86-64") == 0)
@@ -576,6 +578,7 @@ elf_class (int mach)
switch (mach)
{
case EM_L1OM:
+ case EM_K1OM:
case EM_X86_64:
return ELFCLASS64;
case EM_NONE:
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 7922f8a..1271ccd 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -607,6 +607,7 @@ guess_is_rela (unsigned int e_machine)
case EM_VAX:
case EM_X86_64:
case EM_L1OM:
+ case EM_K1OM:
case EM_XSTORMY16:
case EM_XTENSA:
case EM_XTENSA_OLD:
@@ -1138,6 +1139,7 @@ dump_relocations (FILE * file,
case EM_X86_64:
case EM_L1OM:
+ case EM_K1OM:
rtype = elf_x86_64_reloc_type (type);
break;
@@ -1331,7 +1333,8 @@ dump_relocations (FILE * file,
&& psym->st_shndx == SHN_MIPS_SUNDEFINED)
sec_name = "SUNDEF";
else if ((elf_header.e_machine == EM_X86_64
- || elf_header.e_machine == EM_L1OM)
+ || elf_header.e_machine == EM_L1OM
+ || elf_header.e_machine == EM_K1OM)
&& psym->st_shndx == SHN_X86_64_LCOMMON)
sec_name = "LARGE_COMMON";
else if (elf_header.e_machine == EM_IA_64
@@ -1899,6 +1902,7 @@ get_machine_name (unsigned e_machine)
case EM_PRISM: return "Vitesse Prism";
case EM_X86_64: return "Advanced Micro Devices X86-64";
case EM_L1OM: return "Intel L1OM";
+ case EM_K1OM: return "Intel K1OM";
case EM_S390_OLD:
case EM_S390: return "IBM S/390";
case EM_SCORE: return "SUNPLUS S+Core";
@@ -3043,6 +3047,7 @@ get_section_type_name (unsigned int sh_type)
break;
case EM_X86_64:
case EM_L1OM:
+ case EM_K1OM:
result = get_x86_64_section_type_name (sh_type);
break;
case EM_ARM:
@@ -4294,6 +4299,7 @@ get_elf_section_flags (bfd_vma sh_flags)
case EM_486:
case EM_X86_64:
case EM_L1OM:
+ case EM_K1OM:
case EM_OLD_SPARCV9:
case EM_SPARC32PLUS:
case EM_SPARCV9:
@@ -4345,7 +4351,8 @@ get_elf_section_flags (bfd_vma sh_flags)
default:
if ((elf_header.e_machine == EM_X86_64
- || elf_header.e_machine == EM_L1OM)
+ || elf_header.e_machine == EM_L1OM
+ || elf_header.e_machine == EM_K1OM)
&& flag == SHF_X86_64_LARGE)
*p = 'l';
else if (flag & SHF_MASKOS)
@@ -4735,6 +4742,7 @@ process_section_headers (FILE * file)
case EM_486:
case EM_X86_64:
case EM_L1OM:
+ case EM_K1OM:
case EM_OLD_SPARCV9:
case EM_SPARC32PLUS:
case EM_SPARCV9:
@@ -4863,7 +4871,8 @@ process_section_headers (FILE * file)
if (!do_section_details)
{
if (elf_header.e_machine == EM_X86_64
- || elf_header.e_machine == EM_L1OM)
+ || elf_header.e_machine == EM_L1OM
+ || elf_header.e_machine == EM_K1OM)
printf (_("Key to Flags:\n\
W (write), A (alloc), X (execute), M (merge), S (strings), l (large)\n\
I (info), L (link order), G (group), T (TLS), E (exclude), x (unknown)\n\
@@ -8783,7 +8792,8 @@ get_symbol_index_type (unsigned int type)
&& elf_header.e_ident[EI_OSABI] == ELFOSABI_HPUX)
return "ANSI_COM";
else if ((elf_header.e_machine == EM_X86_64
- || elf_header.e_machine == EM_L1OM)
+ || elf_header.e_machine == EM_L1OM
+ || elf_header.e_machine == EM_K1OM)
&& type == SHN_X86_64_LCOMMON)
return "LARGE_COM";
else if ((type == SHN_MIPS_SCOMMON
@@ -9756,6 +9766,7 @@ is_32bit_abs_reloc (unsigned int reloc_type)
return reloc_type == 1; /* R_VAX_32. */
case EM_X86_64:
case EM_L1OM:
+ case EM_K1OM:
return reloc_type == 10; /* R_X86_64_32. */
case EM_XC16X:
case EM_C166:
@@ -9814,6 +9825,7 @@ is_32bit_pcrel_reloc (unsigned int reloc_type)
return reloc_type == 4; /* R_TILEPRO_32_PCREL. */
case EM_X86_64:
case EM_L1OM:
+ case EM_K1OM:
return reloc_type == 2; /* R_X86_64_PC32. */
case EM_XTENSA_OLD:
case EM_XTENSA:
@@ -9850,6 +9862,7 @@ is_64bit_abs_reloc (unsigned int reloc_type)
return reloc_type == 54; /* R_SPARC_UA64. */
case EM_X86_64:
case EM_L1OM:
+ case EM_K1OM:
return reloc_type == 1; /* R_X86_64_64. */
case EM_S390_OLD:
case EM_S390:
@@ -9885,6 +9898,7 @@ is_64bit_pcrel_reloc (unsigned int reloc_type)
return reloc_type == 46; /* R_SPARC_DISP64. */
case EM_X86_64:
case EM_L1OM:
+ case EM_K1OM:
return reloc_type == 24; /* R_X86_64_PC64. */
case EM_S390_OLD:
case EM_S390:
@@ -9978,6 +9992,7 @@ is_none_reloc (unsigned int reloc_type)
case EM_CRIS: /* R_CRIS_NONE. */
case EM_X86_64: /* R_X86_64_NONE. */
case EM_L1OM: /* R_X86_64_NONE. */
+ case EM_K1OM: /* R_X86_64_NONE. */
case EM_MN10300: /* R_MN10300_NONE. */
case EM_MOXIE: /* R_MOXIE_NONE. */
case EM_M32R: /* R_M32R_NONE. */
diff --git a/binutils/testsuite/binutils-all/elfedit-4.d b/binutils/testsuite/binutils-all/elfedit-4.d
new file mode 100644
index 0000000..2dc8009
--- /dev/null
+++ b/binutils/testsuite/binutils-all/elfedit-4.d
@@ -0,0 +1,16 @@
+#PROG: elfedit
+#elfedit: --output-mach k1om
+#source: empty.s
+#readelf: -h
+#name: Update ELF header 1
+#target: x86_64-*-*
+
+#...
+ELF Header:
+ Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
+ Class: ELF64
+ Data: 2's complement, little endian
+ Version: 1 \(current\)
+#...
+ Machine: Intel K1OM
+#...
diff --git a/binutils/testsuite/binutils-all/elfedit.exp b/binutils/testsuite/binutils-all/elfedit.exp
index 2142774..500906d 100644
--- a/binutils/testsuite/binutils-all/elfedit.exp
+++ b/binutils/testsuite/binutils-all/elfedit.exp
@@ -1,4 +1,5 @@
-# Copyright 2010 Free Software Foundation, Inc.
+# Copyright 2010, 2011
+# Free Software Foundation, Inc.
# 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
@@ -31,3 +32,4 @@ if ![is_remote host] {
run_dump_test "elfedit-1"
run_dump_test "elfedit-2"
run_dump_test "elfedit-3"
+run_dump_test "elfedit-4"
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index f67e0c4..1159572 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -633,6 +633,8 @@ static const arch_entry cpu_arch[] =
CPU_COREI7_FLAGS, 0, 0 },
{ STRING_COMMA_LEN ("l1om"), PROCESSOR_L1OM,
CPU_L1OM_FLAGS, 0, 0 },
+ { STRING_COMMA_LEN ("k1om"), PROCESSOR_K1OM,
+ CPU_K1OM_FLAGS, 0, 0 },
{ STRING_COMMA_LEN ("k6"), PROCESSOR_K6,
CPU_K6_FLAGS, 0, 0 },
{ STRING_COMMA_LEN ("k6_2"), PROCESSOR_K6,
@@ -1081,6 +1083,7 @@ i386_align_code (fragS *fragP, int count)
case PROCESSOR_CORE2:
case PROCESSOR_COREI7:
case PROCESSOR_L1OM:
+ case PROCESSOR_K1OM:
case PROCESSOR_GENERIC64:
patt = alt_long_patt;
break;
@@ -1133,6 +1136,7 @@ i386_align_code (fragS *fragP, int count)
case PROCESSOR_CORE2:
case PROCESSOR_COREI7:
case PROCESSOR_L1OM:
+ case PROCESSOR_K1OM:
if (fragP->tc_frag_data.isa_flags.bitfield.cpunop)
patt = alt_long_patt;
else
@@ -2125,6 +2129,11 @@ check_cpu_arch_compatible (const char *name ATTRIBUTE_UNUSED,
|| new_flag.bitfield.cpul1om)
return;
+ /* If we are targeting Intel K1OM, we must enable it. */
+ if (get_elf_backend_data (stdoutput)->elf_machine_code != EM_K1OM
+ || new_flag.bitfield.cpuk1om)
+ return;
+
as_bad (_("`%s' is not supported on `%s'"), name, arch);
#endif
}
@@ -2236,6 +2245,13 @@ i386_arch (void)
as_fatal (_("Intel L1OM is 64bit ELF only"));
return bfd_arch_l1om;
}
+ else if (cpu_arch_isa == PROCESSOR_K1OM)
+ {
+ if (OUTPUT_FLAVOR != bfd_target_elf_flavour
+ || flag_code != CODE_64BIT)
+ as_fatal (_("Intel K1OM is 64bit ELF only"));
+ return bfd_arch_k1om;
+ }
else
return bfd_arch_i386;
}
@@ -2252,6 +2268,13 @@ i386_mach (void)
as_fatal (_("Intel L1OM is 64bit ELF only"));
return bfd_mach_l1om;
}
+ else if (cpu_arch_isa == PROCESSOR_K1OM)
+ {
+ if (OUTPUT_FLAVOR != bfd_target_elf_flavour
+ || default_arch[6] != '\0')
+ as_fatal (_("Intel K1OM is 64bit ELF only"));
+ return bfd_mach_k1om;
+ }
else if (default_arch[6] == '\0')
return bfd_mach_x86_64;
else
@@ -8740,6 +8763,12 @@ i386_target_format (void)
as_fatal (_("Intel L1OM is 64bit only"));
return ELF_TARGET_L1OM_FORMAT;
}
+ if (cpu_arch_isa == PROCESSOR_K1OM)
+ {
+ if (x86_elf_abi != X86_64_ABI)
+ as_fatal (_("Intel K1OM is 64bit only"));
+ return ELF_TARGET_K1OM_FORMAT;
+ }
else
return format;
}
diff --git a/gas/config/tc-i386.h b/gas/config/tc-i386.h
index 092e8c6..deb2e9f 100644
--- a/gas/config/tc-i386.h
+++ b/gas/config/tc-i386.h
@@ -84,6 +84,10 @@ extern unsigned long i386_mach (void);
#define ELF_TARGET_L1OM_FORMAT "elf64-l1om"
#endif
+#ifndef ELF_TARGET_K1OM_FORMAT
+#define ELF_TARGET_K1OM_FORMAT "elf64-k1om"
+#endif
+
#if ((defined (OBJ_MAYBE_COFF) && defined (OBJ_MAYBE_AOUT)) \
|| defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) \
|| defined (TE_PE) || defined (TE_PEP) || defined (OBJ_MACH_O))
@@ -224,6 +228,7 @@ enum processor_type
PROCESSOR_CORE2,
PROCESSOR_COREI7,
PROCESSOR_L1OM,
+ PROCESSOR_K1OM,
PROCESSOR_K6,
PROCESSOR_ATHLON,
PROCESSOR_K8,
diff --git a/gas/doc/c-i386.texi b/gas/doc/c-i386.texi
index 4397e60..30745b4 100644
--- a/gas/doc/c-i386.texi
+++ b/gas/doc/c-i386.texi
@@ -111,6 +111,7 @@ processor names are recognized:
@code{core2},
@code{corei7},
@code{l1om},
+@code{k1om},
@code{k6},
@code{k6_2},
@code{athlon},
@@ -1003,7 +1004,7 @@ supported on the CPU specified. The choices for @var{cpu_type} are:
@item @samp{i486} @tab @samp{i586} @tab @samp{i686} @tab @samp{pentium}
@item @samp{pentiumpro} @tab @samp{pentiumii} @tab @samp{pentiumiii} @tab @samp{pentium4}
@item @samp{prescott} @tab @samp{nocona} @tab @samp{core} @tab @samp{core2}
-@item @samp{corei7} @tab @samp{l1om}
+@item @samp{corei7} @tab @samp{l1om} @tab @samp{k1om}
@item @samp{k6} @tab @samp{k6_2} @tab @samp{athlon} @tab @samp{k8}
@item @samp{amdfam10} @tab @samp{bdver1} @tab @samp{bdver2}
@item @samp{generic32} @tab @samp{generic64}
diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp
index 67f4175..e38cd27 100644
--- a/gas/testsuite/gas/i386/i386.exp
+++ b/gas/testsuite/gas/i386/i386.exp
@@ -237,6 +237,7 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_32_check]]
run_list_test "ifunc-2"
run_dump_test "ifunc-3"
run_list_test "l1om-inval" "-march=l1om --32"
+ run_list_test "k1om-inval" "-march=k1om --32"
run_dump_test "localpic"
run_dump_test "debug1"
@@ -448,6 +449,7 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_64_check]] t
run_dump_test "x86-64-opcode-inval-intel"
run_dump_test "intel-got64"
run_dump_test "l1om"
+ run_dump_test "k1om"
run_dump_test "x86-64-localpic"
run_dump_test "debug1"
diff --git a/gas/testsuite/gas/i386/k1om-inval.l b/gas/testsuite/gas/i386/k1om-inval.l
new file mode 100644
index 0000000..607bc62
--- /dev/null
+++ b/gas/testsuite/gas/i386/k1om-inval.l
@@ -0,0 +1,2 @@
+Assembler messages:
+Fatal error: Intel K1OM is 64bit only
diff --git a/gas/testsuite/gas/i386/k1om-inval.s b/gas/testsuite/gas/i386/k1om-inval.s
new file mode 100644
index 0000000..1ff7c29
--- /dev/null
+++ b/gas/testsuite/gas/i386/k1om-inval.s
@@ -0,0 +1,2 @@
+ .text
+ nop
diff --git a/gas/testsuite/gas/i386/k1om.d b/gas/testsuite/gas/i386/k1om.d
new file mode 100644
index 0000000..0682444
--- /dev/null
+++ b/gas/testsuite/gas/i386/k1om.d
@@ -0,0 +1,259 @@
+#source: x86_64.s
+#as: -J -march=k1om
+#objdump: -dw
+#name: k1om
+
+.*: +file format elf64-k1om.*
+
+Disassembly of section .text:
+
+0+ <.*>:
+[ ]*[a-f0-9]+: 01 ca add %ecx,%edx
+[ ]*[a-f0-9]+: 44 01 ca add %r9d,%edx
+[ ]*[a-f0-9]+: 41 01 ca add %ecx,%r10d
+[ ]*[a-f0-9]+: 48 01 ca add %rcx,%rdx
+[ ]*[a-f0-9]+: 4d 01 ca add %r9,%r10
+[ ]*[a-f0-9]+: 41 01 c0 add %eax,%r8d
+[ ]*[a-f0-9]+: 66 41 01 c0 add %ax,%r8w
+[ ]*[a-f0-9]+: 49 01 c0 add %rax,%r8
+[ ]*[a-f0-9]+: 05 11 22 33 44 add \$0x44332211,%eax
+[ ]*[a-f0-9]+: 48 05 11 22 33 f4 add \$0xfffffffff4332211,%rax
+[ ]*[a-f0-9]+: 66 05 33 44 add \$0x4433,%ax
+[ ]*[a-f0-9]+: 48 05 11 22 33 44 add \$0x44332211,%rax
+[ ]*[a-f0-9]+: 00 ca add %cl,%dl
+[ ]*[a-f0-9]+: 00 f7 add %dh,%bh
+[ ]*[a-f0-9]+: 40 00 f7 add %sil,%dil
+[ ]*[a-f0-9]+: 41 00 f7 add %sil,%r15b
+[ ]*[a-f0-9]+: 44 00 f7 add %r14b,%dil
+[ ]*[a-f0-9]+: 45 00 f7 add %r14b,%r15b
+[ ]*[a-f0-9]+: 50 push %rax
+[ ]*[a-f0-9]+: 41 50 push %r8
+[ ]*[a-f0-9]+: 41 59 pop %r9
+[ ]*[a-f0-9]+: 04 11 add \$0x11,%al
+[ ]*[a-f0-9]+: 80 c4 11 add \$0x11,%ah
+[ ]*[a-f0-9]+: 40 80 c4 11 add \$0x11,%spl
+[ ]*[a-f0-9]+: 41 80 c0 11 add \$0x11,%r8b
+[ ]*[a-f0-9]+: 41 80 c4 11 add \$0x11,%r12b
+[ ]*[a-f0-9]+: 0f 20 c0 mov %cr0,%rax
+[ ]*[a-f0-9]+: 41 0f 20 c0 mov %cr0,%r8
+[ ]*[a-f0-9]+: 44 0f 20 c0 mov %cr8,%rax
+[ ]*[a-f0-9]+: 44 0f 22 c0 mov %rax,%cr8
+[ ]*[a-f0-9]+: f3 48 a5 rep movsq %ds:\(%rsi\),%es:\(%rdi\)
+[ ]*[a-f0-9]+: 66 f3 a5 rep movsw %ds:\(%rsi\),%es:\(%rdi\)
+[ ]*[a-f0-9]+: f3 48 a5 rep movsq %ds:\(%rsi\),%es:\(%rdi\)
+[ ]*[a-f0-9]+: b0 11 mov \$0x11,%al
+[ ]*[a-f0-9]+: b4 11 mov \$0x11,%ah
+[ ]*[a-f0-9]+: 40 b4 11 mov \$0x11,%spl
+[ ]*[a-f0-9]+: 41 b4 11 mov \$0x11,%r12b
+[ ]*[a-f0-9]+: b8 44 33 22 11 mov \$0x11223344,%eax
+[ ]*[a-f0-9]+: 41 b8 44 33 22 11 mov \$0x11223344,%r8d
+[ ]*[a-f0-9]+: 48 b8 88 77 66 55 44 33 22 11 movabs \$0x1122334455667788,%rax
+[ ]*[a-f0-9]+: 49 b8 88 77 66 55 44 33 22 11 movabs \$0x1122334455667788,%r8
+[ ]*[a-f0-9]+: 03 00 add \(%rax\),%eax
+[ ]*[a-f0-9]+: 41 03 00 add \(%r8\),%eax
+[ ]*[a-f0-9]+: 45 03 00 add \(%r8\),%r8d
+[ ]*[a-f0-9]+: 49 03 00 add \(%r8\),%rax
+[ ]*[a-f0-9]+: 03 05 22 22 22 22 add 0x22222222\(%rip\),%eax # 222222c7 <foo\+0x222220c4>
+[ ]*[a-f0-9]+: 03 45 00 add 0x0\(%rbp\),%eax
+[ ]*[a-f0-9]+: 03 04 25 22 22 22 22 add 0x22222222,%eax
+[ ]*[a-f0-9]+: 41 03 45 00 add 0x0\(%r13\),%eax
+[ ]*[a-f0-9]+: 03 04 80 add \(%rax,%rax,4\),%eax
+[ ]*[a-f0-9]+: 41 03 04 80 add \(%r8,%rax,4\),%eax
+[ ]*[a-f0-9]+: 45 03 04 80 add \(%r8,%rax,4\),%r8d
+[ ]*[a-f0-9]+: 43 03 04 80 add \(%r8,%r8,4\),%eax
+[ ]*[a-f0-9]+: 46 01 04 81 add %r8d,\(%rcx,%r8,4\)
+[ ]*[a-f0-9]+: 03 14 c0 add \(%rax,%rax,8\),%edx
+[ ]*[a-f0-9]+: 03 14 c8 add \(%rax,%rcx,8\),%edx
+[ ]*[a-f0-9]+: 03 14 d0 add \(%rax,%rdx,8\),%edx
+[ ]*[a-f0-9]+: 03 14 d8 add \(%rax,%rbx,8\),%edx
+[ ]*[a-f0-9]+: 03 10 add \(%rax\),%edx
+[ ]*[a-f0-9]+: 03 14 e8 add \(%rax,%rbp,8\),%edx
+[ ]*[a-f0-9]+: 03 14 f0 add \(%rax,%rsi,8\),%edx
+[ ]*[a-f0-9]+: 03 14 f8 add \(%rax,%rdi,8\),%edx
+[ ]*[a-f0-9]+: 42 03 14 c0 add \(%rax,%r8,8\),%edx
+[ ]*[a-f0-9]+: 42 03 14 c8 add \(%rax,%r9,8\),%edx
+[ ]*[a-f0-9]+: 42 03 14 d0 add \(%rax,%r10,8\),%edx
+[ ]*[a-f0-9]+: 42 03 14 d8 add \(%rax,%r11,8\),%edx
+[ ]*[a-f0-9]+: 42 03 14 e0 add \(%rax,%r12,8\),%edx
+[ ]*[a-f0-9]+: 42 03 14 e8 add \(%rax,%r13,8\),%edx
+[ ]*[a-f0-9]+: 42 03 14 f0 add \(%rax,%r14,8\),%edx
+[ ]*[a-f0-9]+: 42 03 14 f8 add \(%rax,%r15,8\),%edx
+[ ]*[a-f0-9]+: 83 c1 11 add \$0x11,%ecx
+[ ]*[a-f0-9]+: 83 00 11 addl \$0x11,\(%rax\)
+[ ]*[a-f0-9]+: 48 83 00 11 addq \$0x11,\(%rax\)
+[ ]*[a-f0-9]+: 41 83 00 11 addl \$0x11,\(%r8\)
+[ ]*[a-f0-9]+: 83 04 81 11 addl \$0x11,\(%rcx,%rax,4\)
+[ ]*[a-f0-9]+: 41 83 04 81 11 addl \$0x11,\(%r9,%rax,4\)
+[ ]*[a-f0-9]+: 42 83 04 81 11 addl \$0x11,\(%rcx,%r8,4\)
+[ ]*[a-f0-9]+: 83 05 22 22 22 22 33 addl \$0x33,0x22222222\(%rip\) # 22222342 <foo\+0x2222213f>
+[ ]*[a-f0-9]+: 48 83 05 22 22 22 22 33 addq \$0x33,0x22222222\(%rip\) # 2222234a <foo\+0x22222147>
+[ ]*[a-f0-9]+: 81 05 22 22 22 22 33 33 33 33 addl \$0x33333333,0x22222222\(%rip\) # 22222354 <foo\+0x22222151>
+[ ]*[a-f0-9]+: 48 81 05 22 22 22 22 33 33 33 33 addq \$0x33333333,0x22222222\(%rip\) # 2222235f <foo\+0x2222215c>
+[ ]*[a-f0-9]+: 83 04 c5 22 22 22 22 33 addl \$0x33,0x22222222\(,%rax,8\)
+[ ]*[a-f0-9]+: 83 80 22 22 22 22 33 addl \$0x33,0x22222222\(%rax\)
+[ ]*[a-f0-9]+: 83 80 22 22 22 22 33 addl \$0x33,0x22222222\(%rax\)
+[ ]*[a-f0-9]+: 41 83 04 e8 33 addl \$0x33,\(%r8,%rbp,8\)
+[ ]*[a-f0-9]+: 83 04 25 22 22 22 22 33 addl \$0x33,0x22222222
+[ ]*[a-f0-9]+: a0 11 22 33 44 55 66 77 88 movabs 0x8877665544332211,%al
+[ ]*[a-f0-9]+: a1 11 22 33 44 55 66 77 88 movabs 0x8877665544332211,%eax
+[ ]*[a-f0-9]+: a2 11 22 33 44 55 66 77 88 movabs %al,0x8877665544332211
+[ ]*[a-f0-9]+: a3 11 22 33 44 55 66 77 88 movabs %eax,0x8877665544332211
+[ ]*[a-f0-9]+: 48 a1 11 22 33 44 55 66 77 88 movabs 0x8877665544332211,%rax
+[ ]*[a-f0-9]+: 48 a3 11 22 33 44 55 66 77 88 movabs %rax,0x8877665544332211
+[ ]*[a-f0-9]+: 48 99 cqto
+[ ]*[a-f0-9]+: 48 98 cltq
+[ ]*[a-f0-9]+: 48 63 c0 movslq %eax,%rax
+[ ]*[a-f0-9]+: 48 0f bf c0 movswq %ax,%rax
+[ ]*[a-f0-9]+: 48 0f be c0 movsbq %al,%rax
+
+0+1a7 <bar>:
+[ ]*[a-f0-9]+: b0 00 mov \$0x0,%al
+[ ]*[a-f0-9]+: 66 b8 00 00 mov \$0x0,%ax
+[ ]*[a-f0-9]+: b8 00 00 00 00 mov \$0x0,%eax
+[ ]*[a-f0-9]+: 48 c7 c0 00 00 00 00 mov \$0x0,%rax
+[ ]*[a-f0-9]+: a1 00 00 00 00 00 00 00 00 movabs 0x0,%eax
+[ ]*[a-f0-9]+: 8b 04 25 00 00 00 00 mov 0x0,%eax
+[ ]*[a-f0-9]+: 8b 80 00 00 00 00 mov 0x0\(%rax\),%eax
+[ ]*[a-f0-9]+: 8b 05 00 00 00 00 mov 0x0\(%rip\),%eax # 1d5 <bar\+0x2e>
+[ ]*[a-f0-9]+: b0 00 mov \$0x0,%al
+[ ]*[a-f0-9]+: 66 b8 00 00 mov \$0x0,%ax
+[ ]*[a-f0-9]+: b8 00 00 00 00 mov \$0x0,%eax
+[ ]*[a-f0-9]+: 48 c7 c0 00 00 00 00 mov \$0x0,%rax
+[ ]*[a-f0-9]+: a1 00 00 00 00 00 00 00 00 movabs 0x0,%eax
+[ ]*[a-f0-9]+: 8b 04 25 00 00 00 00 mov 0x0,%eax
+[ ]*[a-f0-9]+: 8b 80 00 00 00 00 mov 0x0\(%rax\),%eax
+[ ]*[a-f0-9]+: 8b 05 00 00 00 00 mov 0x0\(%rip\),%eax # 203 <foo>
+
+0+203 <foo>:
+[ ]*[a-f0-9]+: a0 11 22 33 44 55 66 77 88 movabs 0x8877665544332211,%al
+[ ]*[a-f0-9]+: 66 a1 11 22 33 44 55 66 77 88 movabs 0x8877665544332211,%ax
+[ ]*[a-f0-9]+: a1 11 22 33 44 55 66 77 88 movabs 0x8877665544332211,%eax
+[ ]*[a-f0-9]+: 48 a1 11 22 33 44 55 66 77 88 movabs 0x8877665544332211,%rax
+[ ]*[a-f0-9]+: a2 11 22 33 44 55 66 77 88 movabs %al,0x8877665544332211
+[ ]*[a-f0-9]+: 66 a3 11 22 33 44 55 66 77 88 movabs %ax,0x8877665544332211
+[ ]*[a-f0-9]+: a3 11 22 33 44 55 66 77 88 movabs %eax,0x8877665544332211
+[ ]*[a-f0-9]+: 48 a3 11 22 33 44 55 66 77 88 movabs %rax,0x8877665544332211
+[ ]*[a-f0-9]+: a0 11 22 33 44 55 66 77 88 movabs 0x8877665544332211,%al
+[ ]*[a-f0-9]+: 66 a1 11 22 33 44 55 66 77 88 movabs 0x8877665544332211,%ax
+[ ]*[a-f0-9]+: a1 11 22 33 44 55 66 77 88 movabs 0x8877665544332211,%eax
+[ ]*[a-f0-9]+: 48 a1 11 22 33 44 55 66 77 88 movabs 0x8877665544332211,%rax
+[ ]*[a-f0-9]+: a2 11 22 33 44 55 66 77 88 movabs %al,0x8877665544332211
+[ ]*[a-f0-9]+: 66 a3 11 22 33 44 55 66 77 88 movabs %ax,0x8877665544332211
+[ ]*[a-f0-9]+: a3 11 22 33 44 55 66 77 88 movabs %eax,0x8877665544332211
+[ ]*[a-f0-9]+: 48 a3 11 22 33 44 55 66 77 88 movabs %rax,0x8877665544332211
+[ ]*[a-f0-9]+: 8a 04 25 11 22 33 ff mov 0xffffffffff332211,%al
+[ ]*[a-f0-9]+: 66 8b 04 25 11 22 33 ff mov 0xffffffffff332211,%ax
+[ ]*[a-f0-9]+: 8b 04 25 11 22 33 ff mov 0xffffffffff332211,%eax
+[ ]*[a-f0-9]+: 48 8b 04 25 11 22 33 ff mov 0xffffffffff332211,%rax
+[ ]*[a-f0-9]+: 88 04 25 11 22 33 ff mov %al,0xffffffffff332211
+[ ]*[a-f0-9]+: 66 89 04 25 11 22 33 ff mov %ax,0xffffffffff332211
+[ ]*[a-f0-9]+: 89 04 25 11 22 33 ff mov %eax,0xffffffffff332211
+[ ]*[a-f0-9]+: 48 89 04 25 11 22 33 ff mov %rax,0xffffffffff332211
+[ ]*[a-f0-9]+: 8a 04 25 11 22 33 ff mov 0xffffffffff332211,%al
+[ ]*[a-f0-9]+: 66 8b 04 25 11 22 33 ff mov 0xffffffffff332211,%ax
+[ ]*[a-f0-9]+: 8b 04 25 11 22 33 ff mov 0xffffffffff332211,%eax
+[ ]*[a-f0-9]+: 48 8b 04 25 11 22 33 ff mov 0xffffffffff332211,%rax
+[ ]*[a-f0-9]+: 88 04 25 11 22 33 ff mov %al,0xffffffffff332211
+[ ]*[a-f0-9]+: 66 89 04 25 11 22 33 ff mov %ax,0xffffffffff332211
+[ ]*[a-f0-9]+: 89 04 25 11 22 33 ff mov %eax,0xffffffffff332211
+[ ]*[a-f0-9]+: 48 89 04 25 11 22 33 ff mov %rax,0xffffffffff332211
+[ ]*[a-f0-9]+: 48 0f c7 08 cmpxchg16b \(%rax\)
+[ ]*[a-f0-9]+: 48 0f c7 08 cmpxchg16b \(%rax\)
+[ ]*[a-f0-9]+: 66 0f be f0 movsbw %al,%si
+[ ]*[a-f0-9]+: 0f be f0 movsbl %al,%esi
+[ ]*[a-f0-9]+: 48 0f be f0 movsbq %al,%rsi
+[ ]*[a-f0-9]+: 0f bf f0 movswl %ax,%esi
+[ ]*[a-f0-9]+: 48 0f bf f0 movswq %ax,%rsi
+[ ]*[a-f0-9]+: 48 63 f0 movslq %eax,%rsi
+[ ]*[a-f0-9]+: 0f be 10 movsbl \(%rax\),%edx
+[ ]*[a-f0-9]+: 48 0f be 10 movsbq \(%rax\),%rdx
+[ ]*[a-f0-9]+: 66 0f be 10 movsbw \(%rax\),%dx
+[ ]*[a-f0-9]+: 0f be 10 movsbl \(%rax\),%edx
+[ ]*[a-f0-9]+: 48 0f be 10 movsbq \(%rax\),%rdx
+[ ]*[a-f0-9]+: 66 0f be 10 movsbw \(%rax\),%dx
+[ ]*[a-f0-9]+: 0f bf 10 movswl \(%rax\),%edx
+[ ]*[a-f0-9]+: 48 0f bf 10 movswq \(%rax\),%rdx
+[ ]*[a-f0-9]+: 66 0f b6 f0 movzbw %al,%si
+[ ]*[a-f0-9]+: 0f b6 f0 movzbl %al,%esi
+[ ]*[a-f0-9]+: 48 0f b6 f0 movzbq %al,%rsi
+[ ]*[a-f0-9]+: 0f b7 f0 movzwl %ax,%esi
+[ ]*[a-f0-9]+: 48 0f b7 f0 movzwq %ax,%rsi
+[ ]*[a-f0-9]+: 0f b6 10 movzbl \(%rax\),%edx
+[ ]*[a-f0-9]+: 48 0f b6 10 movzbq \(%rax\),%rdx
+[ ]*[a-f0-9]+: 66 0f b6 10 movzbw \(%rax\),%dx
+[ ]*[a-f0-9]+: 0f b6 10 movzbl \(%rax\),%edx
+[ ]*[a-f0-9]+: 48 0f b6 10 movzbq \(%rax\),%rdx
+[ ]*[a-f0-9]+: 66 0f b6 10 movzbw \(%rax\),%dx
+[ ]*[a-f0-9]+: 0f b6 10 movzbl \(%rax\),%edx
+[ ]*[a-f0-9]+: 48 0f b6 10 movzbq \(%rax\),%rdx
+[ ]*[a-f0-9]+: 66 0f b6 10 movzbw \(%rax\),%dx
+[ ]*[a-f0-9]+: 0f b7 10 movzwl \(%rax\),%edx
+[ ]*[a-f0-9]+: 48 0f b7 10 movzwq \(%rax\),%rdx
+[ ]*[a-f0-9]+: 66 0f be f0 movsbw %al,%si
+[ ]*[a-f0-9]+: 0f be f0 movsbl %al,%esi
+[ ]*[a-f0-9]+: 48 0f be f0 movsbq %al,%rsi
+[ ]*[a-f0-9]+: 0f bf f0 movswl %ax,%esi
+[ ]*[a-f0-9]+: 48 0f bf f0 movswq %ax,%rsi
+[ ]*[a-f0-9]+: 48 63 f0 movslq %eax,%rsi
+[ ]*[a-f0-9]+: 0f be 10 movsbl \(%rax\),%edx
+[ ]*[a-f0-9]+: 48 0f be 10 movsbq \(%rax\),%rdx
+[ ]*[a-f0-9]+: 66 0f be 10 movsbw \(%rax\),%dx
+[ ]*[a-f0-9]+: 0f bf 10 movswl \(%rax\),%edx
+[ ]*[a-f0-9]+: 48 0f bf 10 movswq \(%rax\),%rdx
+[ ]*[a-f0-9]+: 66 0f b6 f0 movzbw %al,%si
+[ ]*[a-f0-9]+: 0f b6 f0 movzbl %al,%esi
+[ ]*[a-f0-9]+: 48 0f b6 f0 movzbq %al,%rsi
+[ ]*[a-f0-9]+: 0f b7 f0 movzwl %ax,%esi
+[ ]*[a-f0-9]+: 48 0f b7 f0 movzwq %ax,%rsi
+[ ]*[a-f0-9]+: 0f b6 10 movzbl \(%rax\),%edx
+[ ]*[a-f0-9]+: 48 0f b6 10 movzbq \(%rax\),%rdx
+[ ]*[a-f0-9]+: 66 0f b6 10 movzbw \(%rax\),%dx
+[ ]*[a-f0-9]+: 0f b7 10 movzwl \(%rax\),%edx
+[ ]*[a-f0-9]+: 48 0f b7 10 movzwq \(%rax\),%rdx
+[ ]*[a-f0-9]+: f3 0f 7e 0c 24 movq \(%rsp\),%xmm1
+[ ]*[a-f0-9]+: f3 0f 7e 0c 24 movq \(%rsp\),%xmm1
+[ ]*[a-f0-9]+: 66 0f d6 0c 24 movq %xmm1,\(%rsp\)
+[ ]*[a-f0-9]+: 66 0f d6 0c 24 movq %xmm1,\(%rsp\)
+[ ]*[a-f0-9]+: df e0 fnstsw %ax
+[ ]*[a-f0-9]+: df e0 fnstsw %ax
+[ ]*[a-f0-9]+: 9b df e0 fstsw %ax
+[ ]*[a-f0-9]+: 9b df e0 fstsw %ax
+[ ]*[a-f0-9]+: df e0 fnstsw %ax
+[ ]*[a-f0-9]+: df e0 fnstsw %ax
+[ ]*[a-f0-9]+: 9b df e0 fstsw %ax
+[ ]*[a-f0-9]+: 9b df e0 fstsw %ax
+[ ]*[a-f0-9]+: 66 0f be 00 movsbw \(%rax\),%ax
+[ ]*[a-f0-9]+: 0f be 00 movsbl \(%rax\),%eax
+[ ]*[a-f0-9]+: 48 0f be 00 movsbq \(%rax\),%rax
+[ ]*[a-f0-9]+: 66 0f be 10 movsbw \(%rax\),%dx
+[ ]*[a-f0-9]+: 0f be 10 movsbl \(%rax\),%edx
+[ ]*[a-f0-9]+: 48 0f be 10 movsbq \(%rax\),%rdx
+[ ]*[a-f0-9]+: 0f bf 10 movswl \(%rax\),%edx
+[ ]*[a-f0-9]+: 48 0f bf 10 movswq \(%rax\),%rdx
+[ ]*[a-f0-9]+: 48 63 10 movslq \(%rax\),%rdx
+[ ]*[a-f0-9]+: 48 63 00 movslq \(%rax\),%rax
+[ ]*[a-f0-9]+: 66 0f b6 00 movzbw \(%rax\),%ax
+[ ]*[a-f0-9]+: 0f b6 00 movzbl \(%rax\),%eax
+[ ]*[a-f0-9]+: 48 0f b6 00 movzbq \(%rax\),%rax
+[ ]*[a-f0-9]+: 66 0f b6 10 movzbw \(%rax\),%dx
+[ ]*[a-f0-9]+: 0f b6 10 movzbl \(%rax\),%edx
+[ ]*[a-f0-9]+: 48 0f b6 10 movzbq \(%rax\),%rdx
+[ ]*[a-f0-9]+: 0f b7 10 movzwl \(%rax\),%edx
+[ ]*[a-f0-9]+: 48 0f b7 10 movzwq \(%rax\),%rdx
+[ ]*[a-f0-9]+: 0f c3 00 movnti %eax,\(%rax\)
+[ ]*[a-f0-9]+: 0f c3 00 movnti %eax,\(%rax\)
+[ ]*[a-f0-9]+: 48 0f c3 00 movnti %rax,\(%rax\)
+[ ]*[a-f0-9]+: 48 0f c3 00 movnti %rax,\(%rax\)
+[ ]*[a-f0-9]+: 66 0f be 00 movsbw \(%rax\),%ax
+[ ]*[a-f0-9]+: 0f be 00 movsbl \(%rax\),%eax
+[ ]*[a-f0-9]+: 0f bf 00 movswl \(%rax\),%eax
+[ ]*[a-f0-9]+: 48 0f bf 00 movswq \(%rax\),%rax
+[ ]*[a-f0-9]+: 48 63 00 movslq \(%rax\),%rax
+[ ]*[a-f0-9]+: 48 63 00 movslq \(%rax\),%rax
+[ ]*[a-f0-9]+: 66 0f b6 00 movzbw \(%rax\),%ax
+[ ]*[a-f0-9]+: 0f b6 00 movzbl \(%rax\),%eax
+[ ]*[a-f0-9]+: 0f b7 00 movzwl \(%rax\),%eax
+[ ]*[a-f0-9]+: 48 0f b7 00 movzwq \(%rax\),%rax
+[ ]*[a-f0-9]+: 0f c3 00 movnti %eax,\(%rax\)
+[ ]*[a-f0-9]+: 48 0f c3 00 movnti %rax,\(%rax\)
+#pass
diff --git a/include/elf/common.h b/include/elf/common.h
index 1d704b1..e46ae33 100644
--- a/include/elf/common.h
+++ b/include/elf/common.h
@@ -285,7 +285,7 @@
#define EM_ETPU 178 /* Freescale Extended Time Processing Unit */
#define EM_SLE9X 179 /* Infineon Technologies SLE9X core */
#define EM_L1OM 180 /* Intel L1OM */
-#define EM_INTEL181 181 /* Reserved by Intel */
+#define EM_K1OM 181 /* Intel K1OM */
#define EM_INTEL182 182 /* Reserved by Intel */
#define EM_res183 183 /* Reserved by ARM */
#define EM_res184 184 /* Reserved by ARM */
diff --git a/ld/Makefile.am b/ld/Makefile.am
index 445c92e..5ae86ba 100644
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -481,6 +481,8 @@ ALL_64_EMULATION_SOURCES = \
eelf64tilegx.c \
eelf_l1om.c \
eelf_l1om_fbsd.c \
+ eelf_k1om.c \
+ eelf_k1om_fbsd.c \
eelf_x86_64.c \
eelf_x86_64_fbsd.c \
eelf_x86_64_sol2.c \
@@ -1981,6 +1983,13 @@ eelf_l1om_fbsd.c: $(srcdir)/emulparams/elf_l1om_fbsd.sh \
$(srcdir)/emulparams/elf_l1om.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf_l1om_fbsd "$(tdir_elf_l1om_fbsd)"
+eelf_k1om.c: $(srcdir)/emulparams/elf_k1om.sh \
+ $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf_k1om "$(tdir_elf_k1om)"
+eelf_k1om_fbsd.c: $(srcdir)/emulparams/elf_k1om_fbsd.sh \
+ $(srcdir)/emulparams/elf_k1om.sh \
+ $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf_k1om_fbsd "$(tdir_elf_k1om_fbsd)"
eelf_x86_64.c: $(srcdir)/emulparams/elf_x86_64.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf_x86_64 "$(tdir_elf_x86_64)"
diff --git a/ld/Makefile.in b/ld/Makefile.in
index 526b7e1..f062b92 100644
--- a/ld/Makefile.in
+++ b/ld/Makefile.in
@@ -786,6 +786,8 @@ ALL_64_EMULATION_SOURCES = \
eelf64tilegx.c \
eelf_l1om.c \
eelf_l1om_fbsd.c \
+ eelf_k1om.c \
+ eelf_k1om_fbsd.c \
eelf_x86_64.c \
eelf_x86_64_fbsd.c \
eelf_x86_64_sol2.c \
@@ -1186,6 +1188,8 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386_ldso.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386_sol2.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386_vxworks.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_k1om.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_k1om_fbsd.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_l1om.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_l1om_fbsd.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_s390.Po@am__quote@
@@ -3432,6 +3436,13 @@ eelf_l1om_fbsd.c: $(srcdir)/emulparams/elf_l1om_fbsd.sh \
$(srcdir)/emulparams/elf_l1om.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf_l1om_fbsd "$(tdir_elf_l1om_fbsd)"
+eelf_k1om.c: $(srcdir)/emulparams/elf_k1om.sh \
+ $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf_k1om "$(tdir_elf_k1om)"
+eelf_k1om_fbsd.c: $(srcdir)/emulparams/elf_k1om_fbsd.sh \
+ $(srcdir)/emulparams/elf_k1om.sh \
+ $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf_k1om_fbsd "$(tdir_elf_k1om_fbsd)"
eelf_x86_64.c: $(srcdir)/emulparams/elf_x86_64.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf_x86_64 "$(tdir_elf_x86_64)"
diff --git a/ld/configure.tgt b/ld/configure.tgt
index f35298c..23cf347 100644
--- a/ld/configure.tgt
+++ b/ld/configure.tgt
@@ -186,23 +186,23 @@ i[3-7]86-*-linux*aout*) targ_emul=i386linux
i[3-7]86-*-linux*oldld) targ_emul=i386linux; targ_extra_emuls=elf_i386 ;;
i[3-7]86-*-linux-*) targ_emul=elf_i386
targ_extra_emuls=i386linux
- targ64_extra_emuls="elf_x86_64 elf32_x86_64 elf_l1om"
+ targ64_extra_emuls="elf_x86_64 elf32_x86_64 elf_l1om elf_k1om"
targ64_extra_libpath=elf_x86_64
targ_extra_libpath=elf32_x86_64
tdir_i386linux=${targ_alias}aout ;;
x86_64-*-linux-*) targ_emul=elf_x86_64
- targ_extra_emuls="elf32_x86_64 elf_i386 i386linux elf_l1om"
- targ_extra_libpath="elf_i386 elf32_x86_64 elf_l1om"
+ targ_extra_emuls="elf32_x86_64 elf_i386 i386linux elf_l1om elf_k1om"
+ targ_extra_libpath="elf_i386 elf32_x86_64 elf_l1om elf_k1om"
tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'`
tdir_elf_i386=`echo ${targ_alias} | sed -e 's/x86_64/i386/'` ;;
i[3-7]86-*-sysv[45]*) targ_emul=elf_i386 ;;
i[3-7]86-*-solaris2*) targ_emul=elf_i386_sol2
- targ_extra_emuls="elf_i386_ldso elf_i386 elf_x86_64_sol2 elf_x86_64 elf_l1om"
+ targ_extra_emuls="elf_i386_ldso elf_i386 elf_x86_64_sol2 elf_x86_64 elf_l1om elf_k1om"
targ_extra_libpath=$targ_extra_emuls
;;
x86_64-*-solaris2*)
targ_emul=elf_x86_64_sol2
- targ_extra_emuls="elf_x86_64 elf_i386_sol2 elf_i386_ldso elf_i386 elf_l1om"
+ targ_extra_emuls="elf_x86_64 elf_i386_sol2 elf_i386_ldso elf_i386 elf_l1om elf_k1om"
targ_extra_libpath=elf_i386
tdir_elf_i386=`echo ${targ_alias} | sed -e 's/x86_64/i386/'` ;;
i[3-7]86-*-unixware) targ_emul=elf_i386 ;;
@@ -220,7 +220,7 @@ i[3-7]86-*-netbsdpe*) targ_emul=i386pe
i[3-7]86-*-netbsd*) targ_emul=i386nbsd
targ_extra_emuls=elf_i386 ;;
x86_64-*-netbsd*) targ_emul=elf_x86_64
- targ_extra_emuls="elf_i386 i386nbsd elf_l1om"
+ targ_extra_emuls="elf_i386 i386nbsd elf_l1om elf_k1om"
tdir_elf_i386=`echo ${targ_alias} | \
sed -e 's/x86_64/i386/'`
case "${tdir_elf_i386}" in
@@ -231,7 +231,7 @@ x86_64-*-netbsd*) targ_emul=elf_x86_64
i[3-7]86-*-netware) targ_emul=i386nw ;;
i[3-7]86-*-elf*) targ_emul=elf_i386 ;;
x86_64-*-elf*) targ_emul=elf_x86_64
- targ_extra_emuls="elf_i386 elf_l1om"
+ targ_extra_emuls="elf_i386 elf_l1om elf_k1om"
;;
i[3-7]86-*-kaos*) targ_emul=elf_i386 ;;
i[3-7]86-*-freebsdaout* | i[3-7]86-*-freebsd[12].* | i[3-7]86-*-freebsd[12])
@@ -239,13 +239,13 @@ i[3-7]86-*-freebsdaout* | i[3-7]86-*-freebsd[12].* | i[3-7]86-*-freebsd[12])
i[3-7]86-*-dragonfly*) targ_emul=elf_i386
targ_extra_emuls="i386bsd" ;;
x86_64-*-dragonfly*) targ_emul=elf_x86_64
- targ_extra_emuls="elf_i386 elf_l1om" ;;
+ targ_extra_emuls="elf_i386 elf_l1om elf_k1om" ;;
i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu)
targ_emul=elf_i386_fbsd
targ_extra_emuls="elf_i386 i386bsd" ;;
x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu)
targ_emul=elf_x86_64_fbsd
- targ_extra_emuls="elf_i386_fbsd elf_x86_64 elf_i386 elf_l1om elf_l1om_fbsd"
+ targ_extra_emuls="elf_i386_fbsd elf_x86_64 elf_i386 elf_l1om elf_l1om_fbsd elf_k1om elf_k1om_fbsd"
targ_extra_libpath="elf_i386_fbsd"
tdir_elf_i386_fbsd=`echo ${targ_alias} \
| sed -e 's/x86_64/i386/'`
diff --git a/ld/emulparams/elf_k1om.sh b/ld/emulparams/elf_k1om.sh
new file mode 100644
index 0000000..ad4b955
--- /dev/null
+++ b/ld/emulparams/elf_k1om.sh
@@ -0,0 +1,35 @@
+. ${srcdir}/emulparams/plt_unwind.sh
+SCRIPT_NAME=elf
+ELFSIZE=64
+OUTPUT_FORMAT="elf64-k1om"
+NO_REL_RELOCS=yes
+TEXT_START_ADDR=0x400000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
+COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
+ARCH="k1om"
+MACHINE=
+COMPILE_IN=yes
+NOP=0x90909090
+TEMPLATE_NAME=elf32
+GENERATE_SHLIB_SCRIPT=yes
+GENERATE_PIE_SCRIPT=yes
+NO_SMALL_DATA=yes
+LARGE_SECTIONS=yes
+SEPARATE_GOTPLT=24
+
+if [ "x${host}" = "x${target}" ]; then
+ case " $EMULATION_LIBPATH " in
+ *" ${EMULATION_NAME} "*)
+ NATIVE=yes
+ esac
+fi
+
+# Linux modifies the default library search path to first include
+# a 64-bit specific directory.
+case "$target" in
+ *k1om*-linux*)
+ case "$EMULATION_NAME" in
+ *k1om*) LIBPATH_SUFFIX=64 ;;
+ esac
+ ;;
+esac
diff --git a/ld/emulparams/elf_k1om_fbsd.sh b/ld/emulparams/elf_k1om_fbsd.sh
new file mode 100644
index 0000000..98f8033
--- /dev/null
+++ b/ld/emulparams/elf_k1om_fbsd.sh
@@ -0,0 +1,3 @@
+. ${srcdir}/emulparams/elf_k1om.sh
+. ${srcdir}/emulparams/elf_fbsd.sh
+OUTPUT_FORMAT="elf64-k1om-freebsd"
diff --git a/ld/testsuite/ld-x86-64/abs-k1om.d b/ld/testsuite/ld-x86-64/abs-k1om.d
new file mode 100644
index 0000000..2c26639
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/abs-k1om.d
@@ -0,0 +1,11 @@
+#name: Absolute non-overflowing relocs
+#source: ../ld-i386/abs.s
+#source: ../ld-i386/zero.s
+#as: --64 -march=k1om
+#ld: -m elf_k1om
+#objdump: -rs -j .text
+
+.*: file format .*
+
+Contents of section \.text:
+[ ][0-9a-f]+ c800fff0 c8000110 c9c3.*
diff --git a/ld/testsuite/ld-x86-64/protected2-k1om.d b/ld/testsuite/ld-x86-64/protected2-k1om.d
new file mode 100644
index 0000000..4e03599
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/protected2-k1om.d
@@ -0,0 +1,17 @@
+#source: protected2.s
+#as: --64 -march=k1om
+#ld: -shared -melf_k1om
+#objdump: -drw
+
+.*: +file format .*
+
+
+Disassembly of section .text:
+
+0+[a-f0-9]+ <foo>:
+[ ]*[a-f0-9]+: c3 retq
+
+0+[a-f0-9]+ <bar>:
+[ ]*[a-f0-9]+: e8 fa ff ff ff callq [a-f0-9]+ <foo>
+[ ]*[a-f0-9]+: c3 retq
+#pass
diff --git a/ld/testsuite/ld-x86-64/protected3-k1om.d b/ld/testsuite/ld-x86-64/protected3-k1om.d
new file mode 100644
index 0000000..36d6656
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/protected3-k1om.d
@@ -0,0 +1,16 @@
+#source: protected3.s
+#as: --64 -march=k1om
+#ld: -shared -melf_k1om
+#readelf: -h
+
+ELF Header:
+ Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
+ Class: ELF64
+ Data: 2's complement, little endian
+ Version: 1 \(current\)
+ OS/ABI: UNIX - System V
+ ABI Version: 0
+ Type: DYN \(Shared object file\)
+ Machine: Intel K1OM
+ Version: 0x1
+#pass
diff --git a/opcodes/configure b/opcodes/configure
index e9d1330..47f9393 100755
--- a/opcodes/configure
+++ b/opcodes/configure
@@ -12423,7 +12423,7 @@ if test x${all_targets} = xfalse ; then
bfd_h8500_arch) ta="$ta h8500-dis.lo" ;;
bfd_hppa_arch) ta="$ta hppa-dis.lo" ;;
bfd_i370_arch) ta="$ta i370-dis.lo i370-opc.lo" ;;
- bfd_i386_arch|bfd_l1om_arch)
+ bfd_i386_arch|bfd_l1om_arch|bfd_k1om_arch)
ta="$ta i386-dis.lo i386-opc.lo" ;;
bfd_i860_arch) ta="$ta i860-dis.lo" ;;
bfd_i960_arch) ta="$ta i960-dis.lo" ;;
diff --git a/opcodes/configure.in b/opcodes/configure.in
index f4fffaf..0e35a18 100644
--- a/opcodes/configure.in
+++ b/opcodes/configure.in
@@ -237,7 +237,7 @@ if test x${all_targets} = xfalse ; then
bfd_h8500_arch) ta="$ta h8500-dis.lo" ;;
bfd_hppa_arch) ta="$ta hppa-dis.lo" ;;
bfd_i370_arch) ta="$ta i370-dis.lo i370-opc.lo" ;;
- bfd_i386_arch|bfd_l1om_arch)
+ bfd_i386_arch|bfd_l1om_arch|bfd_k1om_arch)
ta="$ta i386-dis.lo i386-opc.lo" ;;
bfd_i860_arch) ta="$ta i860-dis.lo" ;;
bfd_i960_arch) ta="$ta i960-dis.lo" ;;
diff --git a/opcodes/disassemble.c b/opcodes/disassemble.c
index fe54523..2919271 100644
--- a/opcodes/disassemble.c
+++ b/opcodes/disassemble.c
@@ -200,6 +200,7 @@ disassembler (abfd)
#ifdef ARCH_i386
case bfd_arch_i386:
case bfd_arch_l1om:
+ case bfd_arch_k1om:
disassemble = print_insn_i386;
break;
#endif
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c
index d284afc..8420f55 100644
--- a/opcodes/i386-dis.c
+++ b/opcodes/i386-dis.c
@@ -11166,7 +11166,9 @@ print_insn (bfd_vma pc, disassemble_info *info)
|| info->mach == bfd_mach_x64_32_intel_syntax
|| info->mach == bfd_mach_x64_32
|| info->mach == bfd_mach_l1om
- || info->mach == bfd_mach_l1om_intel_syntax)
+ || info->mach == bfd_mach_l1om_intel_syntax
+ || info->mach == bfd_mach_k1om
+ || info->mach == bfd_mach_k1om_intel_syntax)
address_mode = mode_64bit;
else
address_mode = mode_32bit;
@@ -11175,16 +11177,19 @@ print_insn (bfd_vma pc, disassemble_info *info)
intel_syntax = (info->mach == bfd_mach_i386_i386_intel_syntax
|| info->mach == bfd_mach_x86_64_intel_syntax
|| info->mach == bfd_mach_x64_32_intel_syntax
- || info->mach == bfd_mach_l1om_intel_syntax);
+ || info->mach == bfd_mach_l1om_intel_syntax
+ || info->mach == bfd_mach_k1om_intel_syntax);
if (info->mach == bfd_mach_i386_i386
|| info->mach == bfd_mach_x86_64
|| info->mach == bfd_mach_x64_32
|| info->mach == bfd_mach_l1om
+ || info->mach == bfd_mach_k1om
|| info->mach == bfd_mach_i386_i386_intel_syntax
|| info->mach == bfd_mach_x86_64_intel_syntax
|| info->mach == bfd_mach_x64_32_intel_syntax
- || info->mach == bfd_mach_l1om_intel_syntax)
+ || info->mach == bfd_mach_l1om_intel_syntax
+ || info->mach == bfd_mach_k1om_intel_syntax)
priv.orig_sizeflag = AFLAG | DFLAG;
else if (info->mach == bfd_mach_i386_i8086)
priv.orig_sizeflag = 0;
diff --git a/opcodes/i386-gen.c b/opcodes/i386-gen.c
index 8435466..4dd75a2 100644
--- a/opcodes/i386-gen.c
+++ b/opcodes/i386-gen.c
@@ -43,7 +43,7 @@ typedef struct initializer
static initializer cpu_flag_init[] =
{
{ "CPU_UNKNOWN_FLAGS",
- "~CpuL1OM" },
+ "~(CpuL1OM|CpuK1OM)" },
{ "CPU_GENERIC32_FLAGS",
"Cpu186|Cpu286|Cpu386" },
{ "CPU_GENERIC64_FLAGS",
@@ -184,6 +184,8 @@ static initializer cpu_flag_init[] =
"CpuAVX|CpuAVX2" },
{ "CPU_L1OM_FLAGS",
"unknown" },
+ { "CPU_K1OM_FLAGS",
+ "unknown" },
};
static initializer operand_type_init[] =
@@ -319,6 +321,7 @@ static bitfield cpu_flags[] =
BITFIELD (CpuAVX),
BITFIELD (CpuAVX2),
BITFIELD (CpuL1OM),
+ BITFIELD (CpuK1OM),
BITFIELD (CpuSSE4a),
BITFIELD (Cpu3dnow),
BITFIELD (Cpu3dnowA),
diff --git a/opcodes/i386-opc.h b/opcodes/i386-opc.h
index 1a791e4..8d5dade 100644
--- a/opcodes/i386-opc.h
+++ b/opcodes/i386-opc.h
@@ -96,6 +96,8 @@ enum
CpuAVX2,
/* Intel L1OM support required */
CpuL1OM,
+ /* Intel K1OM support required */
+ CpuK1OM,
/* Xsave/xrstor New Instructions support required */
CpuXsave,
/* Xsaveopt New Instructions support required */
@@ -191,6 +193,7 @@ typedef union i386_cpu_flags
unsigned int cpuavx:1;
unsigned int cpuavx2:1;
unsigned int cpul1om:1;
+ unsigned int cpuk1om:1;
unsigned int cpuxsave:1;
unsigned int cpuxsaveopt:1;
unsigned int cpuaes:1;