[<prev] [next>] [day] [month] [year] [list]
Message-ID: <7yRJhWSstisXjg0VAJcoP3wDMPDXSTWZ3GWthYbtikJtmIk72aJ2ITXe95H7MaWeH0pfQWv00hanYlf1huYVBExX042jfYOIf2ezrP_b1KA=@emersion.fr>
Date: Fri, 29 Jun 2018 17:25:38 -0400
From: Simon Ser <contact@...rsion.fr>
To: jpoimboe@...hat.com
Cc: emersion <contact@...rsion.fr>, linux-kernel@...r.kernel.org
Subject: [PATCH] objtool: use .strtab if .shstrtab is not present
Executables that are generated by Clang don't have a .shstrtab
section, and store section names in .strtab instead. We can store
section names generated by orc there in this case.
Signed-off-by: Simon Ser <contact@...rsion.fr>
---
tools/objtool/elf.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c
index 4e60e105583..6b9705d8b55 100644
--- a/tools/objtool/elf.c
+++ b/tools/objtool/elf.c
@@ -507,7 +507,10 @@ struct section *elf_create_section(struct elf *elf, const char *name,
/* Add section name to .shstrtab */
shstrtab = find_section_by_name(elf, ".shstrtab");
if (!shstrtab) {
- WARN("can't find .shstrtab section");
+ shstrtab = find_section_by_name(elf, ".strtab");
+ }
+ if (!shstrtab) {
+ WARN("can't find .shstrtab or .strtab section");
return NULL;
}
--
2.18.0
Powered by blists - more mailing lists