android_kernel_xiaomi_sm8450/arch
Song Liu b4c0e45118 UPSTREAM: x86/purgatory: Remove LTO flags
-flto* implies -ffunction-sections. With LTO enabled, ld.lld generates
multiple .text sections for purgatory.ro:

  $ readelf -S purgatory.ro  | grep " .text"
    [ 1] .text             PROGBITS         0000000000000000  00000040
    [ 7] .text.purgatory   PROGBITS         0000000000000000  000020e0
    [ 9] .text.warn        PROGBITS         0000000000000000  000021c0
    [13] .text.sha256_upda PROGBITS         0000000000000000  000022f0
    [15] .text.sha224_upda PROGBITS         0000000000000000  00002be0
    [17] .text.sha256_fina PROGBITS         0000000000000000  00002bf0
    [19] .text.sha224_fina PROGBITS         0000000000000000  00002cc0

This causes WARNING from kexec_purgatory_setup_sechdrs():

  WARNING: CPU: 26 PID: 110894 at kernel/kexec_file.c:919
  kexec_load_purgatory+0x37f/0x390

Fix this by disabling LTO for purgatory.

[ AFAICT, x86 is the only arch that supports LTO and purgatory. ]

We could also fix this with an explicit linker script to rejoin .text.*
sections back into .text. However, given the benefit of LTOing purgatory
is small, simply disable the production of more .text.* sections for now.

Bug: 254441685
Fixes: b33fff07e3e3 ("x86, build: allow LTO to be selected")
Signed-off-by: Song Liu <song@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Link: https://lore.kernel.org/r/20230914170138.995606-1-song@kernel.org
(cherry picked from commit 75b2f7e4c9e0fd750a5a27ca9736d1daa7a3762a)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: Ia97a12ef553e557bc269652a7c5cdc70e8256f85
2024-03-13 13:35:31 +00:00
..
alpha Merge 5.10.191 into android12-5.10-lts 2023-08-28 16:37:52 +00:00
arc ARC: define ASM_NL and __ALIGN(_STR) outside #ifdef __ASSEMBLY__ guard 2023-07-27 08:44:00 +02:00
arm This is the 5.10.204 stable release 2023-12-14 15:59:58 +00:00
arm64 ANDROID: arm64: Call fixup_exception() within do_sea() 2024-03-11 17:55:08 +00:00
c6x UPSTREAM: c6x: add support for TIF_NOTIFY_SIGNAL 2023-02-07 13:38:12 +00:00
csky Merge 5.10.166 into android12-5.10-lts 2023-02-17 12:18:56 +00:00
h8300 Merge 5.10.166 into android12-5.10-lts 2023-02-17 12:18:56 +00:00
hexagon UPSTREAM: arch: setup PF_IO_WORKER threads like PF_KTHREAD 2023-02-07 13:38:14 +00:00
ia64 This is the 5.10.189 stable release 2023-08-23 15:12:23 +00:00
m68k This is the 5.10.195 stable release 2023-09-19 11:32:32 +00:00
microblaze Merge 5.10.166 into android12-5.10-lts 2023-02-17 12:18:56 +00:00
mips This is the 5.10.204 stable release 2023-12-14 15:59:58 +00:00
nds32 UPSTREAM: arch: setup PF_IO_WORKER threads like PF_KTHREAD 2023-02-07 13:38:14 +00:00
nios2 nios2: dts: Fix tse_mac "max-frame-size" property 2023-06-21 15:45:37 +02:00
openrisc openrisc: Properly store r31 to pt_regs on unhandled exceptions 2023-05-17 11:48:03 +02:00
parisc Merge 5.10.203 into android12-5.10-lts 2023-12-11 16:34:56 +00:00
powerpc This is the 5.10.205 stable release 2023-12-21 12:24:50 +00:00
riscv This is the 5.10.204 stable release 2023-12-14 15:59:58 +00:00
s390 This is the 5.10.204 stable release 2023-12-14 15:59:58 +00:00
sh Merge 5.10.201 into android12-5.10-lts 2023-11-29 14:46:51 +00:00
sparc This is the 5.10.200 stable release 2023-11-26 14:07:49 +00:00
um This is the 5.10.195 stable release 2023-09-19 11:32:32 +00:00
x86 UPSTREAM: x86/purgatory: Remove LTO flags 2024-03-13 13:35:31 +00:00
xtensa This is the 5.10.198 stable release 2023-10-26 17:54:46 +00:00
.gitignore
Kconfig This is the 5.10.189 stable release 2023-08-23 15:12:23 +00:00