瀏覽代碼

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>
Russell King 14 年之前
父節點
當前提交
50005a8deb
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      arch/arm/kernel/module.c

+ 3 - 0
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)