Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/vmlinux.lds.S: Prevent thunk functions from getting placed with normal text

The s390 indirect thunks are placed in the .text.__s390_indirect_jump_*
sections.

Certain config options which enable -ffunction-sections have a custom
version of the TEXT_TEXT macro:

.text.[0-9a-zA-Z_]*

That unintentionally matches the thunk sections, causing them to get
grouped with normal text rather than being handled by their intended
rule later in the script:

*(.text.*_indirect_*)

Fix that by adding another period to the thunk section names, following
the kernel's general convention for distinguishing code-generated text
sections from compiler-generated ones.

Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Acked-by: Petr Mladek <pmladek@suse.com>
Tested-by: Joe Lawrence <joe.lawrence@redhat.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>

+2 -2
+1 -1
arch/s390/include/asm/nospec-insn.h
··· 19 19 #ifdef CONFIG_EXPOLINE_EXTERN 20 20 SYM_CODE_START(\name) 21 21 #else 22 - .pushsection .text.\name,"axG",@progbits,\name,comdat 22 + .pushsection .text..\name,"axG",@progbits,\name,comdat 23 23 .globl \name 24 24 .hidden \name 25 25 .type \name,@function
+1 -1
arch/s390/kernel/vmlinux.lds.S
··· 51 51 IRQENTRY_TEXT 52 52 SOFTIRQENTRY_TEXT 53 53 FTRACE_HOTPATCH_TRAMPOLINES_TEXT 54 - *(.text.*_indirect_*) 54 + *(.text..*_indirect_*) 55 55 *(.gnu.warning) 56 56 . = ALIGN(PAGE_SIZE); 57 57 _etext = .; /* End of text section */