mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH][GIT PULL][v2.6.35] tracing: Properly align linker defined symbols
@ 2010-07-20 23:19 Steven Rostedt
  2010-07-22 10:03 ` Ingo Molnar
  0 siblings, 1 reply; 2+ messages in thread
From: Steven Rostedt @ 2010-07-20 23:19 UTC (permalink / raw)
  To: LKML
  Cc: Ingo Molnar, Linus Torvalds, Andrew Morton, Sam Ravnborg,
	Zeev Tarantov, Frederic Weisbecker


Ingo,

Linus did like this patch better. My original patch seemed to fix the
problem, but this is probably a more robust fix.

Please pull the latest tip/perf/urgent tree, which can be found at:

  git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
tip/perf/urgent


Sam Ravnborg (1):
      tracing: Properly align linker defined symbols

----
 include/asm-generic/vmlinux.lds.h |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---------------------------
commit 07fca0e57fca925032526349f4370f97ed580cc9
Author: Sam Ravnborg <sam@ravnborg.org>
Date:   Sat Jul 10 08:35:00 2010 +0200

    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: Zeev Tarantov <zeev.tarantov@gmail.com>
    Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
    LKML-Reference: <20100710063459.GA14596@merkur.ravnborg.org>
    Cc: Frederic Weisbecker <fweisbec@gmail.com>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 48c5299..4b5902a 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -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()
 
 /*



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH][GIT PULL][v2.6.35] tracing: Properly align linker defined symbols
  2010-07-20 23:19 [PATCH][GIT PULL][v2.6.35] tracing: Properly align linker defined symbols Steven Rostedt
@ 2010-07-22 10:03 ` Ingo Molnar
  0 siblings, 0 replies; 2+ messages in thread
From: Ingo Molnar @ 2010-07-22 10:03 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: LKML, Linus Torvalds, Andrew Morton, Sam Ravnborg, Zeev Tarantov,
	Frederic Weisbecker


* Steven Rostedt <rostedt@goodmis.org> wrote:

> 
> Ingo,
> 
> Linus did like this patch better. My original patch seemed to fix the
> problem, but this is probably a more robust fix.
> 
> Please pull the latest tip/perf/urgent tree, which can be found at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
> tip/perf/urgent
> 
> 
> Sam Ravnborg (1):
>       tracing: Properly align linker defined symbols
> 
> ----
>  include/asm-generic/vmlinux.lds.h |   10 ++++++++++
>  1 files changed, 10 insertions(+), 0 deletions(-)

Pulled, thanks Steve!

	Ingo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-07-22 10:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-20 23:19 [PATCH][GIT PULL][v2.6.35] tracing: Properly align linker defined symbols Steven Rostedt
2010-07-22 10:03 ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®