[lkml]   [2015]   [Jul]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] kbuild: Fix .text.unlikely placement
From: Andi Kleen <>

When building a kernel with .text.unlikely text the unlikely text for
each translation unit was put next to the main .text code in the
final vmlinux.

The problem is that the linker doesn't allow more specific submatches
of a section name in a different linker script statement after the
main match.

So we need to move them all into one line. With that change
.text.unlikely is at the end of everything again.

I also moved into the same statement though, even though
that's not strictly needed.

Signed-off-by: Andi Kleen <>
include/asm-generic/ | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/include/asm-generic/ b/include/asm-generic/
index 8bd374d..1781e54 100644
--- a/include/asm-generic/
+++ b/include/asm-generic/
@@ -412,12 +412,10 @@
* during second ld run in second ld pass when generating */
#define TEXT_TEXT \
- *( \
- *(.text .text.fixup) \
+ *( .text .text.fixup .text.unlikely) \
*(.ref.text) \
MEM_KEEP(init.text) \
MEM_KEEP(exit.text) \
- *(.text.unlikely)

/* sched.text is aling to function alignment to secure we have same

 \ /
  Last update: 2015-07-20 03:21    [W:0.051 / U:1.732 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site