Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6d77d3b4 authored by Simon Ser's avatar Simon Ser Committed by Ingo Molnar
Browse files

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: default avatarSimon Ser <contact@emersion.fr>
Signed-off-by: default avatarJosh 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: default avatarIngo Molnar <mingo@kernel.org>
parent 2db39a2f
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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;
	}