kbuild: lto: merge module sections
authorSami Tolvanen <samitolvanen@google.com>
Fri, 11 Dec 2020 18:46:22 +0000 (10:46 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Feb 2022 11:01:00 +0000 (12:01 +0100)
commit8b53e5f737bcf64226298c16c3920e7f0807ab94
treedc0eaa87966ed8e7878ef302c9ecd11e5b8c523b
parent45102b538a9e0b244ede1007fd8dcc1a0d9a0627
kbuild: lto: merge module sections

commit dd2776222abb9893e5b5c237a2c8c880d8854cee upstream.

LLD always splits sections with LTO, which increases module sizes. This
change adds linker script rules to merge the split sections in the final
module.

Suggested-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20201211184633.3213045-6-samitolvanen@google.com
Cc: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
scripts/module.lds.S