linux-kbuild.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kbuild: Fix .text.unlikely placement
@ 2015-07-20  1:01 Andi Kleen
  2015-08-20 11:55 ` Michal Marek
  0 siblings, 1 reply; 2+ messages in thread
From: Andi Kleen @ 2015-07-20  1:01 UTC (permalink / raw)
  To: linux-kbuild; +Cc: mmarek, linux-kernel, Andi Kleen

From: Andi Kleen <ak@linux.intel.com>

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 .text.hot into the same statement though, even though
that's not strictly needed.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 include/asm-generic/vmlinux.lds.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 8bd374d..1781e54 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -412,12 +412,10 @@
  * during second ld run in second ld pass when generating System.map */
 #define TEXT_TEXT							\
 		ALIGN_FUNCTION();					\
-		*(.text.hot)						\
-		*(.text .text.fixup)					\
+		*(.text.hot .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
-- 
2.4.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] kbuild: Fix .text.unlikely placement
  2015-07-20  1:01 [PATCH] kbuild: Fix .text.unlikely placement Andi Kleen
@ 2015-08-20 11:55 ` Michal Marek
  0 siblings, 0 replies; 2+ messages in thread
From: Michal Marek @ 2015-08-20 11:55 UTC (permalink / raw)
  To: Andi Kleen, linux-kbuild; +Cc: linux-kernel, Andi Kleen

On 2015-07-20 03:01, Andi Kleen wrote:
> From: Andi Kleen <ak@linux.intel.com>
> 
> 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 .text.hot into the same statement though, even though
> that's not strictly needed.
> 
> Signed-off-by: Andi Kleen <ak@linux.intel.com>

Applied to kbuild.git#kbuild.

Michal


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-08-20 11:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-20  1:01 [PATCH] kbuild: Fix .text.unlikely placement Andi Kleen
2015-08-20 11:55 ` Michal Marek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).