[GIT PULL] objtool fix

Ingo Molnar posted 1 patch 2 years, 8 months ago
There is a newer version of this series
tools/objtool/check.c | 9 +++++++++
1 file changed, 9 insertions(+)
[GIT PULL] objtool fix
Posted by Ingo Molnar 2 years, 8 months ago
Linus,

Please pull the latest core/urgent git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core-urgent-2023-01-12

   # HEAD: cad90e5381d840cf2296aaac9b3eff71a30b7c5b objtool: Tolerate STT_NOTYPE symbols at end of section

- Fix objtool to be more permissive with hand-written assembly
  that uses non-function symbols in executable sections.

 Thanks,

	Ingo

------------------>
Nicholas Piggin (1):
      objtool: Tolerate STT_NOTYPE symbols at end of section


 tools/objtool/check.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 4350be739f4f..4b7c8b33069e 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -427,6 +427,15 @@ static int decode_instructions(struct objtool_file *file)
 			if (func->type != STT_NOTYPE && func->type != STT_FUNC)
 				continue;
 
+			if (func->offset == sec->sh.sh_size) {
+				/* Heuristic: likely an "end" symbol */
+				if (func->type == STT_NOTYPE)
+					continue;
+				WARN("%s(): STT_FUNC at end of section",
+				     func->name);
+				return -1;
+			}
+
 			if (func->return_thunk || func->alias != func)
 				continue;
Re: [GIT PULL] objtool fix
Posted by pr-tracker-bot@kernel.org 2 years, 8 months ago
The pull request you sent on Thu, 12 Jan 2023 14:57:17 +0100:

> git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core-urgent-2023-01-12

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/cf4d5be89c0ad339108e672a2f973bf276bd5d2c

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html