]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Add support for Hexagon
authorMatheus Tavares Bernardino <quic_mathbern@quicinc.com>
Tue, 2 Apr 2024 19:55:45 +0000 (16:55 -0300)
committerMark Wielaard <mark@klomp.org>
Thu, 4 Apr 2024 16:34:57 +0000 (18:34 +0200)
This implements initial support for the Hexagon architecture. The
Hexagon ABI spec can be seen at
https://lists.llvm.org/pipermail/llvm-dev/attachments/20190916/21516a52/attachment-0001.pdf

A hello_hexagon.ko test is also added.

$ head tests/test-suite.log
  [...]
  # TOTAL: 275
  # PASS:  269
  # SKIP:  6
  # XFAIL: 0
  # FAIL:  0
  # XPASS: 0
  # ERROR: 0

$ cat tests/run-strip-reloc-ko.sh.log
  [...]
  runtest hello_hexagon.ko
  PASS run-strip-reloc-ko.sh (exit status: 0)

* backends/Makefile.am (modules): Add hexagon.
(hexagon_SRCS): New var for hexagon_init.c and hexagon_symbol.c.
(libebl_backends_a_SOURCES): Add hexagon_SRCS.
* backends/hexagon_init.c: New file.
* backends/hexagon_reloc.def: Likewise.
* backends/hexagon_symbol.c: Likewise.
* libebl/eblopenbackend.c (hexagon_init): Declare.
(machines): Add hexagon.
* libelf/elf-knowledge.h: Add hexagon e_flags values, section
        indices and and relocs.
* src/elflint.c (valid_e_machine): Add EM_QDSP6.
* tests/Makefile.am (EXTRA_DIST): Add hello_hexagon.ko.bz2.
* tests/hello_hexagon.ko.bz2: New test file.
* tests/run-strip-reloc-ko.sh: Add hello_hexagon.ko.

Signed-off-by: Matheus Tavares Bernardino <quic_mathbern@quicinc.com>
backends/Makefile.am
backends/hexagon_init.c [new file with mode: 0644]
backends/hexagon_reloc.def [new file with mode: 0644]
backends/hexagon_symbol.c [new file with mode: 0644]
libebl/eblopenbackend.c
libelf/elf-knowledge.h
src/elflint.c
tests/Makefile.am
tests/hello_hexagon.ko.bz2 [new file with mode: 0644]
tests/run-strip-reloc-ko.sh

index b946fd30495f268403019ab1aed88bf3d364cf93..e22b522c27f87974b917593ae927d0916a2512e9 100644 (file)
@@ -37,7 +37,7 @@ AM_CPPFLAGS += -I$(top_srcdir)/libebl -I$(top_srcdir)/libasm \
 noinst_LIBRARIES = libebl_backends.a libebl_backends_pic.a
 
 modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \
-         m68k bpf riscv csky loongarch arc mips
+         m68k bpf riscv csky loongarch arc mips hexagon
 
 i386_SRCS = i386_init.c i386_symbol.c i386_corenote.c i386_cfi.c \
            i386_retval.c i386_regs.c i386_auxv.c \
@@ -104,12 +104,15 @@ arc_SRCS = arc_init.c arc_symbol.c
 
 mips_SRCS = mips_init.c mips_symbol.c
 
+hexagon_SRCS = hexagon_init.c hexagon_symbol.c
+
 libebl_backends_a_SOURCES = $(i386_SRCS) $(sh_SRCS) $(x86_64_SRCS) \
                            $(ia64_SRCS) $(alpha_SRCS) $(arm_SRCS) \
                            $(aarch64_SRCS) $(sparc_SRCS) $(ppc_SRCS) \
                            $(ppc64_SRCS) $(s390_SRCS) \
                            $(m68k_SRCS) $(bpf_SRCS) $(riscv_SRCS) $(csky_SRCS) \
-                           $(loongarch_SRCS) $(arc_SRCS) $(mips_SRCS)
+                           $(loongarch_SRCS) $(arc_SRCS) $(mips_SRCS) \
+                           $(hexagon_SRCS)
 
 libebl_backends_pic_a_SOURCES =
 am_libebl_backends_pic_a_OBJECTS = $(libebl_backends_a_SOURCES:.c=.os)
diff --git a/backends/hexagon_init.c b/backends/hexagon_init.c
new file mode 100644 (file)
index 0000000..9c8c6d8
--- /dev/null
@@ -0,0 +1,51 @@
+/* Initialization of Hexagon specific backend library.
+   Copyright (C) 2024 Qualcomm Innovation Center, Inc. All Rights Reserved.
+   This file is part of elfutils.
+
+   This file is free software; you can redistribute it and/or modify
+   it under the terms of either
+
+     * the GNU Lesser General Public License as published by the Free
+       Software Foundation; either version 3 of the License, or (at
+       your option) any later version
+
+   or
+
+     * 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
+
+   or both in parallel, as here.
+
+   elfutils 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 copies of the GNU General Public License and
+   the GNU Lesser General Public License along with this program.  If
+   not, see <http://www.gnu.org/licenses/>.  */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#define BACKEND         hexagon_
+#define RELOC_PREFIX    R_HEX_
+#include "libebl_CPU.h"
+
+/* This defines the common reloc hooks based on hexagon_reloc.def.  */
+#include "common-reloc.c"
+
+
+Ebl *
+hexagon_init (Elf *elf __attribute__ ((unused)),
+                GElf_Half machine __attribute__ ((unused)),
+                Ebl *eh)
+{
+  hexagon_init_reloc (eh);
+  HOOK (eh, reloc_simple_type);
+
+  return eh;
+}
+
diff --git a/backends/hexagon_reloc.def b/backends/hexagon_reloc.def
new file mode 100644 (file)
index 0000000..cd55d37
--- /dev/null
@@ -0,0 +1,130 @@
+/* List the relocation types for Hexagon.  -*- C -*-
+   Copyright (C) 2024 Qualcomm Innovation Center, Inc. All Rights Reserved.
+   This file is part of elfutils.
+
+   This file is free software; you can redistribute it and/or modify
+   it under the terms of either
+
+     * the GNU Lesser General Public License as published by the Free
+       Software Foundation; either version 3 of the License, or (at
+       your option) any later version
+
+   or
+
+     * 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
+
+   or both in parallel, as here.
+
+   elfutils 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 copies of the GNU General Public License and
+   the GNU Lesser General Public License along with this program.  If
+   not, see <http://www.gnu.org/licenses/>.  */
+
+/*          NAME,                     REL|EXEC|DYN */
+
+RELOC_TYPE (NONE,                     0)
+RELOC_TYPE (B22_PCREL,                REL)
+RELOC_TYPE (B15_PCREL,                REL)
+RELOC_TYPE (B7_PCREL,                 REL)
+RELOC_TYPE (LO16,                     REL)
+RELOC_TYPE (HI16,                     REL)
+RELOC_TYPE (32,                       REL)
+RELOC_TYPE (16,                       REL)
+RELOC_TYPE (8,                        REL)
+RELOC_TYPE (GPREL16_0,                REL)
+RELOC_TYPE (GPREL16_1,                REL)
+RELOC_TYPE (GPREL16_2,                REL)
+RELOC_TYPE (GPREL16_3,                REL)
+RELOC_TYPE (HL16,                     REL)
+RELOC_TYPE (B13_PCREL,                REL)
+RELOC_TYPE (B9_PCREL,                 REL)
+RELOC_TYPE (B32_PCREL_X,              REL)
+RELOC_TYPE (32_6_X,                   REL)
+RELOC_TYPE (B22_PCREL_X,              REL)
+RELOC_TYPE (B15_PCREL_X,              REL)
+RELOC_TYPE (B13_PCREL_X,              REL)
+RELOC_TYPE (B9_PCREL_X,               REL)
+RELOC_TYPE (B7_PCREL_X,               REL)
+RELOC_TYPE (16_X,                     REL)
+RELOC_TYPE (12_X,                     REL)
+RELOC_TYPE (11_X,                     REL)
+RELOC_TYPE (10_X,                     REL)
+RELOC_TYPE (9_X,                      REL)
+RELOC_TYPE (8_X,                      REL)
+RELOC_TYPE (7_X,                      REL)
+RELOC_TYPE (6_X,                      REL)
+RELOC_TYPE (32_PCREL,                 REL)
+RELOC_TYPE (COPY,                     REL)
+RELOC_TYPE (GLOB_DAT,                 REL)
+RELOC_TYPE (JMP_SLOT,                 REL)
+RELOC_TYPE (RELATIVE,                 REL)
+RELOC_TYPE (PLT_B22_PCREL,            REL)
+RELOC_TYPE (GOTREL_LO16,              REL)
+RELOC_TYPE (GOTREL_HI16,              REL)
+RELOC_TYPE (GOTREL_32,                REL)
+RELOC_TYPE (GOT_LO16,                 REL)
+RELOC_TYPE (GOT_HI16,                 REL)
+RELOC_TYPE (GOT_32,                   REL)
+RELOC_TYPE (GOT_16,                   REL)
+RELOC_TYPE (DTPMOD_32,                REL)
+RELOC_TYPE (DTPREL_LO16,              REL)
+RELOC_TYPE (DTPREL_HI16,              REL)
+RELOC_TYPE (DTPREL_32,                REL)
+RELOC_TYPE (DTPREL_16,                REL)
+RELOC_TYPE (GD_PLT_B22_PCREL,         REL)
+RELOC_TYPE (GD_GOT_LO16,              REL)
+RELOC_TYPE (GD_GOT_HI16,              REL)
+RELOC_TYPE (GD_GOT_32,                REL)
+RELOC_TYPE (GD_GOT_16,                REL)
+RELOC_TYPE (IE_LO16,                  REL)
+RELOC_TYPE (IE_HI16,                  REL)
+RELOC_TYPE (IE_32,                    REL)
+RELOC_TYPE (IE_GOT_LO16,              REL)
+RELOC_TYPE (IE_GOT_HI16,              REL)
+RELOC_TYPE (IE_GOT_32,                REL)
+RELOC_TYPE (IE_GOT_16,                REL)
+RELOC_TYPE (TPREL_LO16,               REL)
+RELOC_TYPE (TPREL_HI16,               REL)
+RELOC_TYPE (TPREL_32,                 REL)
+RELOC_TYPE (TPREL_16,                 REL)
+RELOC_TYPE (6_PCREL_X,                REL)
+RELOC_TYPE (GOTREL_32_6_X,            REL)
+RELOC_TYPE (GOTREL_16_X,              REL)
+RELOC_TYPE (GOTREL_11_X,              REL)
+RELOC_TYPE (GOT_32_6_X,               REL)
+RELOC_TYPE (GOT_16_X,                 REL)
+RELOC_TYPE (GOT_11_X,                 REL)
+RELOC_TYPE (DTPREL_32_6_X,            REL)
+RELOC_TYPE (DTPREL_16_X,              REL)
+RELOC_TYPE (DTPREL_11_X,              REL)
+RELOC_TYPE (GD_GOT_32_6_X,            REL)
+RELOC_TYPE (GD_GOT_16_X,              REL)
+RELOC_TYPE (GD_GOT_11_X,              REL)
+RELOC_TYPE (IE_32_6_X,                REL)
+RELOC_TYPE (IE_16_X,                  REL)
+RELOC_TYPE (IE_GOT_32_6_X,            REL)
+RELOC_TYPE (IE_GOT_16_X,              REL)
+RELOC_TYPE (IE_GOT_11_X,              REL)
+RELOC_TYPE (TPREL_32_6_X,             REL)
+RELOC_TYPE (TPREL_16_X,               REL)
+RELOC_TYPE (TPREL_11_X,               REL)
+RELOC_TYPE (LD_PLT_B22_PCREL,         REL)
+RELOC_TYPE (LD_GOT_LO16,              REL)
+RELOC_TYPE (LD_GOT_HI16,              REL)
+RELOC_TYPE (LD_GOT_32,                REL)
+RELOC_TYPE (LD_GOT_16,                REL)
+RELOC_TYPE (LD_GOT_32_6_X,            REL)
+RELOC_TYPE (LD_GOT_16_X,              REL)
+RELOC_TYPE (LD_GOT_11_X,              REL)
+RELOC_TYPE (23_REG,                   REL)
+RELOC_TYPE (GD_PLT_B22_PCREL_X,       REL)
+RELOC_TYPE (GD_PLT_B32_PCREL_X,       REL)
+RELOC_TYPE (LD_PLT_B22_PCREL_X,       REL)
+RELOC_TYPE (LD_PLT_B32_PCREL_X,       REL)
+RELOC_TYPE (27_REG,                   REL)
diff --git a/backends/hexagon_symbol.c b/backends/hexagon_symbol.c
new file mode 100644 (file)
index 0000000..b341243
--- /dev/null
@@ -0,0 +1,58 @@
+/* Hexagon specific symbolic name handling.
+   Copyright (C) 2024 Qualcomm Innovation Center, Inc. All Rights Reserved.
+   This file is part of elfutils.
+
+   This file is free software; you can redistribute it and/or modify
+   it under the terms of either
+
+     * the GNU Lesser General Public License as published by the Free
+       Software Foundation; either version 3 of the License, or (at
+       your option) any later version
+
+   or
+
+     * 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
+
+   or both in parallel, as here.
+
+   elfutils 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 copies of the GNU General Public License and
+   the GNU Lesser General Public License along with this program.  If
+   not, see <http://www.gnu.org/licenses/>.  */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <assert.h>
+#include <elf.h>
+#include <stddef.h>
+#include <string.h>
+
+#define BACKEND hexagon_
+#include "libebl_CPU.h"
+
+
+/* Check for the simple reloc types.  */
+Elf_Type
+hexagon_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type,
+                             int *addsub __attribute__ ((unused)))
+{
+  switch (type)
+    {
+    case R_HEX_32:
+      return ELF_T_WORD;
+    case R_HEX_16:
+      return ELF_T_HALF;
+    case R_HEX_8:
+      return ELF_T_BYTE;
+    default:
+      return ELF_T_NUM;
+    }
+}
index a5f7467a09d2def511f1d307cacef5f69bb9948c..b68dea7a08092c039ec5ed0dd9bbd34141ffb323 100644 (file)
@@ -58,6 +58,7 @@ Ebl *csky_init (Elf *, GElf_Half, Ebl *);
 Ebl *loongarch_init (Elf *, GElf_Half, Ebl *);
 Ebl *arc_init (Elf *, GElf_Half, Ebl *);
 Ebl *mips_init (Elf *, GElf_Half, Ebl *);
+Ebl *hexagon_init (Elf *, GElf_Half, Ebl *);
 
 /* This table should contain the complete list of architectures as far
    as the ELF specification is concerned.  */
@@ -156,6 +157,7 @@ static const struct
   { loongarch_init, "elf_loongarch", "loongarch", 9, EM_LOONGARCH, ELFCLASS64, ELFDATA2LSB },
   { arc_init, "elf_arc", "arc", 3, EM_ARCV2, ELFCLASS32, ELFDATA2LSB },
   { mips_init, "elf_mips", "mips", 4, EM_MIPS, 0, 0 },
+  { hexagon_init, "elf_hexagon", "hexagon", 9, EM_QDSP6, ELFCLASS32, ELFDATA2LSB },
 };
 #define nmachines (sizeof (machines) / sizeof (machines[0]))
 
index 6e005fa592981ea715b4dd5e8f488fa72fb9952c..7153593418bc729a1d3cf68f81d3265c0e2cacb0 100644 (file)
 #define GNU_BUILD_ATTRIBUTE_PIC                7
 #define GNU_BUILD_ATTRIBUTE_SHORT_ENUM 8
 
+/* Hexagon specific declarations.  */
+
+/* Processor specific flags for the Ehdr e_flags field.  */
+#define EF_HEXAGON_MACH_V2   0x00000001 /* Hexagon V2 */
+#define EF_HEXAGON_MACH_V3   0x00000002 /* Hexagon V3 */
+#define EF_HEXAGON_MACH_V4   0x00000003 /* Hexagon V4 */
+#define EF_HEXAGON_MACH_V5   0x00000004 /* Hexagon V5 */
+#define EF_HEXAGON_MACH_V55  0x00000005 /* Hexagon V55 */
+#define EF_HEXAGON_MACH_V60  0x00000060 /* Hexagon V60 */
+#define EF_HEXAGON_MACH_V61  0x00000061 /* Hexagon V61 */
+#define EF_HEXAGON_MACH_V62  0x00000062 /* Hexagon V62 */
+#define EF_HEXAGON_MACH_V65  0x00000065 /* Hexagon V65 */
+#define EF_HEXAGON_MACH_V66  0x00000066 /* Hexagon V66 */
+#define EF_HEXAGON_MACH_V67  0x00000067 /* Hexagon V67 */
+#define EF_HEXAGON_MACH_V67T 0x00008067 /* Hexagon V67T */
+#define EF_HEXAGON_MACH_V68  0x00000068 /* Hexagon V68 */
+#define EF_HEXAGON_MACH_V69  0x00000069 /* Hexagon V68 */
+#define EF_HEXAGON_MACH_V71  0x00000071 /* Hexagon V71 */
+#define EF_HEXAGON_MACH_V71T 0x00008071 /* Hexagon V71T */
+#define EF_HEXAGON_MACH_V73  0x00000073 /* Hexagon V73 */
+#define EF_HEXAGON_MACH      0x000003ff /* Hexagon V.. */
+
+/* Special section indices.  */
+#define SHN_HEXAGON_SCOMMON    0xff00 /* Other access sizes */
+#define SHN_HEXAGON_SCOMMON_1  0xff01 /* Byte-sized access */
+#define SHN_HEXAGON_SCOMMON_2  0xff02 /* Half-word-sized access */
+#define SHN_HEXAGON_SCOMMON_4  0xff03 /* Word-sized access */
+#define SHN_HEXAGON_SCOMMON_8  0xff04 /* Double-word-size access */
+
+/* Hexagon specific relocs.  */
+#define R_HEX_NONE                0
+#define R_HEX_B22_PCREL           1
+#define R_HEX_B15_PCREL           2
+#define R_HEX_B7_PCREL            3
+#define R_HEX_LO16                4
+#define R_HEX_HI16                5
+#define R_HEX_32                  6
+#define R_HEX_16                  7
+#define R_HEX_8                   8
+#define R_HEX_GPREL16_0           9
+#define R_HEX_GPREL16_1           10
+#define R_HEX_GPREL16_2           11
+#define R_HEX_GPREL16_3           12
+#define R_HEX_HL16                13
+#define R_HEX_B13_PCREL           14
+#define R_HEX_B9_PCREL            15
+#define R_HEX_B32_PCREL_X         16
+#define R_HEX_32_6_X              17
+#define R_HEX_B22_PCREL_X         18
+#define R_HEX_B15_PCREL_X         19
+#define R_HEX_B13_PCREL_X         20
+#define R_HEX_B9_PCREL_X          21
+#define R_HEX_B7_PCREL_X          22
+#define R_HEX_16_X                23
+#define R_HEX_12_X                24
+#define R_HEX_11_X                25
+#define R_HEX_10_X                26
+#define R_HEX_9_X                 27
+#define R_HEX_8_X                 28
+#define R_HEX_7_X                 29
+#define R_HEX_6_X                 30
+#define R_HEX_32_PCREL            31
+#define R_HEX_COPY                32
+#define R_HEX_GLOB_DAT            33
+#define R_HEX_JMP_SLOT            34
+#define R_HEX_RELATIVE            35
+#define R_HEX_PLT_B22_PCREL       36
+#define R_HEX_GOTREL_LO16         37
+#define R_HEX_GOTREL_HI16         38
+#define R_HEX_GOTREL_32           39
+#define R_HEX_GOT_LO16            40
+#define R_HEX_GOT_HI16            41
+#define R_HEX_GOT_32              42
+#define R_HEX_GOT_16              43
+#define R_HEX_DTPMOD_32           44
+#define R_HEX_DTPREL_LO16         45
+#define R_HEX_DTPREL_HI16         46
+#define R_HEX_DTPREL_32           47
+#define R_HEX_DTPREL_16           48
+#define R_HEX_GD_PLT_B22_PCREL    49
+#define R_HEX_GD_GOT_LO16         50
+#define R_HEX_GD_GOT_HI16         51
+#define R_HEX_GD_GOT_32           52
+#define R_HEX_GD_GOT_16           53
+#define R_HEX_IE_LO16             54
+#define R_HEX_IE_HI16             55
+#define R_HEX_IE_32               56
+#define R_HEX_IE_GOT_LO16         57
+#define R_HEX_IE_GOT_HI16         58
+#define R_HEX_IE_GOT_32           59
+#define R_HEX_IE_GOT_16           60
+#define R_HEX_TPREL_LO16          61
+#define R_HEX_TPREL_HI16          62
+#define R_HEX_TPREL_32            63
+#define R_HEX_TPREL_16            64
+#define R_HEX_6_PCREL_X           65
+#define R_HEX_GOTREL_32_6_X       66
+#define R_HEX_GOTREL_16_X         67
+#define R_HEX_GOTREL_11_X         68
+#define R_HEX_GOT_32_6_X          69
+#define R_HEX_GOT_16_X            70
+#define R_HEX_GOT_11_X            71
+#define R_HEX_DTPREL_32_6_X       72
+#define R_HEX_DTPREL_16_X         73
+#define R_HEX_DTPREL_11_X         74
+#define R_HEX_GD_GOT_32_6_X       75
+#define R_HEX_GD_GOT_16_X         76
+#define R_HEX_GD_GOT_11_X         77
+#define R_HEX_IE_32_6_X           78
+#define R_HEX_IE_16_X             79
+#define R_HEX_IE_GOT_32_6_X       80
+#define R_HEX_IE_GOT_16_X         81
+#define R_HEX_IE_GOT_11_X         82
+#define R_HEX_TPREL_32_6_X        83
+#define R_HEX_TPREL_16_X          84
+#define R_HEX_TPREL_11_X          85
+#define R_HEX_LD_PLT_B22_PCREL    86
+#define R_HEX_LD_GOT_LO16         87
+#define R_HEX_LD_GOT_HI16         88
+#define R_HEX_LD_GOT_32           89
+#define R_HEX_LD_GOT_16           90
+#define R_HEX_LD_GOT_32_6_X       91
+#define R_HEX_LD_GOT_16_X         92
+#define R_HEX_LD_GOT_11_X         93
+#define R_HEX_23_REG              94
+#define R_HEX_GD_PLT_B22_PCREL_X  95
+#define R_HEX_GD_PLT_B32_PCREL_X  96
+#define R_HEX_LD_PLT_B22_PCREL_X  97
+#define R_HEX_LD_PLT_B32_PCREL_X  98
+#define R_HEX_27_REG              99
+
 #endif /* elf-knowledge.h */
index 864de710a29cd5c7cd65cd8b97b862f7ce305f56..e56e1465dac637c4abc1aba76c12cd109fa158d3 100644 (file)
@@ -331,7 +331,7 @@ static const int valid_e_machine[] =
     EM_AVR, EM_FR30, EM_D10V, EM_D30V, EM_V850, EM_M32R, EM_MN10300,
     EM_MN10200, EM_PJ, EM_OPENRISC, EM_ARC_A5, EM_XTENSA, EM_ALPHA,
     EM_TILEGX, EM_TILEPRO, EM_AARCH64, EM_BPF, EM_RISCV, EM_CSKY, EM_LOONGARCH,
-    EM_ARCV2
+    EM_ARCV2, EM_QDSP6
   };
 #define nvalid_e_machine \
   (sizeof (valid_e_machine) / sizeof (valid_e_machine[0]))
index 40e0eaa5a368d270099ce96936d0664310c49774..b7fb72384f3276ac797e87812c05171c944fc8a0 100644 (file)
@@ -320,7 +320,7 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh run-ar.sh \
             hello_i386.ko.bz2 hello_x86_64.ko.bz2 \
             hello_ppc64.ko.bz2 hello_s390.ko.bz2 hello_aarch64.ko.bz2 \
             hello_m68k.ko.bz2 hello_riscv64.ko.bz2 hello_csky.ko.bz2 \
-            hello_arc_hs4.ko.bz2 \
+            hello_arc_hs4.ko.bz2 hello_hexagon.ko.bz2 \
             run-unstrip-test.sh run-unstrip-test2.sh \
             testfile-info-link.bz2 testfile-info-link.debuginfo.bz2 \
             testfile-info-link.stripped.bz2 run-unstrip-test3.sh \
diff --git a/tests/hello_hexagon.ko.bz2 b/tests/hello_hexagon.ko.bz2
new file mode 100644 (file)
index 0000000..e60d2c1
Binary files /dev/null and b/tests/hello_hexagon.ko.bz2 differ
index 55fa74dbe10dd8cc86c91123a8b3961d8251ee2c..7bc685e622fdbf718978f5d866d847b56fe5977e 100755 (executable)
@@ -4,7 +4,7 @@
 
 testfiles hello_i386.ko hello_x86_64.ko hello_ppc64.ko hello_s390.ko \
        hello_aarch64.ko hello_m68k.ko hello_riscv64.ko hello_csky.ko \
-       hello_arc_hs4.ko
+       hello_arc_hs4.ko hello_hexagon.ko
 
 # Most simple hello world kernel module for various architectures.
 # Make sure that it contains debuginfo with CONFIG_DEBUG_INFO=y.
@@ -47,5 +47,6 @@ runtest hello_m68k.ko 1
 runtest hello_riscv64.ko 1
 runtest hello_csky.ko 1
 runtest hello_arc_hs4.ko 1
+runtest hello_hexagon.ko 1
 
 exit $runtest_status