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: 12917000 X-Patchwork-Delegate: bpf@iogearbox.net 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 E0EB4C43334 for ; Wed, 13 Jul 2022 17:35:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232034AbiGMRfU (ORCPT ); Wed, 13 Jul 2022 13:35:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231560AbiGMRfT (ORCPT ); Wed, 13 Jul 2022 13:35:19 -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 EDAAC2CCA5; Wed, 13 Jul 2022 10:35:18 -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 7F38561D0E; 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 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net 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)