Re: [PATCH 14/20] objtool: Rewrite add_ignores()

From: Josh Poimboeuf
Date: Fri Mar 08 2019 - 14:29:54 EST


On Thu, Mar 07, 2019 at 12:45:25PM +0100, Peter Zijlstra wrote:
> @@ -436,18 +413,31 @@ static void add_ignores(struct objtool_f
> struct instruction *insn;
> struct section *sec;
> struct symbol *func;
> + struct rela *rela;
>
> - for_each_sec(file, sec) {
> - list_for_each_entry(func, &sec->symbol_list, list) {
> - if (func->type != STT_FUNC)
> - continue;
> + sec = find_section_by_name(file->elf, ".rela.discard.func_stack_frame_non_standard");
> + if (!sec)
> + return;
>
> - if (!ignore_func(file, func))
> + list_for_each_entry(rela, &sec->rela_list, list) {
> + switch (rela->sym->type) {
> + case STT_FUNC:
> + func = rela->sym;
> + break;
> +
> + case STT_SECTION:
> + func = find_symbol_by_offset(rela->sym->sec, rela->addend);
> + if (!func || func->type != STT_FUNC)
> continue;
> + break;
>
> - func_for_each_insn_all(file, func, insn)
> - insn->ignore = true;
> + default:
> + WARN("unexpected relation symbol type in %s: %d", sec->name, rela->sym->type);
> + continue;

s/relation/relocation

--
Josh