summaryrefslogtreecommitdiff
path: root/clang/test/Driver/fpatchable-function-entry.c
AgeCommit message (Collapse)Author
2025-09-09[PowerPC] Support `-fpatchable-function-entry` on PPC64LE (#151569)Maryam Moghadas
This patch enables `-fpatchable-function-entry` on PPC64 little-endian Linux. It is mutually exclusive with existing XRay instrumentation on this target.
2025-04-02Support alternative sections for patchable function entries (#131230)Sami Tolvanen
With -fpatchable-function-entry (or the patchable_function_entry function attribute), we emit records of patchable entry locations to the __patchable_function_entries section. Add an additional parameter to the command line option that allows one to specify a different default section name for the records, and an identical parameter to the function attribute that allows one to override the section used. The main use case for this change is the Linux kernel using prefix NOPs for ftrace, and thus depending on__patchable_function_entries to locate traceable functions. Functions that are not traceable currently disable entry NOPs using the function attribute, but this creates a compatibility issue with -fsanitize=kcfi, which expects all indirectly callable functions to have a type hash prefix at the same offset from the function entry. Adding a section parameter would allow the kernel to distinguish between traceable and non-traceable functions by adding entry records to separate sections while maintaining a stable function prefix layout for all functions. LKML discussion: https://lore.kernel.org/lkml/Y1QEzk%2FA41PKLEPe@hirez.programming.kicks-ass.net/
2024-07-22[PowerPC] Support -fpatchable-function-entry (#92997)Chen Zheng
For now only PPC big endian Linux 32 and 64 bit are supported. PPC little endian Linux has XRAY support for 64-bit. PPC AIX has different patchable function entry implementations. Fixes #63220 Fixes #57031
2024-05-23[Driver][test] Replace legacy -target with --target=Fangrui Song
Similar to previous cleanup.
2023-03-16[Clang][LoongArch] Implement patchable function entryWANG Xuerui
Similar to D98610 for RISCV. This is going to be required by the upcoming Linux/LoongArch [[ https://git.kernel.org/linus/4733f09d88074 | support for dynamic ftrace ]]. Reviewed By: SixWeining, MaskRay Differential Revision: https://reviews.llvm.org/D141785
2021-03-16[RISCV] Support clang -fpatchable-function-entry && GNU function attribute ↵Fangrui Song
'patchable_function_entry' Similar to D72215 (AArch64) and D72220 (x86). ``` % clang -target riscv32 -march=rv64g -c -fpatchable-function-entry=2 a.c && llvm-objdump -dr a.o ... 0000000000000000 <main>: 0: 13 00 00 00 nop 4: 13 00 00 00 nop % clang -target riscv32 -march=rv64gc -c -fpatchable-function-entry=2 a.c && llvm-objdump -dr a.o ... 00000002 <main>: 2: 01 00 nop 4: 01 00 nop ``` Recently the mainline kernel started to use -fpatchable-function-entry=8 for riscv (https://git.kernel.org/linus/afc76b8b80112189b6f11e67e19cf58301944814). Differential Revision: https://reviews.llvm.org/D98610
2020-01-23[Driver][CodeGen] Support -fpatchable-function-entry=N,M and ↵Fangrui Song
__attribute__((patchable_function_entry(N,M))) where M>0 Reviewed By: nickdesaulniers Differential Revision: https://reviews.llvm.org/D73072
2020-01-10[Driver][CodeGen] Add -fpatchable-function-entry=N[,0]Fangrui Song
In the backend, this feature is implemented with the function attribute "patchable-function-entry". Both the attribute and XRay use TargetOpcode::PATCHABLE_FUNCTION_ENTER, so the two features are incompatible. Reviewed By: ostannard, MaskRay Differential Revision: https://reviews.llvm.org/D72222