[lkml]   [2021]   [Jan]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH v2] powerpc: Handle .text.{hot,unlikely}.* in linker script
Commit eff8728fe698 (" Add PGO and AutoFDO input
sections") added ".text.unlikely.*" and "*" due to an LLVM
change [1].

After another LLVM change [2], these sections are seen in some PowerPC
builds, where there is a orphan section warning then build failure:

$ make -skj"$(nproc)" \
ARCH=powerpc CROSS_COMPILE=powerpc64le-linux-gnu- LLVM=1 O=out \
distclean powernv_defconfig zImage.epapr
ld.lld: warning: kernel/built-in.a(panic.o):(.text.unlikely.) is being placed in '.text.unlikely.'
ld.lld: warning: address (0xc000000000009314) of section .text is not a multiple of alignment (256)
ERROR: start_text address is c000000000009400, should be c000000000008000
ERROR: try to enable LD_HEAD_STUB_CATCH config option
ERROR: see comments in arch/powerpc/tools/

Explicitly handle these sections like in the main linker script so
there is no more build failure.


Fixes: 83a092cf95f2 ("powerpc: Link warning for orphan sections")
Signed-off-by: Nathan Chancellor <>

v1 -> v2:

* Add missing [1] and [2] references in commit message. Thanks to Sedat
Dilek for pointing it out!

arch/powerpc/kernel/ | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/ b/arch/powerpc/kernel/
index 0318ba436f34..8e0b1298bf19 100644
--- a/arch/powerpc/kernel/
+++ b/arch/powerpc/kernel/
@@ -85,7 +85,7 @@ SECTIONS
/* careful! __ftr_alt_* sections need to be close to .text */
- *( TEXT_MAIN .text.fixup .text.unlikely .fixup __ftr_alt_* .ref.text);
+ *(* TEXT_MAIN .text.fixup .text.unlikely .text.unlikely.* .fixup __ftr_alt_* .ref.text);
#ifdef CONFIG_PPC64
base-commit: d8a4f20584d5906093a8fc6aa06622102a501095

 \ /
  Last update: 2021-01-05 00:53    [W:0.088 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site