Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp2049259lqe; Tue, 9 Apr 2024 08:11:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW+LSuAkeZKoOEfkH605ZPoAnltqdJKZWnkADGakdE/abTLDd3++hXyElvClnrclFck+uz93GZbdnWou0+nRtF2xQ1L6ZJ7tSIOvFKOvw== X-Google-Smtp-Source: AGHT+IFxVaAL5yinAPy5AZuxCAdCPNaMlylaONlv268k46vVhEtbCi755cJmpL9t9WfipCWFn0wb X-Received: by 2002:a17:90a:4dc6:b0:2a2:21e6:229a with SMTP id r6-20020a17090a4dc600b002a221e6229amr10339003pjl.35.1712675507139; Tue, 09 Apr 2024 08:11:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712675507; cv=pass; d=google.com; s=arc-20160816; b=v8oSVksc2xYAtizUSEoweVEoqR6EVXcGamj6F7WFZ28DeMbjfi9KzHYKVSfnDrYH6Q Ow2rXzlg7Wk9T1Gc73dOtwxKP/OX7BLq54wb3qR6D2G+LATpvrFqpvtlSk+w0zXwXOAX DfRFAoAOSFGm80t0fKD0e+Ay3EWJ4jZ4pq+Yyi+09fexQqlpTmlq4P7Qn9se2Fws7GBa InjJ/GD6lpOk1c3vMzm/9XMjyRF5f9DXomVkYsIUkB5HQAOdhBoaR/3ihW1Y8gUDrhCA i8+wsAlqcJe62ErF+sQuILLwzA0aZS8bQK1M4kjtlMZ9UWMoWU8w9k6FeRPTg3In+O9T dv/A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=subject:cc:to:from:date:references:in-reply-to:message-id :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:feedback-id:dkim-signature:dkim-signature; bh=BRuB4UKpiBNByIq5UG25bS2+dgxfikOk79EzTalBWB0=; fh=UMPDXb09csAN+7dAgGtCcKW6OsxtPCSgjZGOtf+zU34=; b=Fe6YcXUomtla4SoQambdTfbGsu3vYwt3qsPHD0arMrIdHT5gv3G80ewbLpC/F+luhO fbv1WLDjlWMbjNiFghbyRnjEvpJOeMp7kvQphLXokGwEj6Sn/zxVFGw5rWHnNfmObYKJ B0B9KWQeTIqTS60u74g89rJ69/8BVWzT+gwJ7bCfnC0HSc3FiW6ZEZnhZ32rDAgpmio/ h5sNEX7ghJHOWthzs9NbnSVQVCbadaCH9eQ0tp/W2hSpqnKRSjHShZlXc60e14YyCxCj 3yqJd2mAMgQdmQf2DK6T8HjMNag0hJ1WXwKO+nXATvArBGXAd64XpVC76ZESdFKGPb4q W85w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm2 header.b=SfFQjHod; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=Ef0PFokv; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-137179-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137179-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id e16-20020a17090a9a9000b002a4ff5dc22dsi4695197pjp.106.2024.04.09.08.11.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 08:11:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-137179-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm2 header.b=SfFQjHod; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=Ef0PFokv; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-137179-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137179-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 159FD294A75 for ; Tue, 9 Apr 2024 15:11:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A4FE413BAF3; Tue, 9 Apr 2024 15:05:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b="SfFQjHod"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Ef0PFokv" Received: from fhigh7-smtp.messagingengine.com (fhigh7-smtp.messagingengine.com [103.168.172.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E460B13BACD; Tue, 9 Apr 2024 15:05:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.158 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712675131; cv=none; b=mBwIIohLRX4+Svs98vqcqmbMOgmoj34YDa5LXpcs//D8B3gUu0Tq2HP0nK9sofPoP3w2PLX8BXQ/4ZoR2pMFMUcD34WZIJI1O5uFl7am/tXiCfrS6s2hFuh3WccGXuqAh+3wR5m6BtDU5ir5NkAPIJKalJ74RrmchnR6S+7L7Xc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712675131; c=relaxed/simple; bh=BRuB4UKpiBNByIq5UG25bS2+dgxfikOk79EzTalBWB0=; h=MIME-Version:Message-Id:In-Reply-To:References:Date:From:To:Cc: Subject:Content-Type; b=c7GsqqKvU/yBnQnlMPdnLu2rtIXBLg08oh7Rlp0CNKitSUmhJIJW1aiEJnPTRNCEn98fMoISWT8JzS/2FIkbt2aRauRFNZv3851g++9FeNlsE1mvx+XKCsCYSA6Bbj/OeXJLO8AqCBPtydT/kBg7diSNIqqjhOCGytxuEQLKNXU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de; spf=pass smtp.mailfrom=arndb.de; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b=SfFQjHod; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Ef0PFokv; arc=none smtp.client-ip=103.168.172.158 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arndb.de Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 06B801140193; Tue, 9 Apr 2024 11:05:29 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute2.internal (MEProxy); Tue, 09 Apr 2024 11:05:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1712675129; x=1712761529; bh=BRuB4UKpiB NByIq5UG25bS2+dgxfikOk79EzTalBWB0=; b=SfFQjHodMy4wHc/7Hwneo7e6ym E8E50/C3wm/DXFR2krf3ZaIFAuJp8dq3KeP/bmTag5bqJ2qgznRgzUmHdZpvPzYF HiNN6uqsTLlUcHVbhGaCE61tQTR1G7PATqfFLZyT6Z/SqfFS9QoQkMFUJ/aaa1vL Bff0NW6osSw1a3SOCQ0hpZSuLMMYyfbj/ZEad8PgsiuiA0dk9p65Vqkyuw1VngmP RKhqrp0bV03yTWp7CntUJtBFGm0hV/hVyunkEjHrF4DS4Ze/v12vJGC9Jh7y9KEy aQ6fvM3zqsMvWehZUUchBdx9GFtoszvedaoz6k+Kqo4YJJ8/QAQ2RAQdFxtQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1712675129; x=1712761529; bh=BRuB4UKpiBNByIq5UG25bS2+dgxf ikOk79EzTalBWB0=; b=Ef0PFokvTD6zcZNbpgYWGwiG5tb0z3tH4RKUwV1BcnOA LU55sK6DHPcIixL7d+ocbFjLyuKgyjk6t8WSkbHyAmB6Fk/Yhdq1iBcbG5ktwK1W Vdp2tkSlqPIGaPpjs+hf8Y47V1agAFjUezogUnWV7MC/8tt3xE4MVXUldis12au+ 5wO5e8APojGNViA7hoHehOQB/RGvPY3MPsU1ezN0Uay5fos05hCdbkmL8gJKuHvq j1jRgVIOj94mFUuaYi8QgnRtdO4KE7XfYpmZ06MXTPlnxqOhDVGlAauKNzWg/LjQ YmOOcfFW8fUeGF05V0O/XHG8Jp5iLt73t0/uiFIrUQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudehvddgudeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepffehueegteeihfegtefhjefgtdeugfegjeelheejueethfefgeeghfektdek teffnecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 67E1AB6008D; Tue, 9 Apr 2024 11:05:28 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-379-gabd37849b7-fm-20240408.001-gabd37849 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: In-Reply-To: <20240409150132.4097042-8-ardb+git@google.com> References: <20240409150132.4097042-5-ardb+git@google.com> <20240409150132.4097042-8-ardb+git@google.com> Date: Tue, 09 Apr 2024 17:05:08 +0200 From: "Arnd Bergmann" To: "Ard Biesheuvel" , linux-kernel@vger.kernel.org Cc: "Ard Biesheuvel" , "Masahiro Yamada" , "Martin KaFai Lau" , Linux-Arch , linux-kbuild@vger.kernel.org, bpf@vger.kernel.org, "Andrii Nakryiko" Subject: Re: [PATCH v2 3/3] btf: Avoid weak external references Content-Type: text/plain On Tue, Apr 9, 2024, at 17:01, Ard Biesheuvel wrote: > From: Ard Biesheuvel > > If the BTF code is enabled in the build configuration, the start/stop > BTF markers are guaranteed to exist in the final link but not during the > first linker pass. > > Avoid GOT based relocations to these markers in the final executable by > providing preliminary definitions that will be used by the first linker > pass, and superseded by the actual definitions in the subsequent ones. > > Make the preliminary definitions dependent on CONFIG_DEBUG_INFO_BTF so > that inadvertent references to this section will trigger a link failure > if they occur in code that does not honour CONFIG_DEBUG_INFO_BTF. > > Note that Clang will notice that taking the address of__start_BTF cannot > yield NULL any longer, so testing for that condition is no longer > needed. > > Acked-by: Andrii Nakryiko > Signed-off-by: Ard Biesheuvel Acked-by: Arnd Bergmann