From patchwork Fri Feb 21 04:28:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Behan Webster X-Patchwork-Id: 25096 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f69.google.com (mail-pa0-f69.google.com [209.85.220.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 03BC6203BE for ; Fri, 21 Feb 2014 04:30:30 +0000 (UTC) Received: by mail-pa0-f69.google.com with SMTP id fa1sf7603356pad.0 for ; Thu, 20 Feb 2014 20:30:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :mime-version:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe:content-type :content-transfer-encoding; bh=rEwHKsWHYWtFA1BVp92xVbD7s2B5zogCwu552K4pZvs=; b=BRV0m4bYDGL/emqS3jHykMSoPwVKGNQ1wv/GaH6iYg947VIaKm/QxvVtGTtS3FI2fN JnM51JAPANevd5FPMKMGEFwiQTaXZt/tgOtuQcQTbbGKsXXhIWNEHrdb0sIyh3hbNrS0 pY9GGre75Ca8Es0EJWcdpg7LTbXd18i9Z3QFD6FyRRynH8hgnGitPoBEBGiZt/al1Zia +5rmH3lQXTBXxC7DqkpUSVvBIPZT7Lkh7V2q+d6eaEBF/b6qoPi5z2e5h61A0GhhuyPu 3XoE0Z06GoHrXRYEFSLqVgVJDpPkRvncEFrvJCXG+/iu80VtfZUtUndUxXj8MvslgHRR BRBw== X-Gm-Message-State: ALoCoQnE8B9SMV8FgY0jMBFODTVbtw5cw986l5kz7l4icnw+4YER5wj7/1AzAgVP2kjyLa5FzszB X-Received: by 10.66.66.196 with SMTP id h4mr2413676pat.22.1392957029990; Thu, 20 Feb 2014 20:30:29 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.37.135 with SMTP id r7ls831813qgr.25.gmail; Thu, 20 Feb 2014 20:30:29 -0800 (PST) X-Received: by 10.220.175.198 with SMTP id bb6mr3432019vcb.31.1392957029780; Thu, 20 Feb 2014 20:30:29 -0800 (PST) Received: from mail-ve0-x232.google.com (mail-ve0-x232.google.com [2607:f8b0:400c:c01::232]) by mx.google.com with ESMTPS id sq4si2511963vdc.28.2014.02.20.20.30.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Feb 2014 20:30:29 -0800 (PST) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::232 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::232; Received: by mail-ve0-f178.google.com with SMTP id oy12so2753598veb.23 for ; Thu, 20 Feb 2014 20:30:29 -0800 (PST) X-Received: by 10.52.246.227 with SMTP id xz3mr2864134vdc.95.1392957029592; Thu, 20 Feb 2014 20:30:29 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.174.196 with SMTP id u4csp4226vcz; Thu, 20 Feb 2014 20:30:29 -0800 (PST) X-Received: by 10.68.130.169 with SMTP id of9mr6594875pbb.79.1392957028562; Thu, 20 Feb 2014 20:30:28 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q5si5789647pbh.44.2014.02.20.20.30.27; Thu, 20 Feb 2014 20:30:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753344AbaBUEaU (ORCPT + 26 others); Thu, 20 Feb 2014 23:30:20 -0500 Received: from mail-pa0-f47.google.com ([209.85.220.47]:43295 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752468AbaBUEaR (ORCPT ); Thu, 20 Feb 2014 23:30:17 -0500 Received: by mail-pa0-f47.google.com with SMTP id kp14so2902870pab.6 for ; Thu, 20 Feb 2014 20:30:17 -0800 (PST) X-Received: by 10.67.5.233 with SMTP id cp9mr6425303pad.147.1392957017030; Thu, 20 Feb 2014 20:30:17 -0800 (PST) Received: from galdor.makerspace.ca ([204.239.216.30]) by mx.google.com with ESMTPSA id f5sm40052489pat.11.2014.02.20.20.30.14 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Feb 2014 20:30:15 -0800 (PST) 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, =?UTF-8?q?Jan-Simon=20M=C3=B6ller?= , Behan Webster Subject: [PATCH] module: LLVMLinux: Fix section mismatch issues on alias usage Date: Thu, 20 Feb 2014 20:28:29 -0800 Message-Id: <1392956909-22715-1-git-send-email-behanw@converseincode.com> X-Mailer: git-send-email 1.8.3.2 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Original-Sender: behanw@converseincode.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::232 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=neutral (bad format) header.i=@converseincode.com Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Jan-Simon Möller 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 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 Signed-off-by: Jan-Simon Möller Signed-off-by: Behan Webster --- 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 */