diff options
author | Steven Rostedt <srostedt@redhat.com> | 2008-11-14 19:21:19 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-11-16 01:36:42 -0500 |
commit | 20e5227e9f55ae1969934821ccbf581563785bbe (patch) | |
tree | cac23dc66e00c7667f5c0e7adc72a76bd1041816 | |
parent | 31e889098a80ceb3e9e3c555d522b2686a6663c6 (diff) |
ftrace: allow NULL pointers in mcount_loc
Impact: make ftrace_convert_nops() more permissive
Due to the way different architecture linkers combine the data sections
of the mcount_loc (the section that lists all the locations that
call mcount), there may be zeros added in that section. This is usually
due to strange alignments that the linker performs, that pads in zeros.
This patch makes the conversion code to nops skip any pointer in
the mcount_loc section that is NULL.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | kernel/trace/ftrace.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index e9a5fbfce08e..cc4219135dc9 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -1304,6 +1304,14 @@ static int ftrace_convert_nops(struct module *mod, | |||
1304 | p = start; | 1304 | p = start; |
1305 | while (p < end) { | 1305 | while (p < end) { |
1306 | addr = ftrace_call_adjust(*p++); | 1306 | addr = ftrace_call_adjust(*p++); |
1307 | /* | ||
1308 | * Some architecture linkers will pad between | ||
1309 | * the different mcount_loc sections of different | ||
1310 | * object files to satisfy alignments. | ||
1311 | * Skip any NULL pointers. | ||
1312 | */ | ||
1313 | if (!addr) | ||
1314 | continue; | ||
1307 | ftrace_record_ip(addr); | 1315 | ftrace_record_ip(addr); |
1308 | } | 1316 | } |
1309 | 1317 | ||