Skip to content

Commit

Permalink
ANDROID: vmlinux.lds.h: merge compound literal sections
Browse files Browse the repository at this point in the history
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
Bug: 175351675
Change-Id: I858c5fcc48283d5528c1d3e2b2d7a3c72f9e03d6
Link: ClangBuiltLinux/linux#958
Suggested-by: Danny Lin <[email protected]>
Suggested-by: Fangrui Song <[email protected]>
Signed-off-by: Sami Tolvanen <[email protected]>
Signed-off-by: Nick Desaulniers <[email protected]>
Signed-off-by: atndko <[email protected]>
  • Loading branch information
samitolvanen authored and 0wnerDied committed Apr 22, 2021
1 parent dd2eacb commit 7d78cdd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/asm-generic/vmlinux.lds.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@
* .data. We don't want to pull in .data..other sections, which Linux
* has defined. Same for text and bss.
*/
#ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
#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.cfi .text.[0-9a-zA-Z_]*.cfi
#define DATA_MAIN .data .data.[0-9a-zA-Z_]*
#define BSS_MAIN .bss .bss.[0-9a-zA-Z_]*
#define DATA_MAIN .data .data.[0-9a-zA-Z_]* .data..L* .data..compoundliteral*
#define BSS_MAIN .bss .bss.[0-9a-zA-Z_]* .bss..compoundliteral*
#else
#define TEXT_MAIN .text
#define TEXT_CFI_MAIN .text.cfi
Expand Down

0 comments on commit 7d78cdd

Please sign in to comment.