aboutsummaryrefslogtreecommitdiff
path: root/scripts/mod
diff options
context:
space:
mode:
authorGravatar Masahiro Yamada <masahiroy@kernel.org> 2023-05-12 01:24:22 +0900
committerGravatar Masahiro Yamada <masahiroy@kernel.org> 2023-05-22 10:34:38 +0900
commit64f140417d818aa374788acc9cb8328165747262 (patch)
treea57e3800f2f58237189e825916c81f90bda99eba /scripts/mod
parentkbuild: Disallow DTB overlays to built from .dts named source files (diff)
downloadlinux-64f140417d818aa374788acc9cb8328165747262.tar.gz
linux-64f140417d818aa374788acc9cb8328165747262.tar.bz2
linux-64f140417d818aa374788acc9cb8328165747262.zip
modpost: error out if addend_*_rel() is not implemented for REL arch
The section mismatch check relies on the relocation entries. For REL, the addend value is implicit, so we need some code to compute it. Currently, EM_386, EM_ARM, and EM_MIPS are supported. This commit makes sure we covered all the cases. I believe the other architectures use RELA, where the explicit r_addend field exists. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'scripts/mod')
-rw-r--r--scripts/mod/modpost.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index d4531d09984d..c1c523adb139 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -1628,6 +1628,8 @@ static void section_rel(const char *modname, struct elf_info *elf,
if (addend_mips_rel(elf, sechdr, &r))
continue;
break;
+ default:
+ fatal("Please add code to calculate addend for this architecture\n");
}
sym = elf->symtab_start + r_sym;
/* Skip special sections */