* [PATCH] objtool: fix STACK_FRAME_NON_STANDARD macro checking for function symbols
@ 2016-06-15 20:45 Josh Poimboeuf
2016-07-10 18:16 ` [tip:core/urgent] objtool: Fix " tip-bot for Josh Poimboeuf
0 siblings, 1 reply; 2+ messages in thread
From: Josh Poimboeuf @ 2016-06-15 20:45 UTC (permalink / raw)
To: Ingo Molnar; +Cc: linux-kernel, Mathieu Desnoyers, lttng-dev
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>
---
tools/objtool/builtin-check.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/tools/objtool/builtin-check.c b/tools/objtool/builtin-check.c
index e8a1e69..25d8031 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)
/* check for STACK_FRAME_NON_STANDARD */
if (file->whitelist && file->whitelist->rela)
- list_for_each_entry(rela, &file->whitelist->rela->rela_list, list)
- if (rela->sym->sec == func->sec &&
+ list_for_each_entry(rela, &file->whitelist->rela->rela_list, list) {
+ if (rela->sym->type == STT_SECTION &&
+ rela->sym->sec == func->sec &&
rela->addend == func->offset)
return true;
+ if (rela->sym->type == STT_FUNC && rela->sym == func)
+ return true;
+ }
/* check if it has a context switching instruction */
func_for_each_insn(file, func, insn)
--
2.4.11
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [tip:core/urgent] objtool: Fix STACK_FRAME_NON_STANDARD macro checking for function symbols
2016-06-15 20:45 [PATCH] objtool: fix STACK_FRAME_NON_STANDARD macro checking for function symbols Josh Poimboeuf
@ 2016-07-10 18:16 ` tip-bot for Josh Poimboeuf
0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Josh Poimboeuf @ 2016-07-10 18:16 UTC (permalink / raw)
To: linux-tip-commits
Cc: mathieu.desnoyers, jpoimboe, peterz, mingo, linux-kernel, hpa,
torvalds, tglx
Commit-ID: 0ea5ad869c85ac604f3e022bf2c5bef54838433b
Gitweb: http://git.kernel.org/tip/0ea5ad869c85ac604f3e022bf2c5bef54838433b
Author: Josh Poimboeuf <jpoimboe@redhat.com>
AuthorDate: Wed, 15 Jun 2016 15:45:58 -0500
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Sun, 10 Jul 2016 17:15:58 +0200
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>
---
tools/objtool/builtin-check.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/tools/objtool/builtin-check.c b/tools/objtool/builtin-check.c
index e8a1e69..25d8031 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)
/* check for STACK_FRAME_NON_STANDARD */
if (file->whitelist && file->whitelist->rela)
- list_for_each_entry(rela, &file->whitelist->rela->rela_list, list)
- if (rela->sym->sec == func->sec &&
+ list_for_each_entry(rela, &file->whitelist->rela->rela_list, list) {
+ if (rela->sym->type == STT_SECTION &&
+ rela->sym->sec == func->sec &&
rela->addend == func->offset)
return true;
+ if (rela->sym->type == STT_FUNC && rela->sym == func)
+ return true;
+ }
/* check if it has a context switching instruction */
func_for_each_insn(file, func, insn)
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-07-10 18:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-15 20:45 [PATCH] objtool: fix STACK_FRAME_NON_STANDARD macro checking for function symbols Josh Poimboeuf
2016-07-10 18:16 ` [tip:core/urgent] objtool: Fix " tip-bot for Josh Poimboeuf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).