Thread (91 messages) 91 messages, 8 authors, 2020-01-23

[RFC v5 14/57] objtool: Do not look for STT_NOTYPE symbols

flat view

From: Julien Thierry <hidden>
Date: 2020-01-09 16:04:42
Also in: lkml
Subsystem: objtool, the rest · Maintainers: Josh Poimboeuf, Peter Zijlstra, Linus Torvalds

ELF symbols can have type STT_NOTYPE which have no standard semantics.

Arm64 objects will contain STT_NOTYPE symbols at the beginning of each
section which aren't of any use to generic objtool code. Those symbols
unfortunately overlap with the first function of the section.

Skip symbols with type STT_NOTYPE when looking up symbols.

Suggested-by: Raphael Gault <redacted>
Signed-off-by: Julien Thierry <redacted>
---
 tools/objtool/elf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c
index edba4745f25a..c6ac0b771b73 100644
--- a/tools/objtool/elf.c
+++ b/tools/objtool/elf.c
@@ -62,7 +62,8 @@ struct symbol *find_symbol_by_offset(struct section *sec, unsigned long offset)
 	struct symbol *sym;
 
 	list_for_each_entry(sym, &sec->symbol_list, list)
-		if (sym->type != STT_SECTION &&
+		if (sym->type != STT_NOTYPE &&
+		    sym->type != STT_SECTION &&
 		    sym->offset == offset)
 			return sym;
 
-- 
2.21.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help