Re: [PATCH v3 3/8] arm64: entry: add unwind info for various kernel entries
Jens Remus <[email protected]> Thu, 16 Apr 2026 18:49:28 +0200
| Newsgroups | org.kernel.vger.linux-toolchains,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-kernel,org.kernel.vger.live-patching |
|---|---|
| Organization | IBM Deutschland Research & Development GmbH |
| Message-ID | <[email protected]> |
On 4/6/2026 8:49 PM, Dylan Hatch wrote: > From: Weinan Liu <[email protected]> > > DWARF CFI (Call Frame Information) specifies how to recover the return > address and callee-saved registers at each PC in a given function. > Compilers are able to generate the CFI annotations when they compile > the code to assembly language. For handcrafted assembly, we need to > annotate them by hand. > > Annotate CFI unwind info for assembly for interrupt and exception > handlers. > > Signed-off-by: Weinan Liu <[email protected]> > Signed-off-by: Dylan Hatch <[email protected]> > --- > arch/arm64/kernel/entry.S | 10 ++++++++++ > 1 file changed, 10 insertions(+) The added CFI directives somehow cause .eh_frame (instead of .debug_frame) to be generated in addition to .sframe. This causes the following warning when linking vmlinux (.tmp_vmlinux1, .tmp_vmlinux2, and vmlinux.unstripped): LD vmlinux.unstripped aarch64-linux-gnu-ld: warning: orphan section `.eh_frame' from `arch/arm64/kernel/entry.o' being placed in section `.eh_frame' I don't think this can be controlled using compiler options -fno-asynchronous-unwind-tables -fno-unwind-tables, as entry.S is only preprocessed and then fed into the assembler. The following at the top of entry.S would resolve the issue: diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S @@ -30,6 +30,12 @@ #include <asm/asm-uaccess.h> #include <asm/unistd.h> +/* + * Do not generate .eh_frame. Only generate .debug_frame and optionally + * .sframe (via assembler option --gsframe[-N]). + */ + .cfi_sections .debug_frame + .macro clear_gp_regs .irp n,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29 mov x\n, xzr Regards, Jens -- Jens Remus Linux on Z Development (D3303) [email protected] / [email protected] IBM Deutschland Research & Development GmbH; Vorsitzender des Aufsichtsrats: Wolfgang Wendt; Geschäftsführung: David Faller; Sitz der Gesellschaft: Ehningen; Registergericht: Amtsgericht Stuttgart, HRB 243294 IBM Data Privacy Statement: https://www.ibm.com/privacy/