Skip to content

Commit 2761498

Browse files
seehearfeelchenhuacai
authored andcommitted
LoongArch: Define relocation types for ABI v2.10
The relocation types from 101 to 109 are used by GNU binutils >= 2.41, add their definitions to use them in later patches. Link: https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=include/elf/loongarch.h#l230 Cc: <[email protected]> Signed-off-by: Tiezhu Yang <[email protected]> Signed-off-by: Huacai Chen <[email protected]>
1 parent 1943fee commit 2761498

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

arch/loongarch/include/asm/elf.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,15 @@
111111
#define R_LARCH_TLS_GD_HI20 98
112112
#define R_LARCH_32_PCREL 99
113113
#define R_LARCH_RELAX 100
114+
#define R_LARCH_DELETE 101
115+
#define R_LARCH_ALIGN 102
116+
#define R_LARCH_PCREL20_S2 103
117+
#define R_LARCH_CFA 104
118+
#define R_LARCH_ADD6 105
119+
#define R_LARCH_SUB6 106
120+
#define R_LARCH_ADD_ULEB128 107
121+
#define R_LARCH_SUB_ULEB128 108
122+
#define R_LARCH_64_PCREL 109
114123

115124
#ifndef ELF_ARCH
116125

arch/loongarch/kernel/module.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ typedef int (*reloc_rela_handler)(struct module *mod, u32 *location, Elf_Addr v,
382382

383383
/* The handlers for known reloc types */
384384
static reloc_rela_handler reloc_rela_handlers[] = {
385-
[R_LARCH_NONE ... R_LARCH_RELAX] = apply_r_larch_error,
385+
[R_LARCH_NONE ... R_LARCH_64_PCREL] = apply_r_larch_error,
386386

387387
[R_LARCH_NONE] = apply_r_larch_none,
388388
[R_LARCH_32] = apply_r_larch_32,

0 commit comments

Comments
 (0)