From 8f3b28457a59d61ab49fd5df3086437a490f03f3 Mon Sep 17 00:00:00 2001 From: Sami Tolvanen Date: Wed, 10 Jun 2020 10:14:32 -0700 Subject: [PATCH 1/2] ANDROID: kbuild: merge more sections with LTO Merge 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 Git-commit: f31cfc8907f9e50959a618b21856fefd6f773f0e Git-repo: https://android.googlesource.com/kernel/common/ Signed-off-by: Prasad Sodagudi --- scripts/module-lto.lds.S | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/scripts/module-lto.lds.S b/scripts/module-lto.lds.S index c0f4fdeb84a0..f4a76b43485d 100644 --- a/scripts/module-lto.lds.S +++ b/scripts/module-lto.lds.S @@ -15,12 +15,20 @@ 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_]*) } + .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 +38,4 @@ SECTIONS { *(.text.__cfi_check) *(.text .text.[0-9a-zA-Z_]* .text..L.cfi*) } - } From 257b9ae9bde4b43728f29613c526374e37dd6e84 Mon Sep 17 00:00:00 2001 From: Sami Tolvanen Date: Fri, 10 Jul 2020 15:06:05 -0700 Subject: [PATCH 2/2] ANDROID: kbuild: don't merge .*..compoundliteral in modules Bug: 160394326 Change-Id: Ieac583c1b6a6ef312afb0cdd34748a28debe0b8b Signed-off-by: Sami Tolvanen Git-commit: 4f0de1ca4267015e885b9df5b97c27f34c68612e Git-repo: https://android.googlesource.com/kernel/common/ Signed-off-by: Prasad Sodagudi --- scripts/module-lto.lds.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/module-lto.lds.S b/scripts/module-lto.lds.S index f4a76b43485d..a89f0c57b36f 100644 --- a/scripts/module-lto.lds.S +++ b/scripts/module-lto.lds.S @@ -17,17 +17,17 @@ SECTIONS { .bss : { *(.bss .bss.[0-9a-zA-Z_]*) - *(.bss..L* .bss..compoundliteral*) + *(.bss..L*) } .data : { *(.data .data.[0-9a-zA-Z_]*) - *(.data..L* .data..compoundliteral*) + *(.data..L*) } .rodata : { *(.rodata .rodata.[0-9a-zA-Z_]*) - *(.rodata..L* .rodata..compoundliteral*) + *(.rodata..L*) } /*