From 442c302e2e34daa6e16b3938b9fe7b93daae8a1a Mon Sep 17 00:00:00 2001 From: Sami Tolvanen Date: Wed, 25 Nov 2020 08:44:09 -0800 Subject: [PATCH] ANDROID: vmlinux.lds.h: merge compound literal sections After LLVM rG9e33c096476a ("[ELF] Keep orphan section names (.rodata.foo .text.foo) unchanged if !hasSectionsCommand"), LLD splits compound literals to separate sections with -fdata-sections, which it always enables with LTO. Merge these sections to allow LLVM to be upgraded. Bug: 174047799 Change-Id: I858c5fcc48283d5528c1d3e2b2d7a3c72f9e03d6 Link: https://github.com/ClangBuiltLinux/linux/issues/958 Suggested-by: Danny Lin Suggested-by: Fangrui Song Signed-off-by: Sami Tolvanen --- include/asm-generic/vmlinux.lds.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index eff86b973109..6a21d161f724 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -69,10 +69,10 @@ #if defined(CONFIG_LD_DEAD_CODE_DATA_ELIMINATION) || defined(CONFIG_LTO_CLANG) #define TEXT_MAIN .text .text.[0-9a-zA-Z_]* #define TEXT_CFI_MAIN .text.[0-9a-zA-Z_]*.cfi -#define DATA_MAIN .data .data.[0-9a-zA-Z_]* .data..LPBX* +#define DATA_MAIN .data .data.[0-9a-zA-Z_]* .data..L* .data..compoundliteral* #define SDATA_MAIN .sdata .sdata.[0-9a-zA-Z_]* -#define RODATA_MAIN .rodata .rodata.[0-9a-zA-Z_]* -#define BSS_MAIN .bss .bss.[0-9a-zA-Z_]* +#define RODATA_MAIN .rodata .rodata.[0-9a-zA-Z_]* .rodata..L* +#define BSS_MAIN .bss .bss.[0-9a-zA-Z_]* .bss..compoundliteral* #define SBSS_MAIN .sbss .sbss.[0-9a-zA-Z_]* #else #define TEXT_MAIN .text