kernel-hacking-2024-linux-s.../scripts
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: dd2776222a ("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
..
atomic
basic
clang-tools gen_compile_commands: prune some directories 2021-02-16 22:23:56 +09:00
coccinelle of: Remove of_dev_{get,put}() 2021-02-12 19:23:39 -06:00
dtc Devicetree fixes for v5.12-rc: 2021-03-05 12:12:28 -08:00
dummy-tools kbuild: dummy-tools: adjust to scripts/cc-version.sh 2021-03-11 14:52:54 +09:00
gcc-plugins kbuild: rebuild GCC plugins when the compiler is upgraded 2021-03-11 14:40:50 +09:00
gdb scripts/gdb: fix list_for_each 2021-02-26 09:41:05 -08:00
genksyms genksyms: remove useless case DOTS 2021-02-16 12:01:45 +09:00
kconfig kconfig: unify rule of config, menuconfig, nconfig, gconfig, xconfig 2021-02-24 15:12:06 +09:00
ksymoops
mod Char/Misc driver patches for 5.12-rc1 2021-02-24 10:25:37 -08:00
package
selinux
tracing
.gitignore
adjust_autoksyms.sh kbuild: do not include include/config/auto.conf from adjust_autoksyms.sh 2021-02-28 15:22:02 +09:00
asn1_compiler.c
bin2c.c
bloat-o-meter scripts: switch explicitly to Python 3 2021-01-22 06:34:44 +09:00
bootgraph.pl
bpf_helpers_doc.py
cc-can-link.sh
cc-version.sh kbuild: check the minimum compiler version in Kconfig 2021-02-16 12:01:32 +09:00
check-sysctl-docs
check_extable.sh
checkincludes.pl
checkkconfigsymbols.py
checkpatch.pl checkpatch: do not apply "initialise globals to 0" check to BPF progs 2021-02-26 09:41:04 -08:00
checkstack.pl
checksyscalls.sh
checkversion.pl
cleanfile
cleanpatch
coccicheck
config
const_structs.checkpatch
decode_stacktrace.sh
decodecode
depmod.sh
dev-needs.sh
diffconfig scripts: switch explicitly to Python 3 2021-01-22 06:34:44 +09:00
documentation-file-ref-check
export_report.pl
extract-cert.c
extract-ikconfig
extract-module-sig.pl
extract-sys-certs.pl
extract-vmlinux
extract_xc3028.pl
faddr2line
file-size.sh
find-unused-docs.sh
gcc-goto.sh
gcc-ld
gcc-x86_32-has-stack-protector.sh
gcc-x86_64-has-stack-protector.sh
gen_autoksyms.sh kbuild: fix UNUSED_KSYMS_WHITELIST for Clang LTO 2021-02-28 15:19:21 +09:00
gen_ksymdeps.sh
generate_initcall_order.pl init: lto: ensure initcall ordering 2021-01-14 08:21:09 -08:00
get_abi.pl
get_dvb_firmware
get_feat.pl
get_maintainer.pl
gfp-translate
headerdep.pl
headers_check.pl
headers_install.sh
insert-sys-cert.c
jobserver-exec kbuild: remove PYTHON variable 2021-02-01 10:37:19 +09:00
kallsyms.c kallsyms: fix nonconverging kallsyms table with lld 2021-02-05 17:53:28 +09:00
Kbuild.include kbuild: remove ld-version macro 2021-02-22 08:22:04 +09:00
Kconfig.include kbuild: check the minimum linker version in Kconfig 2021-02-22 08:22:04 +09:00
kernel-doc scripts: kernel-doc: fix array element capture in pointer-to-func parsing 2021-02-22 14:20:36 -07:00
ld-version.sh kbuild: fix ld-version.sh to not be affected by locale 2021-03-13 11:12:13 +09:00
leaking_addresses.pl
Lindent
link-vmlinux.sh kbuild: lto: postpone objtool 2021-02-23 12:46:57 -08:00
Makefile scripts: set proper OpenSSL include dir also for sign-file 2021-02-15 01:54:11 +09:00
Makefile.asm-generic
Makefile.build Kbuild updates for v5.12 2021-02-25 10:17:31 -08:00
Makefile.clean kbuild: remove deprecated 'always' and 'hostprogs-y/m' 2021-02-24 15:12:06 +09:00
Makefile.dtbinst kbuild: Add support to build overlays (%.dtbo) 2021-02-04 09:00:04 -06:00
Makefile.extrawarn
Makefile.gcc-plugins
Makefile.headersinst
Makefile.host
Makefile.kasan
Makefile.kcov
Makefile.kcsan
Makefile.lib kbuild: remove meaningless parameter to $(call if_changed_rule,dtc) 2021-03-11 18:22:48 +09:00
Makefile.modfinal kbuild: lto: postpone objtool 2021-02-23 12:46:57 -08:00
Makefile.modinst
Makefile.modpost kbuild: lto: fix module versioning 2021-01-14 08:21:08 -08:00
Makefile.modsign
Makefile.package
Makefile.ubsan ubsan: remove overflow checks 2021-02-26 09:41:05 -08:00
Makefile.userprogs
makelst
markup_oops.pl
mkcompile_h
mkmakefile
mksysmap
mkuboot.sh
module.lds.S kbuild: lto: Merge module sections if and only if CONFIG_LTO_CLANG is enabled 2021-04-01 14:15:59 -07:00
modules-check.sh
nsdeps
objdiff
parse-maintainers.pl
patch-kernel
profile2linkerlist.pl
prune-kernel
recordmcount.c ftrace: Have recordmcount use w8 to read relp->r_info in arm64_is_fake_mcount 2021-03-02 17:27:18 -05:00
recordmcount.h
recordmcount.pl scripts/recordmcount.pl: support big endian for ARCH sh 2021-02-13 11:42:40 -08:00
setlocalversion
show_delta
sign-file.c
sorttable.c
sorttable.h
spdxcheck-test.sh
spdxcheck.py spdxcheck.py: Use Python 3 2021-01-27 14:50:12 +01:00
spelling.txt scripts/spelling.txt: add more spellings to spelling.txt 2021-02-24 13:38:26 -08:00
sphinx-pre-install Docs: drop Python 2 support 2021-02-01 17:17:14 -07:00
split-man.pl
stackdelta
stackusage
subarch.include
syscallhdr.sh scripts: add generic syscallhdr.sh 2021-02-22 08:22:04 +09:00
syscalltbl.sh scripts: add generic syscalltbl.sh 2021-02-22 08:22:03 +09:00
tags.sh
test_dwarf5_support.sh Kconfig: allow explicit opt in to DWARF v5 2021-02-16 12:01:45 +09:00
tools-support-relr.sh
unifdef.c
ver_linux ver_linux: Eliminate duplicate code in ldconfig processing logic 2021-01-27 14:54:42 +01:00
xen-hypercalls.sh
xz_wrap.sh