From patchwork Wed Jul 13 17:35:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 12917001 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 0B8AAC43334 for ; Wed, 13 Jul 2022 17:36:52 +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: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:In-Reply-To:References: List-Owner; bh=InsyQhBqElj92zmGTPQMLH/qXR9SA2H/gxgzDjfvTC4=; b=z/hrIcbo6vlxWu tuBhTqTrNRcV3Ff18cA4CjAc+sOGwlVVbOSmbu1l98bzLuojgFUhWv2y1+x+1JxRG8xhj2cReSNGc 0IWfWUBDa5CA5OGnlZJLi4LH4r1EfbYlQ5O9M8+ZKy9x+nawYvrsyHHShchwwDWXXa5OsaKtvDMar vPPm3pIkbFMRe9XvxvFFOvXzLairXUUoBD6WG4c0KcsPhKZakP4jiWwbwl4ANiWRIEUiZpB6LpHcv 1l3DB8YWpSMkxPfo1Oivo/Htg63q6ntRPGl8bqmHHE/ICGYTWWDiYZL2V3wvqSjsD34+jF+qxUWFw Hq/7tHjzL7R+ZuuF3YEA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oBgGh-0062ud-51; Wed, 13 Jul 2022 17:35:23 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oBgGd-0062sP-AW for linux-arm-kernel@lists.infradead.org; Wed, 13 Jul 2022 17:35:20 +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 79D8E61D0C; Wed, 13 Jul 2022 17:35:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0B7AC34114; Wed, 13 Jul 2022 17:35:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657733717; bh=HFYEMG5wmH1mdTjCQGIo+9rp7fPWoJyZUnWc3Tmd2sw=; h=From:To:Cc:Subject:Date:From; b=KZH39mymqASDm9q7u3QUhCZoUL+Xy0JxQwhNr+L/ru6UA4A62Xz2q9o/4KkwE5Afh UJLM1p0KFFf6v7bRnUfh4vXa+ka3+H+jhcDFwR3isapLzjYSV/rY3Vt77RZZtQku0A RqKc+KDtptHIrcsho28fHkXw4/MNky5HsK/qWHVtbyYxbWMvYepM8dfVLRG1eladHQ y/yc5sO4hevdwpfw+ay2aic61o+ISvEe3zHgwh7SO8QdGQgsCerk5Alyr61XRT/mgs 7sgv8jAJI0FuCvBO5XQVosT14554IMlcoNxlWM7oMZwu0N8FIwOmJlyNKwOgt1+N8W YiI92vMFWKEcg== From: Nathan Chancellor To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko Cc: Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Zi Shen Lim , Xu Kuohai , Nick Desaulniers , Tom Rix , bpf@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, patches@lists.linux.dev, Nathan Chancellor , Sami Tolvanen Subject: [PATCH] bpf, arm64: Mark dummy_tramp as global Date: Wed, 13 Jul 2022 10:35:03 -0700 Message-Id: <20220713173503.3889486-1-nathan@kernel.org> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220713_103519_423588_B9ECDB9E X-CRM114-Status: UNSURE ( 9.55 ) X-CRM114-Notice: Please train this message. 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 with clang + CONFIG_CFI_CLANG=y, the following error occurs at link time: ld.lld: error: undefined symbol: dummy_tramp dummy_tramp is declared globally in C but its definition in inline assembly does not use .global, which prevents clang from properly resolving the references to it when creating the CFI jump tables. Mark dummy_tramp as global so that the reference can be properly resolved. Fixes: b2ad54e1533e ("bpf, arm64: Implement bpf_arch_text_poke() for arm64") Link: https://github.com/ClangBuiltLinux/linux/issues/1661 Suggested-by: Sami Tolvanen Signed-off-by: Nathan Chancellor Reviewed-by: Stanislav Fomichev --- arch/arm64/net/bpf_jit_comp.c | 1 + 1 file changed, 1 insertion(+) base-commit: ace2bee839e08df324cb320763258dfd72e6120e diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c index fd1cb0d2aaa6..dcc572b7d4da 100644 --- a/arch/arm64/net/bpf_jit_comp.c +++ b/arch/arm64/net/bpf_jit_comp.c @@ -604,6 +604,7 @@ void dummy_tramp(void); asm ( " .pushsection .text, \"ax\", @progbits\n" +" .global dummy_tramp\n" " .type dummy_tramp, %function\n" "dummy_tramp:" #if IS_ENABLED(CONFIG_ARM64_BTI_KERNEL)