Commit 4d439517 authored by David S. Miller's avatar David S. Miller Committed by Arnaldo Carvalho de Melo

perf symbols: Properly align symbol_conf.priv_size

If symbol_conf.priv_size is not a multiple of "sizeof(u64)" we'll bus
error on sparc64 in symbol__new because the "struct symbol *" pointer
is computed by adding symbol_conf.priv_size to the memory allocated.

We cannot isolate the fix to symbol__new and symbol__delete since the
private area is computed by subtracting the priv_size value from a
"struct symbol" pointer, so then the private area can still be
potentially unaligned.

So, simply align the symbol_conf.priv_size value in symbol__init()

Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20110328.175849.112593455.davem@davemloft.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 1dfd7b49
...@@ -2406,6 +2406,8 @@ int symbol__init(void) ...@@ -2406,6 +2406,8 @@ int symbol__init(void)
if (symbol_conf.initialized) if (symbol_conf.initialized)
return 0; return 0;
symbol_conf.priv_size = ALIGN(symbol_conf.priv_size, sizeof(u64));
elf_version(EV_CURRENT); elf_version(EV_CURRENT);
if (symbol_conf.sort_by_name) if (symbol_conf.sort_by_name)
symbol_conf.priv_size += (sizeof(struct symbol_name_rb_node) - symbol_conf.priv_size += (sizeof(struct symbol_name_rb_node) -
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment