]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
objtool: Skip ORC entry creation for non-text sections
authorJulien Thierry <jthierry@redhat.com>
Tue, 25 Aug 2020 12:47:41 +0000 (13:47 +0100)
committerJosh Poimboeuf <jpoimboe@redhat.com>
Tue, 1 Sep 2020 22:19:11 +0000 (17:19 -0500)
Orc generation is only done for text sections, but some instructions
can be found in non-text sections (e.g. .discard.text sections).

Skip setting their orc sections since their whole sections will be
skipped for orc generation.

Reviewed-by: Miroslav Benes <mbenes@suse.cz>
Signed-off-by: Julien Thierry <jthierry@redhat.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
tools/objtool/orc_gen.c

index e6b2363c2e03b961ed09c4d4ac6d2486c7efe343..22fe4398197f2d31966cc9186ce147a94546bfbd 100644 (file)
@@ -18,6 +18,9 @@ int create_orc(struct objtool_file *file)
                struct cfi_reg *cfa = &insn->cfi.cfa;
                struct cfi_reg *bp = &insn->cfi.regs[CFI_BP];
 
+               if (!insn->sec->text)
+                       continue;
+
                orc->end = insn->cfi.end;
 
                if (cfa->base == CFI_UNDEFINED) {