Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, T_DKIMWL_WL_HIGH,URIBL_BLOCKED,USER_AGENT_NEOMUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4A548C04AB6 for ; Tue, 28 May 2019 11:55:43 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 22B742075B for ; Tue, 28 May 2019 11:55:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="lz1O7wVJ"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="s+bKGd3c" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 22B742075B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9DepTpJdidyf97kPVZoRdBVFU+Whf74Hh5CnsjsIDaU=; b=lz1O7wVJMCX/mC Y7ErP4KzQv15PtVq6Vh0RszqX2WydG6KyMYUDiGb21n/UlPAIXYyhWMH4EEF246mqLLcUJFUrWqho H1G6fmF2sqshxj3lK3h21pHsGFXHXAF7wJ0rDdGEMxl0yW1G2a/s98QbP/sCFbtO4IymLsiJlNPk4 EoVyHvJzSkWe6WCruNKwEIq86wcbxCx2r6GzMa/bteqsc+eSYsJFunBTh9IA4B09A9fqwehY//HGC cO3BcKWLmrSXfm2POJy77Gw4Xx9YyUl/Z/bIBtfn09c3bcWXsDoWhj9fHIVa/83HsfkQBq27TPNWU M3OhIQuJg8YyVE/HDUuA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hVahe-0006zZ-UQ; Tue, 28 May 2019 11:55:38 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hVaha-0005Jx-U1 for linux-arm-kernel@lists.infradead.org; Tue, 28 May 2019 11:55:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=ubWHDxcBAW+GgYsjr8WokjpnNSm+Hpnm8uCfm3SCbUI=; b=s+bKGd3cqvnl3IG3V6gGQoyGD f3VTYB7YP4kUL0CJN9sB+dw6VaMPkxDoXA8VgROcMzPe16asM3t0MLdspiSjTlRBfHg8EKS33yPtj GtP7h93fdm5xmlgI+G0Br6Cdhi5OoNn7aFmSJ5z9KeQm3aIsmBw3W5g3N3lfsn/Bj1T9fuyqXRHJR OeJmqH/eoWab+SEHJl5koL9CIz7YWMxEYfG8vtNVp6UPfcJ3FoP0HUiJ2XY5rqJJZ/6KQOIla9GDW E/nefabFxxMvipegG3pbStT8/r9vuHICako130cmRzUDn0BKyzyStIMOjFYw30dSVllduLW3gpxdY fGHXc5IAA==; Received: from shell.armlinux.org.uk ([2001:4d48:ad52:3201:5054:ff:fe00:4ec]:56028) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1hVafR-0005Xm-B8; Tue, 28 May 2019 12:53:21 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.89) (envelope-from ) id 1hVafQ-0003ap-AP; Tue, 28 May 2019 12:53:20 +0100 Date: Tue, 28 May 2019 12:53:20 +0100 From: Russell King - ARM Linux admin To: Stefan Agner Subject: Re: Linker error `.exit.text' referenced in section `.alt.smp.init' Message-ID: <20190528115320.unaqrtw3w44cl5w3@shell.armlinux.org.uk> References: <2072571511d5c77bb9ac53168e44e90b@agner.ch> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190528_045534_968827_3143041D X-CRM114-Status: GOOD ( 23.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux ARM , Masami Hiramatsu , Arnd Bergmann Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, May 28, 2019 at 01:41:47PM +0200, Stefan Agner wrote: > On 28.05.2019 09:32, Arnd Bergmann wrote: > > On Tue, May 28, 2019 at 9:12 AM Stefan Agner wrote: > >> > >> Hi, > >> > >> Cross compiling Linux v5.2-rc2 with CONFIG_DNS_RESOLVER=y using gcc 8.2 > >> I noticed the following build error: > >> > >> ... > >> GEN .version > >> CHK include/generated/compile.h > >> UPD include/generated/compile.h > >> CC init/version.o > >> AR init/built-in.a > >> LD vmlinux.o > >> MODPOST vmlinux.o > >> MODINFO modules.builtin.modinfo > >> `.exit.text' referenced in section `.alt.smp.init' of > >> net/dns_resolver/dns_key.o: defined in discarded section `.exit.text' of > >> net/dns_resolver/dns_key.o > >> > >> make: *** [Makefile:1052: vmlinux] Error 1 > >> > >> It seems that Masami noticed this a while back: > >> https://lore.kernel.org/lkml/20180911231012.fdc45840f3d91860daa2e180@kernel.org/T/#u > >> > >> Anybody else seen this? > >> > >> When I remove put_cred in exit_dns_resolver the kernel links fine... > > > > I've seen two or thre of these in total. This only happens on 32-bit ARM > > when a function that needs SMP patching gets inlined into an __exit > > function. In this case, it's the atomic_dec_and_test(). > > > > The last one I fixed was https://lkml.org/lkml/2019/4/15/625 > > I think I've seen the one in the dns_resolver before but couldn't > > reproduce it recently. > > > > I used to have a patch that completely avoided dropping .exit when > > SMP patching was active, but I think we can fix them up as they happen, > > as I have built thousands of randconfig kernels without hitting this. > > Yeah dropping .exit seems rather harsh. > > > > > The easiestwork around here would be to drop the __exit annotation > > and add a comment. We could also move put_cred out-of-line and > > make it non-__exit, or add an extern wrapper for it. > > Hm, both seem not very appealing to me. I think I'd rather prefer an > extern wrapper. > > Is this an actual problem? As far as I understand that fixup happens > very early and only once during boot, so by the time the kernel drops > those .exit.text fixup has been done long time ago... > > Is this maybe a case for __ref (defined in include/linux/init.h)? > > Or could we have the section marked init/exit such that this does not > trigger the error? Moving the SMP alternatives section doesn't change anything: the problem is that the SMP alternatives are part of the image the linker creates, but an entry in there refers to a section that we've told the linker to discard. The linker has no way to provide a value for that entry, and so errors out. I wonder if there's a way to tell the linker that it's a weak reference, and modify the SMP fixup code to skip it. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up According to speedtest.net: 11.9Mbps down 500kbps up _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel