From nobody Sun Apr 19 13:43:02 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB082C433EF for ; Thu, 30 Jun 2022 15:32:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235811AbiF3PcG (ORCPT ); Thu, 30 Jun 2022 11:32:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232771AbiF3PcD (ORCPT ); Thu, 30 Jun 2022 11:32:03 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBCF93A738 for ; Thu, 30 Jun 2022 08:32:02 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 87A3C6191C for ; 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 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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, 0x= C8A]; check your linker script for overflows ld.lld: error: unable to place section .symtab at file offset [0xC8C, 0xE= 0B]; check your linker script for overflows ld.lld: error: unable to place section .strtab at file offset [0xE0C, 0xF= 1C]; check your linker script for overflows ld.lld: error: unable to place section .shstrtab at file offset [0xF1D, 0= xFAA]; 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 .ha= sh >>> .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 =20 .rel.dyn : { *(.rel*) } =20 - ELF_DETAILS .ARM.exidx : { *(.ARM.exidx*) } + ELF_DETAILS .ARM.attributes 0 : { *(.ARM.attributes) } =20 /DISCARD/ : { --=20 2.37.0 From nobody Sun Apr 19 13:43:02 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 861F8C43334 for ; Thu, 30 Jun 2022 15:32:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235254AbiF3PcI (ORCPT ); Thu, 30 Jun 2022 11:32:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235809AbiF3PcF (ORCPT ); Thu, 30 Jun 2022 11:32:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D75693A738 for ; Thu, 30 Jun 2022 08:32:04 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 736BF61904 for ; Thu, 30 Jun 2022 15:32:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49DB7C341CC; Thu, 30 Jun 2022 15:32:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656603123; bh=DMoXyBY8anTUJp0z5XM+bV0yDDpw0G7731nqB1esFYQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZcYHX7j34PqL86ygQiByoktv5ZxOg5p0qqwuvZlD2xxc/DIBosQtSMBLlmsm6rs4p +SW6b8jtsrCQTkWx0KqMnuCk7j1i64FNAutDF+0HGtcNsxoIiU7U+RyhivqP8ZVB1q lkiXBA4JarrAhhHIKqoWeQAjlnjXFt5wvzol+ranak6I/76jO6ywEH3B5ruZxsWabd 9m0wooGnOlGftVn4MP8w+Ugx2gAtRgsUPIx8qnR7wm+gOKpWw6mS2Jr2ld+rQ8vKQY TogUk4QCyagiIMj75KLzTiXDos5nk34v3jp9I4F8LSrNPcvnNQzKyZqRE3dEms6g8U be0lYglwtp1BA== 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 2/2] arm64: vdso32: Add DWARF_DEBUG Date: Thu, 30 Jun 2022 08:31:21 -0700 Message-Id: <20220630153121.1317045-3-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 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" When building the 32-bit vDSO with LLVM 15 and CONFIG_DEBUG_INFO, there are the following orphan section warnings: ld.lld: warning: arch/arm64/kernel/vdso32/note.o:(.debug_abbrev) is being= placed in '.debug_abbrev' ld.lld: warning: arch/arm64/kernel/vdso32/note.o:(.debug_info) is being p= laced in '.debug_info' ld.lld: warning: arch/arm64/kernel/vdso32/note.o:(.debug_str_offsets) is = being placed in '.debug_str_offsets' ld.lld: warning: arch/arm64/kernel/vdso32/note.o:(.debug_str) is being pl= aced in '.debug_str' ld.lld: warning: arch/arm64/kernel/vdso32/note.o:(.debug_addr) is being p= laced in '.debug_addr' ld.lld: warning: arch/arm64/kernel/vdso32/note.o:(.debug_line) is being p= laced in '.debug_line' ld.lld: warning: arch/arm64/kernel/vdso32/note.o:(.debug_line_str) is bei= ng placed in '.debug_line_str' ld.lld: warning: arch/arm64/kernel/vdso32/vgettimeofday.o:(.debug_loclist= s) is being placed in '.debug_loclists' ld.lld: warning: arch/arm64/kernel/vdso32/vgettimeofday.o:(.debug_abbrev)= is being placed in '.debug_abbrev' ld.lld: warning: arch/arm64/kernel/vdso32/vgettimeofday.o:(.debug_info) i= s being placed in '.debug_info' ld.lld: warning: arch/arm64/kernel/vdso32/vgettimeofday.o:(.debug_rnglist= s) is being placed in '.debug_rnglists' ld.lld: warning: arch/arm64/kernel/vdso32/vgettimeofday.o:(.debug_str_off= sets) is being placed in '.debug_str_offsets' ld.lld: warning: arch/arm64/kernel/vdso32/vgettimeofday.o:(.debug_str) is= being placed in '.debug_str' ld.lld: warning: arch/arm64/kernel/vdso32/vgettimeofday.o:(.debug_addr) i= s being placed in '.debug_addr' ld.lld: warning: arch/arm64/kernel/vdso32/vgettimeofday.o:(.debug_frame) = is being placed in '.debug_frame' ld.lld: warning: arch/arm64/kernel/vdso32/vgettimeofday.o:(.debug_line) i= s being placed in '.debug_line' ld.lld: warning: arch/arm64/kernel/vdso32/vgettimeofday.o:(.debug_line_st= r) is being placed in '.debug_line_str' These are DWARF5 sections, as that is the implicit default version for clang-14 and newer when just '-g' is used. All DWARF sections are handled by the DWARF_DEBUG macro from include/asm-generic/vmlinux.lds.h so use that macro here to fix the warnings regardless of DWARF version. Fixes: 9d4775b332e1 ("arm64: vdso32: enable orphan handling for VDSO") Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers --- arch/arm64/kernel/vdso32/vdso.lds.S | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/kernel/vdso32/vdso.lds.S b/arch/arm64/kernel/vdso32= /vdso.lds.S index c25bed8e6df1..8d95d7d35057 100644 --- a/arch/arm64/kernel/vdso32/vdso.lds.S +++ b/arch/arm64/kernel/vdso32/vdso.lds.S @@ -57,6 +57,7 @@ SECTIONS .rel.dyn : { *(.rel*) } =20 .ARM.exidx : { *(.ARM.exidx*) } + DWARF_DEBUG ELF_DETAILS .ARM.attributes 0 : { *(.ARM.attributes) } =20 --=20 2.37.0