kpatch/kpatch-build
Joe Lawrence 7b6fee6f88 create-diff-object: Create __patchable_function_entries sections
The __mcount_loc section contains the addresses of patchable ftrace
sites which is used by the ftrace infrastructure in the kernel to create
a list of tracable functions and to know where to patch to enable
tracing of them.  On some kernel configurations, section is called
__patchable_function_entries and is generated by the compiler.  Either of
__mcount_loc or __patchable_function_entries is recognised by the kernel
but for these configurations, use __patchable_function_entries as it is
what is expected.

The x86_64 arch is special (of course).  Unlike other arches (ppc64le
and aarch64) a x86_64 kernel built with -fpatchable-function-entry will
generate nops AND create rela__patchable_function_entries for functions even
marked as notrace.  For this arch, always create __mount_loc sections and
rely on __fentry__ relocations to indicate ftrace call sites.

Note: this patch is a refactoring of original code by Pete Swain
<swine@google.com> for aarch64.  At the same time, this version squashes
several follow up commits from him and zimao <zimao@microsoft.com>.  The
intent is minimize the eventual changeset for aarch64 support now that
other arches are making use of __patchable_function_entries sections.

Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
2024-12-03 09:26:10 -05:00
..
gcc-plugins gcc-plugin: update gcc-common.h for gcc-13 2023-03-16 22:05:43 -07:00
insn insn: get it to compile in create-diff-object 2014-05-30 15:19:57 -05:00
create-diff-object.c create-diff-object: Create __patchable_function_entries sections 2024-12-03 09:26:10 -05:00
create-klp-module.c create-diff-object: rename "dynrela" -> "klp_reloc" 2022-12-01 14:00:09 -08:00
create-kpatch-module.c kpatch-elf: pass new ELF output file mode to kpatch_write_output_elf() 2020-09-25 09:30:13 -04:00
kpatch-build Merge pull request #1418 from joe-lawrence/shellcheck-oct-2024 2024-10-10 17:33:06 -04:00
kpatch-cc kpatch-build: ignore init/version-timestamp.o 2023-01-16 09:33:55 -05:00
kpatch-elf.c create-diff-object: Create __patchable_function_entries sections 2024-12-03 09:26:10 -05:00
kpatch-elf.h create-diff-object: Create __patchable_function_entries sections 2024-12-03 09:26:10 -05:00
kpatch-intermediate.h lookup: rename 'pos' to 'sympos' 2020-04-06 15:18:58 -05:00
kpatch.h kpatch-build: add exit status enum 2018-06-15 07:11:48 -04:00
list.h Fix undefined behavior problem when using list_foreach_entry 2023-08-10 00:22:53 +00:00
log.h create-diff-object: use errx() instead of err() 2022-11-30 12:58:31 -08:00
lookup.c lookup: skip duplicate local symbol table check for files without locals 2023-06-05 09:49:30 -07:00
lookup.h Switch to per-file lookup table pointers. 2021-08-17 09:37:44 +02:00
Makefile Merge pull request #1420 from georgejguo/master 2024-10-23 12:44:10 -04:00