From patchwork Tue Feb 14 01:12:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 141024 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from merlin.infradead.org (unknown [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E25471007D2 for ; Tue, 14 Feb 2012 12:14:39 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Rx6wr-0008I4-Lc; Tue, 14 Feb 2012 01:12:49 +0000 Received: from mho-01-ewr.mailhop.org ([204.13.248.71]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Rx6wn-0008HC-Am for linux-arm-kernel@lists.infradead.org; Tue, 14 Feb 2012 01:12:46 +0000 Received: from c-98-234-237-12.hsd1.ca.comcast.net ([98.234.237.12] helo=localhost.localdomain) by mho-01-ewr.mailhop.org with esmtpa (Exim 4.72) (envelope-from ) id 1Rx6wb-0006j0-Aw; Tue, 14 Feb 2012 01:12:33 +0000 Received: from Mutt by mutt-smtp-wrapper.pl 1.2 (www.zdo.com/articles/mutt-smtp-wrapper.shtml) X-Mail-Handler: MailHop Outbound by DynDNS X-Originating-IP: 98.234.237.12 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/mailhop/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX19+PQo/dKYzGNRUoIoapRLK Date: Mon, 13 Feb 2012 17:12:28 -0800 From: Tony Lindgren To: Rusty Russell Subject: Re: [PATCH] modpost: Fix section warnings for ARM for many compilers Message-ID: <20120214011228.GM1426@atomide.com> References: <20120213212401.GH1426@atomide.com> <20120213222652.GL14173@pengutronix.de> <20120213225118.GC31482@n2100.arm.linux.org.uk> <878vk6cl5z.fsf@rustcorp.com.au> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <878vk6cl5z.fsf@rustcorp.com.au> User-Agent: Mutt/1.5.20 (2009-06-14) X-Spam-Note: CRM114 invocation failed X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [204.13.248.71 listed in list.dnswl.org] 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Russell King - ARM Linux , Anders Kaseorg , Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= , linux-kernel@vger.kernel.org, Greg KH , linux-omap@vger.kernel.org, Ben Hutchings , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org * Rusty Russell [120213 16:07]: > On Mon, 13 Feb 2012 22:51:18 +0000, Russell King - ARM Linux wrote: > > On Mon, Feb 13, 2012 at 11:26:52PM +0100, Uwe Kleine-König wrote: > > > On Mon, Feb 13, 2012 at 01:24:01PM -0800, Tony Lindgren wrote: > > > Maybe: > > > > > > #ifndef R_ARM_CALL > > > #warning "you're elf.h include is outdated" > > > > "You are elf.h include is outdated" does not make sense. > > > > Why are you calling Tony an elf.h include? > > Because he knew it would attract the attention of pedants to the patch? > :) I've been called worse than that :) > Just do the #ifndef, and skip the warning. There's not much the poor > user receiving the warning can do about it. OK > Acked-by: Rusty Russell Assuming your ack applies for this patch below, let me know if that's not the case. Regards, Tony From: Tony Lindgren Date: Mon, 13 Feb 2012 12:30:09 -0800 Subject: [PATCH] modpost: Fix section warnings for ARM for many compilers It turns out that many compilers don't show section warnings on ARM currently because handling for ARM_CALL relocs are missing from modpost.c. Based on commit c2e26114 ([ARM] 3205/1: Handle new EABI relocations when loading kernel modules) it seems that R_ARM_PC24, R_ARM_CALL and R_ARM_JUMP24 can be handled the same way. Note that at least Debian libc6-dev is missing defines for both R_ARM_CALL and R_ARM_JUMP24 in /usr/include/elf.h. So for now we need to define them in modpost.c if not defined. Acked-by: Rusty Russell Cc: Ben Hutchings Cc: Anders Kaseorg Cc: Greg KH Cc: Russell King Signed-off-by: Tony Lindgren --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -1494,6 +1494,13 @@ static int addend_386_rel(struct elf_info *elf, Elf_Shdr *sechdr, Elf_Rela *r) return 0; } +#ifndef R_ARM_CALL +#define R_ARM_CALL 28 +#endif +#ifndef R_ARM_JUMP24 +#define R_ARM_JUMP24 29 +#endif + static int addend_arm_rel(struct elf_info *elf, Elf_Shdr *sechdr, Elf_Rela *r) { unsigned int r_typ = ELF_R_TYPE(r->r_info); @@ -1505,6 +1512,8 @@ static int addend_arm_rel(struct elf_info *elf, Elf_Shdr *sechdr, Elf_Rela *r) (elf->symtab_start + ELF_R_SYM(r->r_info)); break; case R_ARM_PC24: + case R_ARM_CALL: + case R_ARM_JUMP24: /* From ARM ABI: ((S + A) | T) - P */ r->r_addend = (int)(long)(elf->hdr + sechdr->sh_offset +