aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSam Ravnborg <sam@mars.(none)>2005-07-14 20:15:44 +0000
committerSam Ravnborg <sam@mars.(none)>2005-07-14 20:15:44 +0000
commit6d30e3a8995c9fa9e8471bb1dff8e070638df5ea (patch)
treec93562d7c66856108e7dfe43e1e85304cebb5d91 /include
parent53e88e03e63621a15ec7fbccaaaca1a0f1616ed4 (diff)
kbuild: Avoid inconsistent kallsyms data
Several reports on inconsistent kallsyms data has been caused by the aliased symbols __sched_text_start and __down to shift places in the output of nm. The root cause was that on second pass ld aligned __sched_text_start to a 4 byte boundary which is the function alignment on i386. sched.text and spinlock.text is now aligned to an 8 byte boundary to make sure they are aligned to a function alignemnt on most (all?) archs. Tested by: Paulo Marques <pmarques@grupopie.com> Tested by: Alexander Stohr <Alexander.Stohr@gmx.de> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/vmlinux.lds.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index b3bb326ae5b..3fa94288aa9 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -6,6 +6,9 @@
#define VMLINUX_SYMBOL(_sym_) _sym_
#endif
+/* Align . to a 8 byte boundary equals to maximum function alignment. */
+#define ALIGN_FUNCTION() . = ALIGN(8)
+
#define RODATA \
.rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \
*(.rodata) *(.rodata.*) \
@@ -79,12 +82,18 @@
VMLINUX_SYMBOL(__security_initcall_end) = .; \
}
+/* sched.text is aling to function alignment to secure we have same
+ * address even at second ld pass when generating System.map */
#define SCHED_TEXT \
+ ALIGN_FUNCTION(); \
VMLINUX_SYMBOL(__sched_text_start) = .; \
*(.sched.text) \
VMLINUX_SYMBOL(__sched_text_end) = .;
+/* spinlock.text is aling to function alignment to secure we have same
+ * address even at second ld pass when generating System.map */
#define LOCK_TEXT \
+ ALIGN_FUNCTION(); \
VMLINUX_SYMBOL(__lock_text_start) = .; \
*(.spinlock.text) \
VMLINUX_SYMBOL(__lock_text_end) = .;