From patchwork Thu Jun 30 15:31:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 12901974 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 07D8EC43334 for ; Thu, 30 Jun 2022 15:33:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NVzrwf4EHSwc31zSDDXlmewSztbLtSEJASDoqjC50JQ=; b=F7SHqeUYJG/+ec M7SPxLgmeEn2ZlKauB/6BeVpaZXgHpD9xYDyiQKM7cYDmi40ApmQEi1NF7Jx+dBXRtcf02BqO2NdF ezfVY+4RoK4WM72EJW51Alwo/1bc5J9o3Nj4XcU5g0y/R7UhcT4Q3A219IGXd8Xp3lIQDQ6oIBD+A Odj0HepuS+mMXBGfc5V04DxakLplclfXruWCQrXYusRcM9eZ5lkM97jGQAc4aCuo7Wh5BYuovPhgP 5M/va8gF3mX0yIZv/DPXfupyClHZVn9Jp9rDda0uALcvObX0S27bsHjN/OSlAza/9Dgt13EYn6FKv gfCa/PoanG8ssueX3yXA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6w9H-000I3C-UY; Thu, 30 Jun 2022 15:32:08 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6w9C-000I1Z-WD for linux-arm-kernel@lists.infradead.org; Thu, 30 Jun 2022 15:32:05 +0000 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 dfw.source.kernel.org (Postfix) with ESMTPS id 83A646191A; Thu, 30 Jun 2022 15:32:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5CCD4C341CB; Thu, 30 Jun 2022 15:32:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656603121; bh=Mc0Rtfv5Q6VgtfmxRqUTe/qbzvhY8R4J0R57YzDkjbo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CopN/WnL2zNJPogT2MzmTl41y9stZmh1N49STSIztJhT3Hcx8CidlZMG7ilVfHwaR t1E40XS8knn0RRz2WQOXPyNq3f9feDuFvhSgvjb2CnAIChp6nM+u0Q/OIBc+wuEDtr mzaDgYbVqhg5co/wO3QE027rMoBO4MiWQvgXZIjK6YF5BnFUV733zej0XId4idyWbA VfMonM5qG+Qs5ZK9L+BCD7Xw3fM7KXN/8l/hefOi1RcnSSF8pJ3m7/pvvjRpgkXwst 4NqC5Woe+AQ49aX9gxu3B9228elarMIIsPi+QyyexFvPwzbI45N7scKIHLiI3Nyz6C n/cHpu3nBMwMQ== 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, patches@lists.linudx.dev, Nathan Chancellor Subject: [PATCH 1/2] arm64: vdso32: Shuffle .ARM.exidx section above ELF_DETAILS Date: Thu, 30 Jun 2022 08:31:20 -0700 Message-Id: <20220630153121.1317045-2-nathan@kernel.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630153121.1317045-1-nathan@kernel.org> References: <20220630153121.1317045-1-nathan@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220630_083203_171079_E6ECAC62 X-CRM114-Status: GOOD ( 12.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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") 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/ : {