diff options
author | Josh Poimboeuf <jpoimboe@redhat.com> | 2016-06-15 16:45:58 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-07-10 11:15:58 -0400 |
commit | 0ea5ad869c85ac604f3e022bf2c5bef54838433b (patch) | |
tree | 6e1f6f929a032dfec45fab1f6c320a236899bf50 /tools | |
parent | ee40fb2948fc99096836995d4f3ddcc0efbac790 (diff) |
objtool: Fix STACK_FRAME_NON_STANDARD macro checking for function symbols
Mathieu Desnoyers reported that the STACK_FRAME_NON_STANDARD macro
wasn't working with the lttng_filter_interpret_bytecode() function in
the lttng-modules code.
Usually the relocation created by STACK_FRAME_NON_STANDARD creates a
reference to a section symbol like this:
Offset Type Value Addend Name
000000000000000000 X86_64_64 000000000000000000 +3136 .text
But in this case it created a reference to a function symbol:
Offset Type Value Addend Name
000000000000000000 X86_64_64 0x00000000000003a0 +0 lttng_filter_interpret_bytecode
To be honest I have no idea what causes gcc to decide to do one over the
other. But both are valid ELF, so add support for the function symbol.
Reported-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
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>
Cc: lttng-dev@lists.lttng.org
Link: http://lkml.kernel.org/r/9cee42843bc6d94e990a152e4e0319cfdf6756ef.1466023450.git.jpoimboe@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/objtool/builtin-check.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/objtool/builtin-check.c b/tools/objtool/builtin-check.c index e8a1e69eb92c..25d803148f5c 100644 --- a/tools/objtool/builtin-check.c +++ b/tools/objtool/builtin-check.c | |||
@@ -122,10 +122,14 @@ static bool ignore_func(struct objtool_file *file, struct symbol *func) | |||
122 | 122 | ||
123 | /* check for STACK_FRAME_NON_STANDARD */ | 123 | /* check for STACK_FRAME_NON_STANDARD */ |
124 | if (file->whitelist && file->whitelist->rela) | 124 | if (file->whitelist && file->whitelist->rela) |
125 | list_for_each_entry(rela, &file->whitelist->rela->rela_list, list) | 125 | list_for_each_entry(rela, &file->whitelist->rela->rela_list, list) { |
126 | if (rela->sym->sec == func->sec && | 126 | if (rela->sym->type == STT_SECTION && |
127 | rela->sym->sec == func->sec && | ||
127 | rela->addend == func->offset) | 128 | rela->addend == func->offset) |
128 | return true; | 129 | return true; |
130 | if (rela->sym->type == STT_FUNC && rela->sym == func) | ||
131 | return true; | ||
132 | } | ||
129 | 133 | ||
130 | /* check if it has a context switching instruction */ | 134 | /* check if it has a context switching instruction */ |
131 | func_for_each_insn(file, func, insn) | 135 | func_for_each_insn(file, func, insn) |