[PATCH 04/16] elf.h Define LoongArch bits

Jiaxun Yang jiaxun.yang at flygoat.com
Wed May 22 17:34:47 CEST 2024


They all come from glibc's elf.h

Signed-off-by: Jiaxun Yang <jiaxun.yang at flygoat.com>
---
 include/elf.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/include/elf.h b/include/elf.h
index a4ba74d8abeb..cb3bb20c4f2e 100644
--- a/include/elf.h
+++ b/include/elf.h
@@ -219,7 +219,8 @@ typedef struct {
 #define EM_MN10300	89		/* Matsushita MN10200 */
 #define EM_MN10200	90		/* Matsushita MN10200 */
 #define EM_PJ		91		/* picoJava */
-#define EM_NUM		92		/* number of machine types */
+#define EM_LOONGARCH	258	/* LoongArch */
+
 
 /* Version */
 #define EV_NONE		0		/* Invalid */
@@ -699,6 +700,12 @@ unsigned long elf_hash(const unsigned char *name);
 #define R_RISCV_64		2
 #define R_RISCV_RELATIVE	3
 
+/* LoongArch Relocations */
+#define R_LARCH_NONE				0
+#define R_LARCH_32				1
+#define R_LARCH_64				2
+#define R_LARCH_RELATIVE			3
+
 #ifndef __ASSEMBLY__
 int valid_elf_image(unsigned long addr);
 unsigned long load_elf64_image_phdr(unsigned long addr);

-- 
2.43.0



More information about the U-Boot mailing list