aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2011-07-22 20:22:38 +0000
committerH.J. Lu <hjl.tools@gmail.com>2011-07-22 20:22:38 +0000
commit7a9068fe16462c35cdccd371fe588111dd1866ea (patch)
treefc029bfd43870ee5597a6fbf0544b20a1601bbc2 /bfd
parent9ccb86e77ea83a18c9fc336ac16a73bcbeb8030d (diff)
downloadgdb-7a9068fe16462c35cdccd371fe588111dd1866ea.zip
gdb-7a9068fe16462c35cdccd371fe588111dd1866ea.tar.gz
gdb-7a9068fe16462c35cdccd371fe588111dd1866ea.tar.bz2
Add initial Intel K1OM support.
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.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog31
-rw-r--r--bfd/Makefile.am2
-rw-r--r--bfd/Makefile.in3
-rw-r--r--bfd/archures.c5
-rw-r--r--bfd/bfd-in2.h3
-rw-r--r--bfd/config.bfd35
-rwxr-xr-xbfd/configure2
-rw-r--r--bfd/configure.in2
-rw-r--r--bfd/cpu-k1om.c56
-rw-r--r--bfd/elf64-x86-64.c50
-rw-r--r--bfd/targets.c4
11 files changed, 179 insertions, 14 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 97594a6..88994a4 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,34 @@
+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.
+
2011-07-20 Jan Kratochvil <jan.kratochvil@redhat.com>
Fix false coff-go32-exe matches.
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,