aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-03-31 17:13:25 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-03-31 17:13:25 -0400
commit176ab02d4916f09d5d8cb63372d142df4378cdea (patch)
tree7039b1282e7b34341789a5416fbd7ca5da0e557a /include
parente06df6a7eae1ab1ef4deb076aeeaed90e948e5c0 (diff)
parentef178f9238b142cc1020265e176b20d27fd02ba9 (diff)
Merge branch 'x86-asmlinkage-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 LTO changes from Peter Anvin: "More infrastructure work in preparation for link-time optimization (LTO). Most of these changes is to make sure symbols accessed from assembly code are properly marked as visible so the linker doesn't remove them. My understanding is that the changes to support LTO are still not upstream in binutils, but are on the way there. This patchset should conclude the x86-specific changes, and remaining patches to actually enable LTO will be fed through the Kbuild tree (other than keeping up with changes to the x86 code base, of course), although not necessarily in this merge window" * 'x86-asmlinkage-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (25 commits) Kbuild, lto: Handle basic LTO in modpost Kbuild, lto: Disable LTO for asm-offsets.c Kbuild, lto: Add a gcc-ld script to let run gcc as ld Kbuild, lto: add ld-version and ld-ifversion macros Kbuild, lto: Drop .number postfixes in modpost Kbuild, lto, workaround: Don't warn for initcall_reference in modpost lto: Disable LTO for sys_ni lto: Handle LTO common symbols in module loader lto, workaround: Add workaround for initcall reordering lto: Make asmlinkage __visible x86, lto: Disable LTO for the x86 VDSO initconst, x86: Fix initconst mistake in ts5500 code initconst: Fix initconst mistake in dcdbas asmlinkage: Make trace_hardirqs_on/off_caller visible asmlinkage, x86: Fix 32bit memcpy for LTO asmlinkage Make __stack_chk_failed and memcmp visible asmlinkage: Mark rwsem functions that can be called from assembler asmlinkage asmlinkage: Make main_extable_sort_needed visible asmlinkage, mutex: Mark __visible asmlinkage: Make trace_hardirq visible ...
Diffstat (limited to 'include')
-rw-r--r--include/linux/init.h20
-rw-r--r--include/linux/io.h2
-rw-r--r--include/linux/linkage.h4
-rw-r--r--include/linux/lockdep.h2
4 files changed, 23 insertions, 5 deletions
diff --git a/include/linux/init.h b/include/linux/init.h
index e1688802964f..a3ba27076342 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -163,6 +163,23 @@ extern bool initcall_debug;
163 163
164#ifndef __ASSEMBLY__ 164#ifndef __ASSEMBLY__
165 165
166#ifdef CONFIG_LTO
167/* Work around a LTO gcc problem: when there is no reference to a variable
168 * in a module it will be moved to the end of the program. This causes
169 * reordering of initcalls which the kernel does not like.
170 * Add a dummy reference function to avoid this. The function is
171 * deleted by the linker.
172 */
173#define LTO_REFERENCE_INITCALL(x) \
174 ; /* yes this is needed */ \
175 static __used __exit void *reference_##x(void) \
176 { \
177 return &x; \
178 }
179#else
180#define LTO_REFERENCE_INITCALL(x)
181#endif
182
166/* initcalls are now grouped by functionality into separate 183/* initcalls are now grouped by functionality into separate
167 * subsections. Ordering inside the subsections is determined 184 * subsections. Ordering inside the subsections is determined
168 * by link order. 185 * by link order.
@@ -175,7 +192,8 @@ extern bool initcall_debug;
175 192
176#define __define_initcall(fn, id) \ 193#define __define_initcall(fn, id) \
177 static initcall_t __initcall_##fn##id __used \ 194 static initcall_t __initcall_##fn##id __used \
178 __attribute__((__section__(".initcall" #id ".init"))) = fn 195 __attribute__((__section__(".initcall" #id ".init"))) = fn; \
196 LTO_REFERENCE_INITCALL(__initcall_##fn##id)
179 197
180/* 198/*
181 * Early initcalls run before initializing SMP. 199 * Early initcalls run before initializing SMP.
diff --git a/include/linux/io.h b/include/linux/io.h
index f4f42faec686..8a18e75600cc 100644
--- a/include/linux/io.h
+++ b/include/linux/io.h
@@ -24,7 +24,7 @@
24 24
25struct device; 25struct device;
26 26
27void __iowrite32_copy(void __iomem *to, const void *from, size_t count); 27__visible void __iowrite32_copy(void __iomem *to, const void *from, size_t count);
28void __iowrite64_copy(void __iomem *to, const void *from, size_t count); 28void __iowrite64_copy(void __iomem *to, const void *from, size_t count);
29 29
30#ifdef CONFIG_MMU 30#ifdef CONFIG_MMU
diff --git a/include/linux/linkage.h b/include/linux/linkage.h
index a6a42dd02466..34a513a2727b 100644
--- a/include/linux/linkage.h
+++ b/include/linux/linkage.h
@@ -12,9 +12,9 @@
12#endif 12#endif
13 13
14#ifdef __cplusplus 14#ifdef __cplusplus
15#define CPP_ASMLINKAGE extern "C" 15#define CPP_ASMLINKAGE extern "C" __visible
16#else 16#else
17#define CPP_ASMLINKAGE 17#define CPP_ASMLINKAGE __visible
18#endif 18#endif
19 19
20#ifndef asmlinkage 20#ifndef asmlinkage
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
index 060e5137fd80..008388f920d7 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
@@ -265,7 +265,7 @@ extern void lockdep_info(void);
265extern void lockdep_reset(void); 265extern void lockdep_reset(void);
266extern void lockdep_reset_lock(struct lockdep_map *lock); 266extern void lockdep_reset_lock(struct lockdep_map *lock);
267extern void lockdep_free_key_range(void *start, unsigned long size); 267extern void lockdep_free_key_range(void *start, unsigned long size);
268extern void lockdep_sys_exit(void); 268extern asmlinkage void lockdep_sys_exit(void);
269 269
270extern void lockdep_off(void); 270extern void lockdep_off(void);
271extern void lockdep_on(void); 271extern void lockdep_on(void);