lkml.org 
[lkml]   [2014]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [GIT PULL] x86 LTO changes for v3.15
From
Date
On Mon, 2014-03-31 at 14:05 -0700, H. Peter Anvin wrote:
> --- a/include/linux/init.h
> +++ b/include/linux/init.h
> @@ -163,6 +163,23 @@ extern bool initcall_debug;
>
> #ifndef __ASSEMBLY__
>
> +#ifdef CONFIG_LTO

I can't find a Kconfig symbol LTO nor a preprocessor define for
CONFIG_LTO. (I only checked master of Linus's tree and linux-next.)

Why is this check for CONFIG_LTO needed?

> +/* 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


Paul Bolle



\
 
 \ /
  Last update: 2014-04-02 00:01    [W:0.150 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site