From 4ab07fd3fbe6b6fe5f28e0e2987eb02bedc2b495 Mon Sep 17 00:00:00 2001 From: Alex Sverdlin Date: Tue, 27 Sep 2022 13:08:37 +0100 Subject: ARM: 9252/1: module: Teach unwinder about PLTs "unwind: Index not found eef26358" warnings keep popping up on CONFIG_ARM_MODULE_PLTS-enabled systems if the PC points to a PLT veneer. Teach the unwinder how to deal with them, taking into account they don't change state of the stack or register file except loading PC. Link: https://lore.kernel.org/linux-arm-kernel/20200402153845.30985-1-kursad.oney@broadcom.com/ Tested-by: Kursad Oney Reviewed-by: Linus Walleij Signed-off-by: Alexander Sverdlin Signed-off-by: Russell King (Oracle) --- arch/arm/kernel/module-plts.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'arch/arm/kernel/module-plts.c') diff --git a/arch/arm/kernel/module-plts.c b/arch/arm/kernel/module-plts.c index 1fc309b41f94..af7c322ebed6 100644 --- a/arch/arm/kernel/module-plts.c +++ b/arch/arm/kernel/module-plts.c @@ -284,3 +284,17 @@ int module_frob_arch_sections(Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, mod->arch.core.plt->sh_size, mod->arch.init.plt->sh_size); return 0; } + +bool in_module_plt(unsigned long loc) +{ + struct module *mod; + bool ret; + + preempt_disable(); + mod = __module_text_address(loc); + ret = mod && (loc - (u32)mod->arch.core.plt_ent < mod->arch.core.plt_count * PLT_ENT_SIZE || + loc - (u32)mod->arch.init.plt_ent < mod->arch.init.plt_count * PLT_ENT_SIZE); + preempt_enable(); + + return ret; +} -- cgit