[RFC PATCH v2 16/24] unwind_user/eh_frame: Ignore DW_CFA_GNU_args_size

From
Jens Remus <hidden>
Date
2026-08-21 19:53:59
Also in
linux-s390, lkml
Reply to
Jens Remus, 2026-08-21
The DW_CFA_GNU_args_size DWARF CFI instruction is used by GCC to track
the size of arguments pushed on the stack for exception handling
purposes.  It is not needed for stack tracing.

Signed-off-by: Jens Remus <redacted>
---

Notes (jremus):
    This patch could be squashed into "unwind_user/eh_frame: Add support for
    reading .eh_frame section".  Leaving separate for review.

 kernel/unwind/eh_frame.c | 11 +++++++++++
 kernel/unwind/eh_frame.h |  1 +
 2 files changed, 12 insertions(+)
diff --git a/kernel/unwind/eh_frame.c b/kernel/unwind/eh_frame.c
index 1ac7308814a1..d185187b0c34 100644
--- a/kernel/unwind/eh_frame.c
+++ b/kernel/unwind/eh_frame.c
@@ -980,6 +980,17 @@ static __always_inline int __do_cfi_insn(struct eh_frame_section *sec,
 			break;
 		}
 
+		case DW_CFA_GNU_args_size: {
+			unsigned long args_size;
+
+			ret = read_uleb128(&cur, end, &args_size);
+			if (ret)
+				return ret;
+
+			/* Ignore DW_CFA_GNU_args_size */
+			break;
+		}
+
 		case DW_CFA_remember_state:
 			if (ctx->stack_depth >= EH_FRAME_MAX_STATE_STACK)
 				return -EINVAL;
diff --git a/kernel/unwind/eh_frame.h b/kernel/unwind/eh_frame.h
index 9a0c71102742..a43560486283 100644
--- a/kernel/unwind/eh_frame.h
+++ b/kernel/unwind/eh_frame.h
@@ -29,6 +29,7 @@
 #define DW_CFA_val_offset		0x14
 #define DW_CFA_val_offset_sf		0x15
 #define DW_CFA_val_expression		0x16
+#define DW_CFA_GNU_args_size		0x2e
 
 /* Helpers for CFI opcodes */
 #define DW_CFA_opcode(insn)		((insn) & 0xc0)
-- 
2.53.0
Thread (58 messages) 58 messages, 3 authors, last reply 2026-09-14
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help