objtool: Skip ORC entry creation for non-text sections

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>
This commit is contained in:
Julien Thierry 2020-08-25 13:47:41 +01:00 коммит произвёл Josh Poimboeuf
Родитель d44becb9de
Коммит 3eaecac88a
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

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