提交 07fca0e5 编写于 作者: S Sam Ravnborg 提交者: Steven Rostedt

tracing: Properly align linker defined symbols

We define a number of symbols in the linker scipt like this:

    __start_syscalls_metadata = .;
    *(__syscalls_metadata)

But we do not know the alignment of "." when we assign
the __start_syscalls_metadata symbol.
gcc started to uses bigger alignment for structs (32 bytes),
so we saw situations where the linker due to alignment
constraints increased the value of "." after the symbol assignment.

This resulted in boot fails.

Fix this by forcing a 32 byte alignment of "." before the
assignment.

This patch introduces the forced alignment for
ftrace_events and syscalls_metadata.
It may be required in more places.
Reported-by: NZeev Tarantov <zeev.tarantov@gmail.com>
Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
LKML-Reference: <20100710063459.GA14596@merkur.ravnborg.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
上级 74534341
......@@ -63,6 +63,12 @@
/* Align . to a 8 byte boundary equals to maximum function alignment. */
#define ALIGN_FUNCTION() . = ALIGN(8)
/*
* Align to a 32 byte boundary equal to the
* alignment gcc 4.5 uses for a struct
*/
#define STRUCT_ALIGN() . = ALIGN(32)
/* The actual configuration determine if the init/exit sections
* are handled as text/data or they can be discarded (which
* often happens at runtime)
......@@ -166,7 +172,11 @@
LIKELY_PROFILE() \
BRANCH_PROFILE() \
TRACE_PRINTKS() \
\
STRUCT_ALIGN(); \
FTRACE_EVENTS() \
\
STRUCT_ALIGN(); \
TRACE_SYSCALLS()
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册