From patchwork Mon Sep 28 22:48:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 11804691 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E7CA613B2 for ; Mon, 28 Sep 2020 22:49:28 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 A728823A52 for ; Mon, 28 Sep 2020 22:49:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="FtYqeVPN"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="o5hwB45B" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A728823A52 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=IXn5+42jDq9UhI95uU54zD2GGTJDYkwNkzQo58lQsPw=; b=FtYqeVPNaaOFK+uz8OZkFk+Zvd kzJu/6W267yejZDIsqezNLPwBO3qmXAEBhQF6SXhY3ADfuzLaojA/8rSykCjBT0gzo8lLuZm+7wKG 7q1mhrL0UXBxXjzxGQinJgoMfYBZqh6xdx3UnFrzl6dkxWmfHxIhrfgiRkZM6ixEvJZu7AJLBU4Th 7xkV0SsryALVv1SR1FVYJMgnxCjpaHuwd72d51iFXC46w0u3KPOf2urJtFe9SCGTPydY/aN8cRCPF H438GvugQSK2GXBDouptTN9VdTb712s6/hDEUFrKyk0TwT0NWbKVb6bXiJrEmOYm06VhLDERjb6OJ oiu3tk5g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kN1xK-000555-Es; Mon, 28 Sep 2020 22:49:14 +0000 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kN1xH-00054h-UU for linux-arm-kernel@lists.infradead.org; Mon, 28 Sep 2020 22:49:12 +0000 Received: by mail-qt1-x843.google.com with SMTP id n10so2145987qtv.3 for ; Mon, 28 Sep 2020 15:49:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4y6sLld/wj75bLQXPRA2CM02Tu/AhXKlM+xG5SZVcBI=; b=o5hwB45B4AbcP/BDToNvIGEeSXi9/bifLalWJ6PDgznNZtFOYQdhYmDun/7vRPrIWp xnNhy0L9RN6CMZJEMzcFfFPRRQwwu6RA/XpT7uQNvrd5CAM6ikIV7CKY6aYOBSF6M32R /bP9iw8sPgM6Xy0N1Q4B+GvcROrkrWLIWe3ZZfLZAbqH804JeDh0qkhdj1wDo5mLW+PD w07cmj8B3ChhW8StpqgCeQ/A0IIUo//8+9ZdG/hV1hxn2XgjuJkZ08j+kEAbLos3tl1o A2um5YByRUj37TIA9FzgPvM5mv7Ug1It0zHvWH1nFgIR2OTMD5N/miz6DGeR0swh3Wze 1Tmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4y6sLld/wj75bLQXPRA2CM02Tu/AhXKlM+xG5SZVcBI=; b=rZ3vfq2SG+P6c/+F7rTCxqa/JS5zhUEwfyRX2RE56jDV5GoRcORKn0ca9eIhVF45nX 5A023uEHaXe/Tzl2JgLVPFGphYSJ6bo2Svj0whCkhIRJUV3GUW7+Y1GjJnB6VzH9pK/m vcBOZsdNyjh9014FTrDMxHVCoUnpWuF7geDG1rCw3jLIhdS/OY6IU1VtRSKac/EC3AYP G5u+Nx8LZZRCiTjbUpRnPTGOkb+Vg0DokCIRI3XF7yD1stn0ixKLSUUuHXJByw+jMOPS 6yxLys/bSZFRzDIj/9bV+FUZ4OxEAA8FmQuSCrpfIBQKjqgyBii1Xsv1vN6SHcjfT7sW 587w== X-Gm-Message-State: AOAM532F88y0I0VFOjWByF7vub4RwIBmA+7IiUP0MoqNB3JnRC4ilYIS fthHTy+awKj2LOeNQkm1lbg= X-Google-Smtp-Source: ABdhPJx+YGLvJvQta7YZ4ZbuUuqCYj8MpbgOhLflTLqr6ep9sljJpW5dnzCaCz8TC2ieXohqCxs2mQ== X-Received: by 2002:ac8:4e31:: with SMTP id d17mr396331qtw.43.1601333349929; Mon, 28 Sep 2020 15:49:09 -0700 (PDT) Received: from localhost.localdomain ([2604:1380:45d1:2600::1]) by smtp.gmail.com with ESMTPSA id g5sm2528959qtx.43.2020.09.28.15.49.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Sep 2020 15:49:09 -0700 (PDT) From: Nathan Chancellor To: Kees Cook , Ingo Molnar Subject: [PATCH] arm/build: Always handle .ARM.exidx and .ARM.extab sections Date: Mon, 28 Sep 2020 15:48:54 -0700 Message-Id: <20200928224854.3224862-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-Patchwork-Bot: notify X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200928_184912_158588_4CA8C266 X-CRM114-Status: GOOD ( 13.77 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:843 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [natechancellor[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel test robot , Russell King , linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Nathan Chancellor , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org After turning on warnings for orphan section placement, enabling CONFIG_UNWINDER_FRAME_POINTER instead of CONFIG_UNWINDER_ARM causes thousands of warnings when clang + ld.lld are used: $ scripts/config --file arch/arm/configs/multi_v7_defconfig \ -d CONFIG_UNWINDER_ARM \ -e CONFIG_UNWINDER_FRAME_POINTER $ make -skj"$(nproc)" ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- LLVM=1 defconfig zImage ld.lld: warning: init/built-in.a(main.o):(.ARM.extab) is being placed in '.ARM.extab' ld.lld: warning: init/built-in.a(main.o):(.ARM.extab.init.text) is being placed in '.ARM.extab.init.text' ld.lld: warning: init/built-in.a(main.o):(.ARM.extab.ref.text) is being placed in '.ARM.extab.ref.text' ld.lld: warning: init/built-in.a(do_mounts.o):(.ARM.extab.init.text) is being placed in '.ARM.extab.init.text' ld.lld: warning: init/built-in.a(do_mounts.o):(.ARM.extab) is being placed in '.ARM.extab' ld.lld: warning: init/built-in.a(do_mounts_rd.o):(.ARM.extab.init.text) is being placed in '.ARM.extab.init.text' ld.lld: warning: init/built-in.a(do_mounts_rd.o):(.ARM.extab) is being placed in '.ARM.extab' ld.lld: warning: init/built-in.a(do_mounts_initrd.o):(.ARM.extab.init.text) is being placed in '.ARM.extab.init.text' ld.lld: warning: init/built-in.a(initramfs.o):(.ARM.extab.init.text) is being placed in '.ARM.extab.init.text' ld.lld: warning: init/built-in.a(initramfs.o):(.ARM.extab) is being placed in '.ARM.extab' ld.lld: warning: init/built-in.a(calibrate.o):(.ARM.extab.init.text) is being placed in '.ARM.extab.init.text' ld.lld: warning: init/built-in.a(calibrate.o):(.ARM.extab) is being placed in '.ARM.extab' These sections are handled by the ARM_UNWIND_SECTIONS define, which is only added to the list of sections when CONFIG_ARM_UNWIND is set. CONFIG_ARM_UNWIND is a hidden symbol that is only selected when CONFIG_UNWINDER_ARM is set so CONFIG_UNWINDER_FRAME_POINTER never handles these sections. According to the help text of CONFIG_UNWINDER_ARM, these sections should be discarded so that the kernel image size is not affected. Fixes: 5a17850e251a ("arm/build: Warn on orphan section placement") Link: https://github.com/ClangBuiltLinux/linux/issues/1152 Reported-by: kernel test robot Signed-off-by: Nathan Chancellor Tested-by: Nick Desaulniers --- arch/arm/kernel/vmlinux.lds.S | 4 ++++ 1 file changed, 4 insertions(+) base-commit: 6e0bf0e0e55000742a53c5f3b58f8669e0091a11 diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S index 5f4922e858d0..a2c0d96b0580 100644 --- a/arch/arm/kernel/vmlinux.lds.S +++ b/arch/arm/kernel/vmlinux.lds.S @@ -40,6 +40,10 @@ SECTIONS ARM_DISCARD #ifndef CONFIG_SMP_ON_UP *(.alt.smp.init) +#endif +#ifndef CONFIG_ARM_UNWIND + *(.ARM.exidx*) + *(.ARM.extab*) #endif }