Sean Christopherson 6a3193cdd5 kbuild: lto: Merge module sections if and only if CONFIG_LTO_CLANG is enabled
Merge module sections only when using Clang LTO. With ld.bfd, merging
sections does not appear to update the symbol tables for the module,
e.g. 'readelf -s' shows the value that a symbol would have had, if
sections were not merged. ld.lld does not show this problem.

The stale symbol table breaks gdb's function disassembler, and presumably
other things, e.g.

  gdb -batch -ex "file arch/x86/kvm/kvm.ko" -ex "disassemble kvm_init"

reads the wrong bytes and dumps garbage.

Fixes: dd2776222abb ("kbuild: lto: merge module sections")
Cc: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Tested-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20210322234438.502582-1-seanjc@google.com
2021-04-01 14:15:59 -07:00
..
2021-02-12 19:23:39 -06:00
2021-03-05 12:12:28 -08:00
2021-02-26 09:41:05 -08:00
2017-03-28 16:16:52 +02:00
2021-02-24 10:25:37 -08:00
2020-12-08 23:30:04 +09:00
2020-12-08 23:30:04 +09:00
2021-02-01 10:37:19 +09:00
2021-02-22 08:22:04 +09:00
2021-02-23 12:46:57 -08:00
2021-02-25 10:17:31 -08:00
2020-10-22 13:13:57 -07:00
2021-02-26 09:41:05 -08:00
2020-12-08 23:30:04 +09:00
2021-01-27 14:50:12 +01:00
2021-02-01 17:17:14 -07:00
2020-12-08 23:30:04 +09:00