mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: behanw@converseincode.com
To: rob@landley.net, paul.gortmaker@windriver.com,
	rdunlap@infradead.org, geert@linux-m68k.org
Cc: akpm@linux-foundation.org, gregkh@linuxfoundation.org,
	linux-kernel@vger.kernel.org, "Jan-Simon Möller" <dl9pf@gmx.de>,
	"Behan Webster" <behanw@converseincode.com>
Subject: [PATCH] module: LLVMLinux: Fix section mismatch issues on alias usage
Date: Thu, 20 Feb 2014 20:28:29 -0800	[thread overview]
Message-ID: <1392956909-22715-1-git-send-email-behanw@converseincode.com> (raw)

From: Jan-Simon Möller <dl9pf@gmx.de>

Attribute aliases don't inherit the link section name when compiled with clang.
As a result, the linking section needs to be explicitly specified when building
a module. This behavior is undefined in the standard which is why it differs from
compiler to compiler.

Author:  PaX Team <pageexec@freemail.hu>
ML-Post: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20120507/142707.html
URL:     http://llvm.linuxfoundation.org
Merge:   Jan-Simon Möller <dl9pf@gmx.de>
Signed-off-by: Jan-Simon Möller <dl9pf@gmx.de>
Signed-off-by: Behan Webster <behanw@converseincode.com>
---
 include/linux/init.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/linux/init.h b/include/linux/init.h
index e168880..384ec5e 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -297,13 +297,14 @@ void __init parse_early_options(char *cmdline);
 #define module_init(initfn)					\
 	static inline initcall_t __inittest(void)		\
 	{ return initfn; }					\
-	int init_module(void) __attribute__((alias(#initfn)));
+	int init_module(void) __section(.init) __attribute__((alias(#initfn)));
 
 /* This is only required if you want to be unloadable. */
 #define module_exit(exitfn)					\
 	static inline exitcall_t __exittest(void)		\
 	{ return exitfn; }					\
-	void cleanup_module(void) __attribute__((alias(#exitfn)));
+	void cleanup_module(void) __section(.exit)              \
+		__attribute__((alias(#exitfn)));
 
 #define __setup_param(str, unique_id, fn)	/* nothing */
 #define __setup(str, func) 			/* nothing */
-- 
1.8.3.2


             reply	other threads:[~2014-02-21  4:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-21  4:28 behanw [this message]
2014-02-21 15:08 ` Paul Gortmaker
2014-02-25  2:33   ` Behan Webster

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=1392956909-22715-1-git-send-email-behanw@converseincode.com \
    --to=behanw@converseincode.com \
    --cc=akpm@linux-foundation.org \
    --cc=dl9pf@gmx.de \
    --cc=geert@linux-m68k.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paul.gortmaker@windriver.com \
    --cc=rdunlap@infradead.org \
    --cc=rob@landley.net \
    /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

all inboxes | Powered by JetHome®