Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1438698
| From | "Luis R. Rodriguez" <mcgrof@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v2] x86: remove LTO_REFERENCE_INITCALL() |
| Date | 2016-07-07 18:10 +0200 |
| Message-ID | <rSk2d-Ok-5@gated-at.bofh.it> (permalink) |
| References | <rS6LD-dY-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
The setup for LTO never made it upstream, and although this has
some users, this is now really old stuff for a gcc 4.7 LTO problem.
We know that at least LTO_REFERENCE_INITCALL() work around can
be removed if LTO is not supported on v4.7 anymore.
As per Andi the DISABLE_LTO and LTO_CFLAGS are still neeeded though.
Tested-by: 0-day
Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
---
include/linux/init.h | 20 +-------------------
1 file changed, 1 insertion(+), 19 deletions(-)
diff --git a/include/linux/init.h b/include/linux/init.h
index 1e5c131d5c9a..aa662ad80d9c 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -151,23 +151,6 @@ extern bool initcall_debug;
#ifndef __ASSEMBLY__
-#ifdef CONFIG_LTO
-/* Work around a LTO gcc problem: when there is no reference to a variable
- * in a module it will be moved to the end of the program. This causes
- * reordering of initcalls which the kernel does not like.
- * Add a dummy reference function to avoid this. The function is
- * deleted by the linker.
- */
-#define LTO_REFERENCE_INITCALL(x) \
- ; /* yes this is needed */ \
- static __used __exit void *reference_##x(void) \
- { \
- return &x; \
- }
-#else
-#define LTO_REFERENCE_INITCALL(x)
-#endif
-
/* initcalls are now grouped by functionality into separate
* subsections. Ordering inside the subsections is determined
* by link order.
@@ -180,8 +163,7 @@ extern bool initcall_debug;
#define __define_initcall(fn, id) \
static initcall_t __initcall_##fn##id __used \
- __attribute__((__section__(".initcall" #id ".init"))) = fn; \
- LTO_REFERENCE_INITCALL(__initcall_##fn##id)
+ __attribute__((__section__(".initcall" #id ".init"))) = fn;
/*
* Early initcalls run before initializing SMP.
--
2.8.4
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Is LTO_REFERENCE_INITCALL() still needed? "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-06-24 01:40 +0200
Re: Is LTO_REFERENCE_INITCALL() still needed? Andi Kleen <andi@firstfloor.org> - 2016-06-24 23:10 +0200
Re: Is LTO_REFERENCE_INITCALL() still needed? "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-06-28 02:50 +0200
[PATCH] x86: remove LTO flags "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-07-07 02:30 +0200
Re: [PATCH] x86: remove LTO flags Andi Kleen <andi@firstfloor.org> - 2016-07-07 04:00 +0200
[PATCH v2] x86: remove LTO_REFERENCE_INITCALL() "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-07-07 18:10 +0200
Re: [PATCH v2] x86: remove LTO_REFERENCE_INITCALL() Andi Kleen <andi@firstfloor.org> - 2016-07-07 18:40 +0200
csiph-web