]> git.baikalelectronics.ru Git - kernel.git/commitdiff
LoongArch: Define ELF relocation types added in ABIv2.0
authorXi Ruoyao <xry111@xry111.site>
Wed, 12 Oct 2022 08:36:14 +0000 (16:36 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Wed, 12 Oct 2022 08:36:14 +0000 (16:36 +0800)
These relocation types are used by GNU binutils >= 2.40 and GCC >= 13.
Add their definitions so we will be able to use them in later patches.

Link: https://github.com/loongson/LoongArch-Documentation/pull/57
Tested-by: WANG Xuerui <git@xen0n.name>
Signed-off-by: Xi Ruoyao <xry111@xry111.site>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/include/asm/elf.h
arch/loongarch/kernel/module.c

index 5f3ff4781fda83fd9e861a862f1a4ea8611d8619..7af0cebf28d73c5d3551eb10ecc36beb6b08d2d7 100644 (file)
 #define R_LARCH_SUB64                          56
 #define R_LARCH_GNU_VTINHERIT                  57
 #define R_LARCH_GNU_VTENTRY                    58
+#define R_LARCH_B16                            64
+#define R_LARCH_B21                            65
+#define R_LARCH_B26                            66
+#define R_LARCH_ABS_HI20                       67
+#define R_LARCH_ABS_LO12                       68
+#define R_LARCH_ABS64_LO20                     69
+#define R_LARCH_ABS64_HI12                     70
+#define R_LARCH_PCALA_HI20                     71
+#define R_LARCH_PCALA_LO12                     72
+#define R_LARCH_PCALA64_LO20                   73
+#define R_LARCH_PCALA64_HI12                   74
+#define R_LARCH_GOT_PC_HI20                    75
+#define R_LARCH_GOT_PC_LO12                    76
+#define R_LARCH_GOT64_PC_LO20                  77
+#define R_LARCH_GOT64_PC_HI12                  78
+#define R_LARCH_GOT_HI20                       79
+#define R_LARCH_GOT_LO12                       80
+#define R_LARCH_GOT64_LO20                     81
+#define R_LARCH_GOT64_HI12                     82
+#define R_LARCH_TLS_LE_HI20                    83
+#define R_LARCH_TLS_LE_LO12                    84
+#define R_LARCH_TLS_LE64_LO20                  85
+#define R_LARCH_TLS_LE64_HI12                  86
+#define R_LARCH_TLS_IE_PC_HI20                 87
+#define R_LARCH_TLS_IE_PC_LO12                 88
+#define R_LARCH_TLS_IE64_PC_LO20               89
+#define R_LARCH_TLS_IE64_PC_HI12               90
+#define R_LARCH_TLS_IE_HI20                    91
+#define R_LARCH_TLS_IE_LO12                    92
+#define R_LARCH_TLS_IE64_LO20                  93
+#define R_LARCH_TLS_IE64_HI12                  94
+#define R_LARCH_TLS_LD_PC_HI20                 95
+#define R_LARCH_TLS_LD_HI20                    96
+#define R_LARCH_TLS_GD_PC_HI20                 97
+#define R_LARCH_TLS_GD_HI20                    98
+#define R_LARCH_32_PCREL                       99
+#define R_LARCH_RELAX                          100
 
 #ifndef ELF_ARCH
 
index 638427ff0d5150cbffacef7d9ac75c0f10b661b8..755d91ef8d856d4997398d6c9b7f4e53c9288aa8 100644 (file)
@@ -296,7 +296,7 @@ typedef int (*reloc_rela_handler)(struct module *mod, u32 *location, Elf_Addr v,
 
 /* The handlers for known reloc types */
 static reloc_rela_handler reloc_rela_handlers[] = {
-       [R_LARCH_NONE ... R_LARCH_SUB64]                     = apply_r_larch_error,
+       [R_LARCH_NONE ... R_LARCH_RELAX]                     = apply_r_larch_error,
 
        [R_LARCH_NONE]                                       = apply_r_larch_none,
        [R_LARCH_32]                                         = apply_r_larch_32,