summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJosh Poimboeuf <jpoimboe@kernel.org>2022-08-19 00:39:27 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-08-25 12:45:39 +0300
commitfe5a22a2925a9cd6f2afe1ea0991333eb5d4491d (patch)
tree957ea98039a844ffc324877afbe2015b0edbb6cf /tools
parente124bab08a51d80badd94fef78a8284fbe49799c (diff)
downloadlinux-fe5a22a2925a9cd6f2afe1ea0991333eb5d4491d.tar.xz
x86/ibt, objtool: Add IBT_NOSEAL()
[ Upstream commit e27e5bea956ce4d3eb15112de5fa5a3b77c2f488 ] Add a macro which prevents a function from getting sealed if there are no compile-time references to it. Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org> Message-Id: <20220818213927.e44fmxkoq4yj6ybn@treble> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/objtool/check.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index b341f8a8c7c5..31c719f99f66 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -4096,7 +4096,8 @@ static int validate_ibt(struct objtool_file *file)
* These sections can reference text addresses, but not with
* the intent to indirect branch to them.
*/
- if (!strncmp(sec->name, ".discard", 8) ||
+ if ((!strncmp(sec->name, ".discard", 8) &&
+ strcmp(sec->name, ".discard.ibt_endbr_noseal")) ||
!strncmp(sec->name, ".debug", 6) ||
!strcmp(sec->name, ".altinstructions") ||
!strcmp(sec->name, ".ibt_endbr_seal") ||