Skip to content

Commit 3ce47d9

Browse files
nathanchancempe
authored andcommitted
powerpc: Handle .text.{hot,unlikely}.* in linker script
Commit eff8728 ("vmlinux.lds.h: Add PGO and AutoFDO input sections") added ".text.unlikely.*" and ".text.hot.*" 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/head_check.sh ... Explicitly handle these sections like in the main linker script so there is no more build failure. [1]: https://reviews.llvm.org/D79600 [2]: https://reviews.llvm.org/D92493 Fixes: 83a092c ("powerpc: Link warning for orphan sections") Cc: [email protected] Signed-off-by: Nathan Chancellor <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: ClangBuiltLinux#1218 Link: https://lore.kernel.org/r/[email protected]
1 parent 98bf2d3 commit 3ce47d9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/powerpc/kernel/vmlinux.lds.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ SECTIONS
8585
ALIGN_FUNCTION();
8686
#endif
8787
/* careful! __ftr_alt_* sections need to be close to .text */
88-
*(.text.hot TEXT_MAIN .text.fixup .text.unlikely .fixup __ftr_alt_* .ref.text);
88+
*(.text.hot .text.hot.* TEXT_MAIN .text.fixup .text.unlikely .text.unlikely.* .fixup __ftr_alt_* .ref.text);
8989
#ifdef CONFIG_PPC64
9090
*(.tramp.ftrace.text);
9191
#endif

0 commit comments

Comments
 (0)