ARM: 7829/1: Add ".text.unlikely" and ".text.hot" to arm unwind tables
authorDouglas Anderson <dianders@chromium.org>
Wed, 28 Aug 2013 23:08:01 +0000 (00:08 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Feb 2015 06:35:38 +0000 (22:35 -0800)
commit 849b882b52df0f276d9ffded01d85654aa0da422 upstream.

It appears that gcc may put some code in ".text.unlikely" or
".text.hot" sections.  Right now those aren't accounted for in unwind
tables.  Add them.

I found some docs about this at:
  http://gcc.gnu.org/onlinedocs/gcc-4.6.2/gcc.pdf

Without this, if you have slub_debug turned on, you can get messages
that look like this:
  unwind: Index not found 7f008c50

Signed-off-by: Doug Anderson <dianders@chromium.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
[wangkai: backport to 3.10
- adjust context
]
Signed-off-by: Wang Kai <morgan.wang@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/include/asm/module.h
arch/arm/kernel/module.c

index 0d3a28dbc8e5db05823e6b83f85ccc5d04b807ac..ed690c49ef93fae344aeaec993c939e336460283 100644 (file)
@@ -12,6 +12,8 @@ enum {
        ARM_SEC_CORE,
        ARM_SEC_EXIT,
        ARM_SEC_DEVEXIT,
+       ARM_SEC_HOT,
+       ARM_SEC_UNLIKELY,
        ARM_SEC_MAX,
 };
 
index 1e9be5d25e56adcddb8ea4cff5997fc1698e72ce..af60478f54d0a398ff23fa835265b5a6969d5924 100644 (file)
@@ -296,6 +296,10 @@ int module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs,
                        maps[ARM_SEC_EXIT].unw_sec = s;
                else if (strcmp(".ARM.exidx.devexit.text", secname) == 0)
                        maps[ARM_SEC_DEVEXIT].unw_sec = s;
+               else if (strcmp(".ARM.exidx.text.unlikely", secname) == 0)
+                       maps[ARM_SEC_UNLIKELY].unw_sec = s;
+               else if (strcmp(".ARM.exidx.text.hot", secname) == 0)
+                       maps[ARM_SEC_HOT].unw_sec = s;
                else if (strcmp(".init.text", secname) == 0)
                        maps[ARM_SEC_INIT].txt_sec = s;
                else if (strcmp(".devinit.text", secname) == 0)
@@ -306,6 +310,10 @@ int module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs,
                        maps[ARM_SEC_EXIT].txt_sec = s;
                else if (strcmp(".devexit.text", secname) == 0)
                        maps[ARM_SEC_DEVEXIT].txt_sec = s;
+               else if (strcmp(".text.unlikely", secname) == 0)
+                       maps[ARM_SEC_UNLIKELY].txt_sec = s;
+               else if (strcmp(".text.hot", secname) == 0)
+                       maps[ARM_SEC_HOT].txt_sec = s;
        }
 
        for (i = 0; i < ARM_SEC_MAX; i++)