From 269e56aa35625cc17b7672c683223127333ab5ef Mon Sep 17 00:00:00 2001 From: Sami Tolvanen Date: Wed, 10 Jun 2020 10:14:32 -0700 Subject: [PATCH] ANDROID: kbuild: merge more sections with LTO Merge __patchable_function_entries sections and the following new data sections generated by current LLVM versions: .bss..L* .bss..compoundliteral* .data..L* .data..compoundliteral* .rodata..L* .rodata..compoundliteral* Also drop the unnecessary rules to merge .rela sections. Bug: 158605670 Change-Id: I098212bc74dfb6b54d4fd60d90957fea29122a6c Signed-off-by: Sami Tolvanen --- scripts/module-lto.lds.S | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/scripts/module-lto.lds.S b/scripts/module-lto.lds.S index c0f4fdeb84a0..4ff8eb63a745 100644 --- a/scripts/module-lto.lds.S +++ b/scripts/module-lto.lds.S @@ -15,12 +15,22 @@ SECTIONS { *(.eh_frame) } - .bss : { *(.bss .bss.[0-9a-zA-Z_]*) } - .data : { *(.data .data.[0-9a-zA-Z_]*) } - .rela.data : { *(.rela.data .rela.data.[0-9a-zA-Z_]*) } - .rela.rodata : { *(.rela.rodata .rela.rodata.[0-9a-zA-Z_]*) } - .rela.text : { *(.rela.text .rela.text.[0-9a-zA-Z_]*) } - .rodata : { *(.rodata .rodata.[0-9a-zA-Z_]*) } + __patchable_function_entries : { *(__patchable_function_entries) } + + .bss : { + *(.bss .bss.[0-9a-zA-Z_]*) + *(.bss..L* .bss..compoundliteral*) + } + + .data : { + *(.data .data.[0-9a-zA-Z_]*) + *(.data..L* .data..compoundliteral*) + } + + .rodata : { + *(.rodata .rodata.[0-9a-zA-Z_]*) + *(.rodata..L* .rodata..compoundliteral*) + } /* * With CFI_CLANG, ensure __cfi_check is at the beginning of the @@ -30,5 +40,4 @@ SECTIONS { *(.text.__cfi_check) *(.text .text.[0-9a-zA-Z_]* .text..L.cfi*) } - }