2024-02-09 23:53:19

by Saeed Mirzamohammadi

[permalink] [raw]
Subject: [PATCH 0/1] tools/objtools: tolerate mix of data in code section

Any data in code section will cause objtools to fail and not process the
rest of the symbols and sections. This patch is a suggestion but any
better approach is appreciated.

Saeed Mirzamohammadi (1):
tools/objtools: tolerate mix of data in code section

tools/objtool/check.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

--
2.42.0



2024-02-09 23:53:25

by Saeed Mirzamohammadi

[permalink] [raw]
Subject: [PATCH 1/1] tools/objtools: tolerate mix of data in code section

Hand-written asm files might have data in the .text section and this
causes the objtools to not find the starting instruction. This avoids
this warning.

warning: objtool: n8_SafeDecrypt_RIJ128(): can't find starting instruction

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

diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index e308d1ba664ef..9de4881f16984 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -459,9 +459,11 @@ static int decode_instructions(struct objtool_file *file)
continue;

if (!find_insn(file, sec, func->offset)) {
- WARN("%s(): can't find starting instruction",
- func->name);
- return -1;
+ /*
+ * Can't find starting instruction likely due to data in
+ * beginning of the section
+ */
+ continue;
}

sym_for_each_insn(file, func, insn) {
--
2.42.0