Skip to content

Commit 09e56a2

Browse files
Phil CarmodyRussell King
authored andcommitted
ARM: 6340/1: module - additional unwind tables for exit/devexit sections
Without these, exit functions cannot be stack-traced, so to speak. This implies that module unloads that perform allocations (don't laugh) will cause noisy warnings on the console when kmemleak is enabled, as it presumes that all code's call chains are traceable. Similarly, BUGs and WARN_ONs will give additional console spam. Signed-off-by: Phil Carmody <ext-phil.2.carmody@nokia.com> Acked-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
1 parent e5f7772 commit 09e56a2

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ enum {
1717
ARM_SEC_INIT,
1818
ARM_SEC_DEVINIT,
1919
ARM_SEC_CORE,
20+
ARM_SEC_EXIT,
21+
ARM_SEC_DEVEXIT,
2022
ARM_SEC_MAX,
2123
};
2224
struct mod_arch_specific {

‎arch/arm/kernel/module.c‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,20 @@ int module_frob_arch_sections(Elf_Ehdr *hdr,
8080
maps[ARM_SEC_DEVINIT].unw_sec = s;
8181
else if (strcmp(".ARM.exidx", secname) == 0)
8282
maps[ARM_SEC_CORE].unw_sec = s;
83+
else if (strcmp(".ARM.exidx.exit.text", secname) == 0)
84+
maps[ARM_SEC_EXIT].unw_sec = s;
85+
else if (strcmp(".ARM.exidx.devexit.text", secname) == 0)
86+
maps[ARM_SEC_DEVEXIT].unw_sec = s;
8387
else if (strcmp(".init.text", secname) == 0)
8488
maps[ARM_SEC_INIT].sec_text = s;
8589
else if (strcmp(".devinit.text", secname) == 0)
8690
maps[ARM_SEC_DEVINIT].sec_text = s;
8791
else if (strcmp(".text", secname) == 0)
8892
maps[ARM_SEC_CORE].sec_text = s;
93+
else if (strcmp(".exit.text", secname) == 0)
94+
maps[ARM_SEC_EXIT].sec_text = s;
95+
else if (strcmp(".devexit.text", secname) == 0)
96+
maps[ARM_SEC_DEVEXIT].sec_text = s;
8997
}
9098
#endif
9199
return 0;

0 commit comments

Comments
 (0)