Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp731599iog; Thu, 30 Jun 2022 09:06:23 -0700 (PDT) X-Google-Smtp-Source: AGRyM1smiAhDkjLaH+1MdhfeSnB5EOXx7DPhw7sVY7FUPSDVEVheYZOOP6AipWdoVhiW4NEEXmVZ X-Received: by 2002:a17:907:980a:b0:722:f4a7:e00 with SMTP id ji10-20020a170907980a00b00722f4a70e00mr9703287ejc.114.1656605182876; Thu, 30 Jun 2022 09:06:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656605182; cv=none; d=google.com; s=arc-20160816; b=ts+XJZCJ96++lFhmf3BwuB7Gf5tsSL0cIxoY2l4RlsJwHSpOh76izeMO6+VcBEEhgg 1vKuSeF4vKcI+G9TW29Z12SDZs6f4Y7znv5e7vFyPBNrpMpKXSXkoK1AzT5v+7ysKVlk cdfIQrJWEkgGsuy1n5YqWIbjipYX5makhvt+zCBEI7W+zCZWy0EA1yeoMeR54uJ6sa95 EpzPHdf5BZfuX0rgQYxDc/Nc9W/mjjqd3Bqu+uD4FOR1VnJRk5fnSLgcfZmFFduI36aY hQqh6mEjCFqVCGSsE3NNQ8fKufRBSNo0rHLDaKaNnLKqwJsDRU4dV1IY4M89MkAHR8Gk IWKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=7S5joixwpJ4H2b0lYACPvd37UyNOutzhxCmfxiRjbcQ=; b=iWfanRg2v/eLtdMocDa/MCOUzCapl7SiHkIklaP+DrdXuaPJBkvR/2EiEzO5WiSzni bkRN8jwHzYkuF/eKnmJzhruViL+BsUELISovTNDmdmuWyBV8UoPI2bxQfEUo1VvTs2og jKjuLD5wrA7K2GkK953YzYR+859Lq0GjaDlYf3LKxkAaY1uJ/ra9fNNXHdJYsaVIYilT VpBb4b8Ift15bOZgRELiftlBGkdtuPa2+pDOJdHRgnSzuPMEbvHIq15LhuVU/wC+9vil I6s2E3GePn3UhCQjUUMDFAOiMbQDae2ybarjQFrtehBmzuMjSPz/jfdDhW7BEtoocsUq Xbvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UjTOs5sb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q5-20020a1709066b0500b00717917b7d99si11791759ejr.274.2022.06.30.09.05.55; Thu, 30 Jun 2022 09:06:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UjTOs5sb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235814AbiF3Pfz (ORCPT + 99 others); Thu, 30 Jun 2022 11:35:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235612AbiF3Pfx (ORCPT ); Thu, 30 Jun 2022 11:35:53 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02F04F5B7 for ; Thu, 30 Jun 2022 08:35:52 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 91473B82BEB for ; Thu, 30 Jun 2022 15:35:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A5D92C34115; Thu, 30 Jun 2022 15:35:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656603349; bh=xeXcHBHJp18s20H0r59IvRA/+hEOgADzH+b65yvr46c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=UjTOs5sbsSdtav/pxqHza2CWHFFSzUSvDOE9ETGhBq7kgCdhjtYj50WSIvi6VCK18 xRlG38FDsPK1oeEplAFaqdsxFFo68VlYe2Y/IocLBP0Zy7ztOh3Gu0J/3c2Iuv1/cN nM1Q/VULCJpbCgaK4+wJKfA7w6fY/xm8dKzwT6hofjn5AfHvbalYllpeXbwfnsj3JH jdbKzF4X+4rm3wauNwkAEH58Zu3UaOml99To6kB8GaxUjpGHxYV5JG4iWJWfjEiIaO pVcA+MilbrvWX7kxa8qwpuCgqmR0B/j0SpG8kJ4PUJlC2zn1ymG6jpqCmj750o50/B nbJdAhxmuLz7Q== Date: Thu, 30 Jun 2022 08:35:47 -0700 From: Nathan Chancellor To: Catalin Marinas , Will Deacon Cc: Joey Gouly , Vincenzo Frascino , Nick Desaulniers , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH 1/2] arm64: vdso32: Shuffle .ARM.exidx section above ELF_DETAILS Message-ID: References: <20220630153121.1317045-1-nathan@kernel.org> <20220630153121.1317045-2-nathan@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220630153121.1317045-2-nathan@kernel.org> X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 30, 2022 at 08:31:20AM -0700, Nathan Chancellor wrote: > When building the 32-bit vDSO after commit 5c4fb60816ea ("arm64: vdso32: > add ARM.exidx* sections"), ld.lld 11 fails to link: > > ld.lld: error: could not allocate headers > ld.lld: error: unable to place section .text at file offset [0x2A0, 0xBB1]; check your linker script for overflows > ld.lld: error: unable to place section .comment at file offset [0xBB2, 0xC8A]; check your linker script for overflows > ld.lld: error: unable to place section .symtab at file offset [0xC8C, 0xE0B]; check your linker script for overflows > ld.lld: error: unable to place section .strtab at file offset [0xE0C, 0xF1C]; check your linker script for overflows > ld.lld: error: unable to place section .shstrtab at file offset [0xF1D, 0xFAA]; check your linker script for overflows > ld.lld: error: section .ARM.exidx file range overlaps with .hash > >>> .ARM.exidx range is [0x90, 0xCF] > >>> .hash range is [0xB4, 0xE3] > > ld.lld: error: section .hash file range overlaps with .ARM.attributes > >>> .hash range is [0xB4, 0xE3] > >>> .ARM.attributes range is [0xD0, 0x10B] > > ld.lld: error: section .ARM.attributes file range overlaps with .dynsym > >>> .ARM.attributes range is [0xD0, 0x10B] > >>> .dynsym range is [0xE4, 0x133] > > ld.lld: error: section .ARM.exidx virtual address range overlaps with .hash > >>> .ARM.exidx range is [0x90, 0xCF] > >>> .hash range is [0xB4, 0xE3] > > ld.lld: error: section .ARM.exidx load address range overlaps with .hash > >>> .ARM.exidx range is [0x90, 0xCF] > >>> .hash range is [0xB4, 0xE3] > > This was fixed in ld.lld 12 with a change to match GNU ld's semantics of > placing non-SHF_ALLOC sections after SHF_ALLOC sections. > > To workaround this issue, move the .ARM.exidx section before the > .comment, .symtab, .strtab, and .shstrtab sections (ELF_DETAILS) so that > those sections remain contiguous with the .ARM.attributes section. > > Fixes: 5c4fb60816ea ("arm64: vdso32: add ARM.exidx* sections") This should have been included to point out the exact commit that fixed this in ld.lld, I can resend if necessary (since I also screwed up the patches@lists.linux.dev domain...) Link: https://github.com/llvm/llvm-project/commit/ec29538af2e0886a65f479d6a533956a1c478132 > Signed-off-by: Nathan Chancellor > --- > arch/arm64/kernel/vdso32/vdso.lds.S | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/arm64/kernel/vdso32/vdso.lds.S b/arch/arm64/kernel/vdso32/vdso.lds.S > index 6e67a6524d58..c25bed8e6df1 100644 > --- a/arch/arm64/kernel/vdso32/vdso.lds.S > +++ b/arch/arm64/kernel/vdso32/vdso.lds.S > @@ -56,8 +56,8 @@ SECTIONS > > .rel.dyn : { *(.rel*) } > > - ELF_DETAILS > .ARM.exidx : { *(.ARM.exidx*) } > + ELF_DETAILS > .ARM.attributes 0 : { *(.ARM.attributes) } > > /DISCARD/ : { > -- > 2.37.0 >