lkml.org 
[lkml]   [2018]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
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@emersion.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

\
 
 \ /
  Last update: 2018-06-29 23:34    [W:0.117 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site