[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <43e3ed230c982e35e43a9c66247b995336253d2d.1746821544.git.jpoimboe@kernel.org>
Date: Fri, 9 May 2025 13:17:11 -0700
From: Josh Poimboeuf <jpoimboe@...nel.org>
To: x86@...nel.org
Cc: linux-kernel@...r.kernel.org,
Petr Mladek <pmladek@...e.com>,
Miroslav Benes <mbenes@...e.cz>,
Joe Lawrence <joe.lawrence@...hat.com>,
live-patching@...r.kernel.org,
Song Liu <song@...nel.org>,
laokz <laokz@...mail.com>,
Jiri Kosina <jikos@...nel.org>,
Marcos Paulo de Souza <mpdesouza@...e.com>,
Weinan Liu <wnliu@...gle.com>,
Fazla Mehrab <a.mehrab@...edance.com>,
Chen Zhongjin <chenzhongjin@...wei.com>,
Puranjay Mohan <puranjay@...nel.org>
Subject: [PATCH v2 47/62] x86/orc: Define ELF section entry size for unwind hints
In preparation for the objtool klp diff subcommand, define the entry
size for the discard.unwind_hints section in its ELF header. This will
allow tooling to extract individual entries.
Signed-off-by: Josh Poimboeuf <jpoimboe@...nel.org>
---
arch/x86/kernel/unwind_orc.c | 2 ++
include/linux/objtool.h | 9 ++++++---
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kernel/unwind_orc.c b/arch/x86/kernel/unwind_orc.c
index 977ee75e047c..4624d6d916a2 100644
--- a/arch/x86/kernel/unwind_orc.c
+++ b/arch/x86/kernel/unwind_orc.c
@@ -199,6 +199,8 @@ static struct orc_entry *orc_find(unsigned long ip)
{
static struct orc_entry *orc;
+ BUILD_BUG_ON(UNWIND_HINT_SIZE != sizeof(struct unwind_hint));
+
if (ip == 0)
return &null_orc_entry;
diff --git a/include/linux/objtool.h b/include/linux/objtool.h
index 366ad004d794..483dd3131826 100644
--- a/include/linux/objtool.h
+++ b/include/linux/objtool.h
@@ -8,11 +8,14 @@
#include <asm/asm.h>
+#define UNWIND_HINT_SIZE 12
+
#ifndef __ASSEMBLY__
-#define UNWIND_HINT(type, sp_reg, sp_offset, signal) \
+#define UNWIND_HINT(type, sp_reg, sp_offset, signal) \
"987: \n\t" \
- ".pushsection .discard.unwind_hints\n\t" \
+ ".pushsection .discard.unwind_hints, \"M\", @progbits, "\
+ __stringify(UNWIND_HINT_SIZE) "\n\t" \
/* struct unwind_hint */ \
".long 987b - .\n\t" \
".short " __stringify(sp_offset) "\n\t" \
@@ -88,7 +91,7 @@
*/
.macro UNWIND_HINT type:req sp_reg=0 sp_offset=0 signal=0
.Lhere_\@:
- .pushsection .discard.unwind_hints
+ .pushsection .discard.unwind_hints, "M", @progbits, UNWIND_HINT_SIZE
/* struct unwind_hint */
.long .Lhere_\@ - .
.short \sp_offset
--
2.49.0
Powered by blists - more mailing lists