* [PATCH] objtool: Use '.strtab' if '.shstrtab' doesn't exist
@ 2018-07-09 16:17 Josh Poimboeuf
2018-07-14 13:03 ` [tip:core/urgent] objtool: Use '.strtab' if '.shstrtab' doesn't exist, to support ORC tables on Clang tip-bot for Simon Ser
0 siblings, 1 reply; 2+ messages in thread
From: Josh Poimboeuf @ 2018-07-09 16:17 UTC (permalink / raw)
To: x86; +Cc: linux-kernel, Simon Ser
From: Simon Ser <contact@emersion.fr>
Clang puts its section header names in the '.strtab' section instead of
'.shstrtab', which causes objtool to fail with a "can't find
.shstrtab section" warning when attempting to write ORC metadata to an
object file.
If '.shstrtab' doesn't exist, use '.strtab' instead.
Signed-off-by: Simon Ser <contact@emersion.fr>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
---
tools/objtool/elf.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c
index 0d1acb704f64..7ec85d567598 100644
--- a/tools/objtool/elf.c
+++ b/tools/objtool/elf.c
@@ -519,10 +519,12 @@ struct section *elf_create_section(struct elf *elf, const char *name,
sec->sh.sh_flags = SHF_ALLOC;
- /* Add section name to .shstrtab */
+ /* Add section name to .shstrtab (or .strtab for Clang) */
shstrtab = find_section_by_name(elf, ".shstrtab");
+ if (!shstrtab)
+ shstrtab = find_section_by_name(elf, ".strtab");
if (!shstrtab) {
- WARN("can't find .shstrtab section");
+ WARN("can't find .shstrtab or .strtab section");
return NULL;
}
--
2.17.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* [tip:core/urgent] objtool: Use '.strtab' if '.shstrtab' doesn't exist, to support ORC tables on Clang
2018-07-09 16:17 [PATCH] objtool: Use '.strtab' if '.shstrtab' doesn't exist Josh Poimboeuf
@ 2018-07-14 13:03 ` tip-bot for Simon Ser
0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Simon Ser @ 2018-07-14 13:03 UTC (permalink / raw)
To: linux-tip-commits
Cc: mingo, peterz, linux-kernel, torvalds, tglx, hpa, jpoimboe, contact
Commit-ID: 6d77d3b43ad84a48b502f02dc618e7c36737bdfe
Gitweb: https://git.kernel.org/tip/6d77d3b43ad84a48b502f02dc618e7c36737bdfe
Author: Simon Ser <contact@emersion.fr>
AuthorDate: Mon, 9 Jul 2018 11:17:22 -0500
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Sat, 14 Jul 2018 14:59:42 +0200
objtool: Use '.strtab' if '.shstrtab' doesn't exist, to support ORC tables on Clang
Clang puts its section header names in the '.strtab' section instead of
'.shstrtab', which causes objtool to fail with a "can't find
.shstrtab section" warning when attempting to write ORC metadata to an
object file.
If '.shstrtab' doesn't exist, use '.strtab' instead.
Signed-off-by: Simon Ser <contact@emersion.fr>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/d1c1c3fe55872be433da7bc5e1860538506229ba.1531153015.git.jpoimboe@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
tools/objtool/elf.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c
index 0d1acb704f64..7ec85d567598 100644
--- a/tools/objtool/elf.c
+++ b/tools/objtool/elf.c
@@ -519,10 +519,12 @@ struct section *elf_create_section(struct elf *elf, const char *name,
sec->sh.sh_flags = SHF_ALLOC;
- /* Add section name to .shstrtab */
+ /* Add section name to .shstrtab (or .strtab for Clang) */
shstrtab = find_section_by_name(elf, ".shstrtab");
+ if (!shstrtab)
+ shstrtab = find_section_by_name(elf, ".strtab");
if (!shstrtab) {
- WARN("can't find .shstrtab section");
+ WARN("can't find .shstrtab or .strtab section");
return NULL;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-07-14 13:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-09 16:17 [PATCH] objtool: Use '.strtab' if '.shstrtab' doesn't exist Josh Poimboeuf
2018-07-14 13:03 ` [tip:core/urgent] objtool: Use '.strtab' if '.shstrtab' doesn't exist, to support ORC tables on Clang tip-bot for Simon Ser
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome