2022-04-19 01:29:10

by Josh Poimboeuf

[permalink] [raw]
Subject: [PATCH v2 11/25] objtool: Use offstr() to print address of missing ENDBR

Signed-off-by: Josh Poimboeuf <[email protected]>
---
tools/objtool/check.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 97026c1b4bd6..49d5f0986a52 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -3219,9 +3219,8 @@ validate_ibt_reloc(struct objtool_file *file, struct reloc *reloc)
static void warn_noendbr(const char *msg, struct section *sec, unsigned long offset,
struct instruction *dest)
{
- WARN_FUNC("%srelocation to !ENDBR: %s+0x%lx", sec, offset, msg,
- dest->func ? dest->func->name : dest->sec->name,
- dest->func ? dest->offset - dest->func->offset : dest->offset);
+ WARN_FUNC("%srelocation to !ENDBR: %s", sec, offset, msg,
+ offstr(dest->sec, dest->offset));
}

static void validate_ibt_dest(struct objtool_file *file, struct instruction *insn,
--
2.34.1


Subject: [tip: x86/urgent] objtool: Use offstr() to print address of missing ENDBR

The following commit has been merged into the x86/urgent branch of tip:

Commit-ID: 1d08b92fa2c41c43e4efe9787413e9ac9a434f83
Gitweb: https://git.kernel.org/tip/1d08b92fa2c41c43e4efe9787413e9ac9a434f83
Author: Josh Poimboeuf <[email protected]>
AuthorDate: Mon, 18 Apr 2022 09:50:30 -07:00
Committer: Peter Zijlstra <[email protected]>
CommitterDate: Tue, 19 Apr 2022 21:58:50 +02:00

objtool: Use offstr() to print address of missing ENDBR

Fixes: 89bc853eae4a ("objtool: Find unused ENDBR instructions")
Signed-off-by: Josh Poimboeuf <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Link: https://lkml.kernel.org/r/95d12e800c736a3f7d08d61dabb760b2d5251a8e.1650300597.git.jpoimboe@redhat.com
---
tools/objtool/check.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index b822a6d..5285edd 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -3211,9 +3211,8 @@ validate_ibt_reloc(struct objtool_file *file, struct reloc *reloc)
static void warn_noendbr(const char *msg, struct section *sec, unsigned long offset,
struct instruction *dest)
{
- WARN_FUNC("%srelocation to !ENDBR: %s+0x%lx", sec, offset, msg,
- dest->func ? dest->func->name : dest->sec->name,
- dest->func ? dest->offset - dest->func->offset : dest->offset);
+ WARN_FUNC("%srelocation to !ENDBR: %s", sec, offset, msg,
+ offstr(dest->sec, dest->offset));
}

static void validate_ibt_dest(struct objtool_file *file, struct instruction *insn,