summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2023-06-01 14:10:01 +0200
committerMasahiro Yamada <masahiroy@kernel.org>2023-06-03 18:37:41 +0200
commit2cb749466d179e3ccfe83eb8a52dc002d07b08af (patch)
tree4b80e1815c2b9679621b0b4a2363883ae0540638 /scripts
parentmodpost: fix section_mismatch message for R_ARM_THM_{CALL,JUMP24,JUMP19} (diff)
downloadlinux-2cb749466d179e3ccfe83eb8a52dc002d07b08af.tar.xz
linux-2cb749466d179e3ccfe83eb8a52dc002d07b08af.zip
modpost: detect section mismatch for R_ARM_REL32
For ARM, modpost fails to detect some types of section mismatches. [test code] .section .init.data,"aw" bar: .long 0 .section .data,"aw" .globl foo foo: .long bar - . It is apparently a bad reference, but modpost does not report anything. The test code above produces the following relocations. Relocation section '.rel.data' at offset 0xe8 contains 1 entry: Offset Info Type Sym.Value Sym. Name 00000000 00000403 R_ARM_REL32 00000000 .init.data Currently, R_ARM_REL32 is just skipped. Handle it like R_ARM_ABS32. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mod/modpost.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 4e911ab711d4..d10f5bdcb753 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -1281,6 +1281,7 @@ static int addend_arm_rel(struct elf_info *elf, Elf_Shdr *sechdr, Elf_Rela *r)
switch (r_typ) {
case R_ARM_ABS32:
+ case R_ARM_REL32:
inst = TO_NATIVE(*(uint32_t *)loc);
r->r_addend = inst + sym->st_value;
break;