public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Bolle <pebolle@tiscali.nl>
To: "H. Peter Anvin" <hpa@linux.intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	ak@linux.intel.com, gleb@redhat.com, hpa@zytor.com,
	hubicka@ucw.cz, linux-kernel@vger.kernel.org, mingo@kernel.org,
	pbonzini@redhat.com, perex@perex.cz, peterz@infradead.org,
	rostedt@goodmis.org, rusty@rustcorp.com.au, tglx@linutronix.de
Subject: Re: [GIT PULL] x86 LTO changes for v3.15
Date: Tue, 01 Apr 2014 22:49:51 +0200	[thread overview]
Message-ID: <1396385391.23763.30.camel@x220> (raw)
In-Reply-To: <201403312105.s2VL5AqX010173@terminus.zytor.com>

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


  parent reply	other threads:[~2014-04-01 20:49 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-31 21:05 [GIT PULL] x86 LTO changes for v3.15 H. Peter Anvin
2014-03-31 21:54 ` Linus Torvalds
2014-03-31 23:03   ` Andi Kleen
2014-04-01  0:17     ` Linus Torvalds
2014-04-01  0:33       ` Linus Torvalds
2014-04-01 18:54         ` H. Peter Anvin
2014-04-01 19:15           ` Linus Torvalds
2014-04-01 19:43             ` H. Peter Anvin
2014-04-02  0:01           ` Steven Rostedt
2014-04-02  0:35             ` Linus Torvalds
2014-04-02 12:33               ` Steven Rostedt
2014-04-02 17:10                 ` H. Peter Anvin
2014-04-02 17:59                   ` Steven Rostedt
2014-04-01  1:09       ` Andi Kleen
2014-04-01  1:35         ` H. Peter Anvin
2014-04-01  2:26         ` Linus Torvalds
2014-04-01 20:49 ` Paul Bolle [this message]
2014-04-01 23:17   ` Andi Kleen
2014-04-02  8:29     ` Paul Bolle
2014-04-16  8:53 ` Viresh Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1396385391.23763.30.camel@x220 \
    --to=pebolle@tiscali.nl \
    --cc=ak@linux.intel.com \
    --cc=gleb@redhat.com \
    --cc=hpa@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=hubicka@ucw.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=perex@perex.cz \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=rusty@rustcorp.com.au \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox