summaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/module.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2010-11-12 14:04:16 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-12-01 11:23:05 +0100
commit50005a8deb38e5e6456ebd94e57adb321d4589de (patch)
tree22a45e6e598848aeb1d930bfb0bc13bd974bf85c /arch/arm/kernel/module.c
parentARM: module: clean up handling of ELF unwind tables (diff)
downloadlinux-50005a8deb38e5e6456ebd94e57adb321d4589de.tar.xz
linux-50005a8deb38e5e6456ebd94e57adb321d4589de.zip
ARM: module: ignore unwind for sections not marked SHF_ALLOC
If a section is not marked with SHF_ALLOC, it will be discarded by the module code. Therefore, it is not correct to register the unwind tables. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel/module.c')
-rw-r--r--arch/arm/kernel/module.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c
index f9937c4b7d1a..0c1bb68ff4a8 100644
--- a/arch/arm/kernel/module.c
+++ b/arch/arm/kernel/module.c
@@ -290,6 +290,9 @@ int module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs,
for (s = sechdrs; s < sechdrs_end; s++) {
const char *secname = secstrs + s->sh_name;
+ if (!(s->sh_flags & SHF_ALLOC))
+ continue;
+
if (strcmp(".ARM.exidx.init.text", secname) == 0)
maps[ARM_SEC_INIT].unw_sec = s;
else if (strcmp(".ARM.exidx.devinit.text", secname) == 0)