linux-stable/scripts
Steven Rostedt (Google) 4ed308c445 ftrace: Have architectures opt-in for mcount build time sorting
First S390 complained that the sorting of the mcount sections at build
time caused the kernel to crash on their architecture. Now PowerPC is
complaining about it too. And also ARM64 appears to be having issues.

It may be necessary to also update the relocation table for the values
in the mcount table. Not only do we have to sort the table, but also
update the relocations that may be applied to the items in the table.

If the system is not relocatable, then it is fine to sort, but if it is,
some architectures may have issues (although x86 does not as it shifts all
addresses the same).

Add a HAVE_BUILDTIME_MCOUNT_SORT that an architecture can set to say it is
safe to do the sorting at build time.

Also update the config to compile in build time sorting in the sorttable
code in scripts/ to depend on CONFIG_BUILDTIME_MCOUNT_SORT.

Link: https://lore.kernel.org/all/944D10DA-8200-4BA9-8D0A-3BED9AA99F82@linux.ibm.com/
Link: https://lkml.kernel.org/r/20220127153821.3bc1ac6e@gandalf.local.home

Cc: Ingo Molnar <mingo@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Yinan Liu <yinan@linux.alibaba.com>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Kees Cook <keescook@chromium.org>
Reported-by: Sachin Sant <sachinp@linux.ibm.com>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Tested-by: Mark Rutland <mark.rutland@arm.com> [arm64]
Tested-by: Sachin Sant <sachinp@linux.ibm.com>
Fixes: 72b3942a17 ("scripts: ftrace - move the sort-processing in ftrace_init")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
2022-01-27 19:15:44 -05:00
..
atomic locking/atomics, kcsan: Add instrumentation for barriers 2021-12-09 16:42:27 -08:00
basic
clang-tools gen_compile_commands: fix missing 'sys' package 2021-09-19 10:13:03 +09:00
coccinelle drop fen.cocci 2022-01-15 12:15:35 +01:00
dtc scripts/dtc: dtx_diff: remove broken example from help text 2022-01-17 16:26:44 -06:00
dummy-tools
gcc-plugins ARM development for 5.16: 2021-11-02 11:33:15 -07:00
gdb scripts/gdb: lx-dmesg: read records individually 2021-12-16 15:52:38 +01:00
genksyms
kconfig kbuild: do not quote string values in include/config/auto.conf 2022-01-08 18:03:57 +09:00
ksymoops
mod RISC-V Patches for the 5.17 Merge Window, Part 1 2022-01-19 11:38:21 +02:00
package kbuild: Add make tarzst-pkg build option 2021-10-12 11:50:46 +09:00
selinux
tracing scripts/tracing: fix the bug that can't parse raw_trace_func 2021-08-04 17:49:26 -04:00
.gitignore certs: move scripts/extract-cert to certs/ 2022-01-08 18:28:21 +09:00
adjust_autoksyms.sh kbuild: redo fake deps at include/ksym/*.h 2021-09-03 08:17:21 +09:00
as-version.sh kbuild: Switch to 'f' variants of integrated assembler flag 2021-09-03 08:17:20 +09:00
asn1_compiler.c
bin2c.c
bloat-o-meter
bootgraph.pl
bpf_doc.py bpf: Add bpf_skc_to_unix_sock() helper 2021-10-21 15:11:06 -07:00
cc-can-link.sh
cc-version.sh
check-sysctl-docs
check_extable.sh scripts: check_extable: fix typo in user error message 2021-09-08 11:50:28 -07:00
checkdeclares.pl scripts: make some scripts executable 2021-08-10 09:13:25 +09:00
checkincludes.pl
checkkconfigsymbols.py checkkconfigsymbols.py: Remove skipping of help lines in parse_kconfig_file 2021-09-19 10:13:03 +09:00
checkpatch.pl checkpatch: improve Kconfig help test 2022-01-20 08:52:54 +02:00
checkstack.pl
checksyscalls.sh checksyscalls: Unconditionally ignore fstat{,at}64 2021-10-07 17:16:28 -07:00
checkversion.pl scripts: checkversion: modernize linux/version.h search strings 2021-08-05 20:55:39 +09:00
cleanfile
cleanpatch
coccicheck
config
const_structs.checkpatch const_structs.checkpatch: add frequently used ops structs 2022-01-20 08:52:54 +02:00
decode_stacktrace.sh scripts/decode_stacktrace.sh: indicate 'auto' can be used for base path 2021-07-08 11:48:22 -07:00
decodecode scripts/decodecode: fix faulting instruction no print when opps.file is DOS format 2021-11-06 13:30:32 -07:00
depmod.sh
dev-needs.sh
diffconfig
documentation-file-ref-check scripts: documentation-file-ref-check: fix bpf selftests path 2021-10-26 09:42:29 -06:00
export_report.pl
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: do not quote string values in include/config/auto.conf 2022-01-08 18:03:57 +09:00
gen_ksymdeps.sh kbuild: redo fake deps at include/ksym/*.h 2021-09-03 08:17:21 +09:00
generate_initcall_order.pl
get_abi.pl scripts: get_abi.pl: better generate regex from what fields 2021-10-05 16:23:38 +02:00
get_dvb_firmware
get_feat.pl
get_maintainer.pl get_maintainer: don't remind about no git repo when --nogit is used 2022-01-20 08:52:53 +02:00
gfp-translate
headerdep.pl
headers_install.sh
insert-sys-cert.c
jobserver-exec
kallsyms.c
Kbuild.include certs: simplify $(srctree)/ handling and remove config_filename macro 2022-01-08 17:46:35 +09:00
Kconfig.include
kernel-doc This is a relatively unexciting cycle for documentation. 2021-11-02 22:11:39 -07:00
ld-version.sh
leaking_addresses.pl leaking_addresses: Always print a trailing newline 2021-10-15 11:25:13 +02:00
Lindent
link-vmlinux.sh Kbuild updates for v5.17 2022-01-19 11:15:19 +02:00
Makefile ftrace: Have architectures opt-in for mcount build time sorting 2022-01-27 19:15:44 -05:00
Makefile.asm-generic
Makefile.build x86: Add straight-line-speculation mitigation 2021-12-09 13:32:25 +01:00
Makefile.clang kbuild: Add -Werror=ignored-optimization-argument to CLANG_FLAGS 2021-09-19 10:55:18 +09:00
Makefile.clean
Makefile.compiler
Makefile.debug kbuild: split DEBUG_CFLAGS out to scripts/Makefile.debug 2021-10-24 13:48:33 +09:00
Makefile.dtbinst
Makefile.extrawarn
Makefile.gcc-plugins compiler hardening updates for v5.16-rc1 2021-11-01 17:09:03 -07:00
Makefile.headersinst
Makefile.host
Makefile.kasan kasan: always respect CONFIG_KASAN_STACK 2021-09-24 16:13:35 -07:00
Makefile.kcov
Makefile.kcsan kcsan: Ignore GCC 11+ warnings about TSan runtime support 2021-12-09 16:42:27 -08:00
Makefile.lib Kbuild updates for v5.17 2022-01-19 11:15:19 +02:00
Makefile.modfinal kbuild: Unify options for BTF generation for vmlinux and modules 2021-11-01 18:09:58 -07:00
Makefile.modinst kbuild: do not quote string values in include/config/auto.conf 2022-01-08 18:03:57 +09:00
Makefile.modpost kbuild: Fix comment typo in scripts/Makefile.modpost 2021-09-19 10:14:19 +09:00
Makefile.package kbuild: Add make tarzst-pkg build option 2021-10-12 11:50:46 +09:00
Makefile.ubsan ubsan: remove CONFIG_UBSAN_OBJECT_SIZE 2022-01-20 08:52:55 +02:00
Makefile.userprogs
makelst
markup_oops.pl
min-tool-version.sh Documentation: Raise the minimum supported version of LLVM to 11.0.0 2021-12-02 17:24:32 +09:00
mkcompile_h
mksysmap
mkuboot.sh
module.lds.S module: combine constructors in module linker script 2021-07-19 14:51:40 +02:00
modules-check.sh
nsdeps
objdiff
pahole-flags.sh Core: 2021-11-02 06:20:58 -07:00
parse-maintainers.pl
patch-kernel
profile2linkerlist.pl
prune-kernel
recordmcount.c
recordmcount.h
recordmcount.pl recordmcount.pl: fix typo in s390 mcount regex 2021-12-24 10:20:12 +01:00
remove-stale-files Kbuild updates for v5.17 2022-01-19 11:15:19 +02:00
setlocalversion kbuild: do not quote string values in include/config/auto.conf 2022-01-08 18:03:57 +09:00
show_delta
sign-file.c
sorttable.c RISC-V Patches for the 5.17 Merge Window, Part 1 2022-01-19 11:38:21 +02:00
sorttable.h script/sorttable: Fix some initialization problems 2022-01-18 10:17:18 -05:00
spdxcheck-test.sh scripts/spdxcheck-test.sh: Drop python2 2021-07-21 15:59:32 +02:00
spdxcheck.py scripts/spdxcheck.py: Strictly read license files in utf-8 2021-07-12 09:56:50 -06:00
spelling.txt scripts/spelling.txt: add "oveflow" 2022-01-15 16:30:24 +02:00
sphinx-pre-install scripts: sphinx-pre-install: Fix ctex support on Debian 2022-01-07 09:33:13 -07:00
split-man.pl
stackdelta
stackusage
subarch.include parisc: Fix compile failure when building 64-bit kernel natively 2021-09-01 21:52:02 +02:00
syscallhdr.sh scripts: check duplicated syscall number in syscall table 2021-07-09 04:00:39 +09:00
syscallnr.sh scripts: make some scripts executable 2021-08-10 09:13:25 +09:00
syscalltbl.sh scripts: check duplicated syscall number in syscall table 2021-07-09 04:00:39 +09:00
tags.sh scripts/tags: add space regexs to all regex_c 2021-11-26 16:58:55 +01:00
test_fortify.sh fortify: Add compile-time FORTIFY_SOURCE tests 2021-10-18 12:28:52 -07:00
tools-support-relr.sh
unifdef.c
ver_linux
xen-hypercalls.sh scripts: make some scripts executable 2021-08-10 09:13:25 +09:00
xz_wrap.sh