Skip to content

Commit 430d0b8

Browse files
paulburtonralfbaechle
authored andcommitted
MIPS: module: Unify rel & rela reloc handling
The module load code has previously had entirely separate implementations for rel & rela style relocs, which unnecessarily duplicates a whole lot of code. Unify the implementations of both types of reloc, sharing the bulk of the code. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/15832/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
1 parent 351b094 commit 430d0b8

4 files changed

Lines changed: 154 additions & 252 deletions

File tree

‎arch/mips/include/asm/module.h‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ typedef struct {
4747
#define Elf_Mips_Rel Elf32_Rel
4848
#define Elf_Mips_Rela Elf32_Rela
4949

50-
#define ELF_MIPS_R_SYM(rel) ELF32_R_SYM(rel.r_info)
51-
#define ELF_MIPS_R_TYPE(rel) ELF32_R_TYPE(rel.r_info)
50+
#define ELF_MIPS_R_SYM(rel) ELF32_R_SYM((rel).r_info)
51+
#define ELF_MIPS_R_TYPE(rel) ELF32_R_TYPE((rel).r_info)
5252

5353
#endif
5454

@@ -65,8 +65,8 @@ typedef struct {
6565
#define Elf_Mips_Rel Elf64_Mips_Rel
6666
#define Elf_Mips_Rela Elf64_Mips_Rela
6767

68-
#define ELF_MIPS_R_SYM(rel) (rel.r_sym)
69-
#define ELF_MIPS_R_TYPE(rel) (rel.r_type)
68+
#define ELF_MIPS_R_SYM(rel) ((rel).r_sym)
69+
#define ELF_MIPS_R_TYPE(rel) ((rel).r_type)
7070

7171
#endif
7272

‎arch/mips/kernel/Makefile‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ obj-$(CONFIG_SYNC_R4K) += sync-r4k.o
3131
obj-$(CONFIG_DEBUG_FS) += segment.o
3232
obj-$(CONFIG_STACKTRACE) += stacktrace.o
3333
obj-$(CONFIG_MODULES) += module.o
34-
obj-$(CONFIG_MODULES_USE_ELF_RELA) += module-rela.o
3534

3635
obj-$(CONFIG_FTRACE_SYSCALLS) += ftrace.o
3736
obj-$(CONFIG_FUNCTION_TRACER) += mcount.o ftrace.o

‎arch/mips/kernel/module-rela.c‎

Lines changed: 0 additions & 202 deletions
This file was deleted.

0 commit comments

Comments
 (0)