aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorPaul Iannetta <piannetta@kalrayinc.com>2023-08-16 14:22:28 +0100
committerNick Clifton <nickc@redhat.com>2023-08-16 14:22:54 +0100
commit6e712424f5cb1f01acf41c21f8721ee028c2a20c (patch)
treee385426177cc05115d8f5d69df67c6933ddfe6c3 /binutils
parent7d6a2e34ee8eb061cf73014efefefaa074b499db (diff)
downloadbinutils-6e712424f5cb1f01acf41c21f8721ee028c2a20c.zip
binutils-6e712424f5cb1f01acf41c21f8721ee028c2a20c.tar.gz
binutils-6e712424f5cb1f01acf41c21f8721ee028c2a20c.tar.bz2
kvx: New port.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/readelf.c26
-rw-r--r--binutils/testsuite/binutils-all/nm.exp1
-rw-r--r--binutils/testsuite/binutils-all/objcopy.exp1
-rw-r--r--binutils/testsuite/binutils-all/objdump.exp2
-rw-r--r--binutils/testsuite/lib/binutils-common.exp7
5 files changed, 37 insertions, 0 deletions
diff --git a/binutils/readelf.c b/binutils/readelf.c
index bd112ff..a06ec79 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -121,6 +121,7 @@
#include "elf/i960.h"
#include "elf/ia64.h"
#include "elf/ip2k.h"
+#include "elf/kvx.h"
#include "elf/lm32.h"
#include "elf/iq2000.h"
#include "elf/m32c.h"
@@ -1084,6 +1085,7 @@ guess_is_rela (unsigned int e_machine)
case EM_IP2K:
case EM_IP2K_OLD:
case EM_IQ2000:
+ case EM_KVX:
case EM_LATTICEMICO32:
case EM_M32C_OLD:
case EM_M32C:
@@ -1768,6 +1770,10 @@ dump_relocations (Filedata *filedata,
rtype = elf_ia64_reloc_type (type);
break;
+ case EM_KVX:
+ rtype = elf_kvx_reloc_type (type);
+ break;
+
case EM_CRIS:
rtype = elf_cris_reloc_type (type);
break;
@@ -4736,6 +4742,17 @@ get_machine_flags (Filedata * filedata, unsigned e_flags, unsigned e_machine)
out = stpcpy (out, ", relocatable module");
break;
+ case EM_KVX:
+ if ((e_flags & (ELF_KVX_CORE_MAJOR_MASK | ELF_KVX_CORE_MINOR_MASK)) == ELF_KVX_CORE_KV3_1)
+ strcat (buf, ", Kalray VLIW kv3-1");
+ else if ((e_flags & (ELF_KVX_CORE_MAJOR_MASK | ELF_KVX_CORE_MINOR_MASK)) == ELF_KVX_CORE_KV3_2)
+ strcat (buf, ", Kalray VLIW kv3-2");
+ else if ((e_flags & (ELF_KVX_CORE_MAJOR_MASK | ELF_KVX_CORE_MINOR_MASK)) == ELF_KVX_CORE_KV4_1)
+ strcat (buf, ", Kalray VLIW kv4-1");
+ else
+ strcat (buf, ", unknown KVX MPPA");
+ break;
+
case EM_MSP430:
out = decode_MSP430_machine_flags (out, e_flags);
break;
@@ -14720,6 +14737,8 @@ is_32bit_abs_reloc (Filedata * filedata, unsigned int reloc_type)
return reloc_type == 2; /* R_IP2K_32. */
case EM_IQ2000:
return reloc_type == 2; /* R_IQ2000_32. */
+ case EM_KVX:
+ return reloc_type == 2; /* R_KVX_32. */
case EM_LATTICEMICO32:
return reloc_type == 3; /* R_LM32_32. */
case EM_LOONGARCH:
@@ -14917,6 +14936,8 @@ is_32bit_pcrel_reloc (Filedata * filedata, unsigned int reloc_type)
case EM_XTENSA_OLD:
case EM_XTENSA:
return reloc_type == 14; /* R_XTENSA_32_PCREL. */
+ case EM_KVX:
+ return reloc_type == 7; /* R_KVX_32_PCREL */
default:
/* Do not abort or issue an error message here. Not all targets use
pc-relative 32-bit relocs in their DWARF debug information and we
@@ -14968,6 +14989,8 @@ is_64bit_abs_reloc (Filedata * filedata, unsigned int reloc_type)
return reloc_type == 1; /* R_TILEGX_64. */
case EM_MIPS:
return reloc_type == 18; /* R_MIPS_64. */
+ case EM_KVX:
+ return reloc_type == 3; /* R_KVX_64 */
default:
return false;
}
@@ -15071,6 +15094,8 @@ is_16bit_abs_reloc (Filedata * filedata, unsigned int reloc_type)
case EM_CYGNUS_MN10300:
case EM_MN10300:
return reloc_type == 2; /* R_MN10300_16. */
+ case EM_KVX:
+ return reloc_type == 1; /* R_KVX_16 */
case EM_MSP430:
if (uses_msp430x_relocs (filedata))
return reloc_type == 2; /* R_MSP430_ABS16. */
@@ -15333,6 +15358,7 @@ is_none_reloc (Filedata * filedata, unsigned int reloc_type)
case EM_FT32: /* R_FT32_NONE. */
case EM_IA_64: /* R_IA64_NONE. */
case EM_K1OM: /* R_X86_64_NONE. */
+ case EM_KVX: /* R_KVX_NONE. */
case EM_L1OM: /* R_X86_64_NONE. */
case EM_M32R: /* R_M32R_NONE. */
case EM_MIPS: /* R_MIPS_NONE. */
diff --git a/binutils/testsuite/binutils-all/nm.exp b/binutils/testsuite/binutils-all/nm.exp
index 91b519d..abc8f15 100644
--- a/binutils/testsuite/binutils-all/nm.exp
+++ b/binutils/testsuite/binutils-all/nm.exp
@@ -296,6 +296,7 @@ if [is_elf_format] {
setup_xfail "*-*-hpux*"
setup_xfail "mips*-*-*" "tx39*-*-*"
setup_xfail "msp430*-*-*"
+ setup_xfail "kvx*-*-*"
setup_xfail "visium*-*-*"
setup_xfail "x86_64-*-cloudabi*"
diff --git a/binutils/testsuite/binutils-all/objcopy.exp b/binutils/testsuite/binutils-all/objcopy.exp
index 41070c3..34a9b3f 100644
--- a/binutils/testsuite/binutils-all/objcopy.exp
+++ b/binutils/testsuite/binutils-all/objcopy.exp
@@ -693,6 +693,7 @@ proc copy_setup { } {
}
if { [istarget *-*-linux*]
+ || [istarget kvx-*-*]
|| [istarget *-*-gnu*] } {
foreach i $gcc_gas_flag {
set flags "additional_flags=$i $flags"
diff --git a/binutils/testsuite/binutils-all/objdump.exp b/binutils/testsuite/binutils-all/objdump.exp
index 28a7ad6..4fe9e499 100644
--- a/binutils/testsuite/binutils-all/objdump.exp
+++ b/binutils/testsuite/binutils-all/objdump.exp
@@ -482,6 +482,8 @@ if { ![is_elf_format]
} else {
if { [istarget "or1k*-*-*"] } then {
set decodedline_testsrc $srcdir/$subdir/dw2-decodedline-1.S
+ } elseif { [istarget "kvx*-*-*"] } {
+ set decodedline_testsrc $srcdir/$subdir/dw2-decodedline-2.S
} else {
set decodedline_testsrc $srcdir/$subdir/dw2-decodedline.S
}
diff --git a/binutils/testsuite/lib/binutils-common.exp b/binutils/testsuite/lib/binutils-common.exp
index b944d0a..f89ac8a 100644
--- a/binutils/testsuite/lib/binutils-common.exp
+++ b/binutils/testsuite/lib/binutils-common.exp
@@ -41,6 +41,7 @@ proc is_elf_format {} {
&& ![istarget *-*-irix5*]
&& ![istarget *-*-irix6*]
&& ![istarget *-*-kaos*]
+ && ![istarget kvx-*-*]
&& ![istarget *-*-*linux*]
&& ![istarget *-*-lynxos*]
&& ![istarget *-*-nacl*]
@@ -255,6 +256,7 @@ proc supports_gnu_osabi {} {
if { [istarget "arm*-*-*"]
|| [istarget "msp430-*-*"]
|| [istarget "hppa-unknown-elf"]
+ || [istarget "kvx*-*-*"]
|| [istarget "visium-*-*"] } {
return 0
}
@@ -371,6 +373,11 @@ proc check_pie_support { } {
global pie_available_saved
global ld
+ ## kvx-*-* does support -shared but not PIE.
+ if { [istarget "kvx*-*-*"] && ![istarget "kvx*-linux-*"] } {
+ set pie_available_saved 0
+ }
+
if {![info exists pie_available_saved]} {
set ld_output [remote_exec host $ld "-pie"]
if { [ string first "not supported" $ld_output ] >= 0 } {