Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp1208577lqt; Sat, 20 Apr 2024 05:32:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV/StB0fxZBYaprYlz29l5XTk/7bXmA2qk2ltUB92KwvLCwj09Toge/Tj7Tj935AlfuD48eZskZT2OOp5KoIUS7PlT88QoG9w2bqqYVzQ== X-Google-Smtp-Source: AGHT+IGMAJYI5ijRH60e64rGeGAlAy8qQ5A3ks9KSnsq9iZKqNtq/k3brf6tu3nqXvp7dgMD8o+Q X-Received: by 2002:a05:6e02:dd2:b0:36b:ffc4:cd1d with SMTP id l18-20020a056e020dd200b0036bffc4cd1dmr3640508ilj.5.1713616357998; Sat, 20 Apr 2024 05:32:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713616357; cv=pass; d=google.com; s=arc-20160816; b=jlPRfU+3zsC4WJ5MFAYCCfSRCjxq0kgmUjOqT5zn9zwz45vWZi1hhugj2rj+uD2qvC s4r81Zoc5gV7AW9wvpA0tiMbBfPEzvONIbBzVt/noNjf/unrOm2ztjtSshk3vX+nR1GV Eo372F1kB/rEcrlavjCkijpwV9E01z8uDNSZ3ieQa7vj8NKBaUCBq+vLs32IAEaIzGMC rFzYNWQxF5RaoxkGg6TnblqybCL+lVobgcoin2xboEg+VyrgYcqZcSwUSDfysXrZEu2e BjZtRq1HFcH8z/HhIuxrNtZva6WHR/AWeZ4DkOOSKy6YoUo0+uM/1acL7uC5K8c6D7MM QttQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=umLVUat47ISOZ+lqQiiXCflWZGQMxxABCCe4InJyCUU=; fh=c6FpHsnkKdNSkM2Q756QcpVdhDvfjr/THxXrOTokG54=; b=fWvrjjl/d2ZLXFBSB2MD8XRK5FujFPmWgH9k7wF0t2J5LRrgHJNxhWOJJTRAAKJFaG GeHLl1+OiV0FNlSxrcUs3PKbjNpUoH4O5ETyw+zbfBwCnpMJNZWxoE0Zx0lgrSH9n0Uo /g2O1DO543OZjfkD56s2K2xn3q4PF0UMPdBPLd8wXLCbm+3Ew88Sjwz+uUSyM82USs4/ 1jn9WPlAkFxyGy43Jvt56kxceWvPFijkgLopj2hRLHAQovm2w2A7QQPBqm0devu0GsRT srDdJJq21KFiPaXP3cBnaqQkQk7raTtlzqRU4OQ2F54e0x7jJ4l+ktqXIjaZzUV1JdVJ X2eg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=h2RhZd5S; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-152258-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152258-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id h25-20020a635319000000b005dc833ef4e6si4695482pgb.75.2024.04.20.05.32.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Apr 2024 05:32:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-152258-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=h2RhZd5S; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-152258-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152258-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 0D8BEB213A2 for ; Sat, 20 Apr 2024 12:32:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 591B817735; Sat, 20 Apr 2024 12:32:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="h2RhZd5S" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 75760625; Sat, 20 Apr 2024 12:32:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713616342; cv=none; b=LDd70CL4uMsBbLCPM3mMPwR0qMw4SMpB0TrGDydWxIyG4MRUxhpGUU0xSvO4O9TdFJX7LQ8i/4ylBAeuT1E2gDeSYlMAJHMwN4Z7OiL+Mgi+PFanJrPJzEs8iNU/XeJBvKlXhYqZfhDcaUBXMeD9jjWbrxRyRkFwshD95Jt63iE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713616342; c=relaxed/simple; bh=7ydtcwqOMK/ZievWeOZ4+j7tWKbe2GkJ8dG2UAyB0zU=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=HrnQxvwOJEq8aOEqTKg0VrpSI0iKGJXC9v+/gaxmQdLylnOmBus4W9Vh5K1hF1WKPtV4kIlOwq6dqt31+scEcLxM5xZUcty8lCkzz4BvHNf+HDpJUqzimn1OyZL5k+7BddLFpsQDGWqX5Cj8nyNpGK56ya3/hdWIEb6MvoDpsaI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=h2RhZd5S; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA615C4AF07; Sat, 20 Apr 2024 12:32:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713616342; bh=7ydtcwqOMK/ZievWeOZ4+j7tWKbe2GkJ8dG2UAyB0zU=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=h2RhZd5S6r1eHwiOPL1Ypvzjp0yGfFii/fNo3JHIWW3SfTcp873mazjsH+MXLEtda 28E2c1Yz8gmXG2v/lv6P6hn6agXCTIKPAX+V8bvqdUMZ4XOtB5BIOkhueaflWVjYPL 0sIFGx3jSVW44TUHHTfK5+Ujk/bt9qsuVc8y+9AqLa38EXg23uvHV0nQQ6qjWG0jqU hTInwU5rtBUqDW1C/+FxUiT/+convJHYdV3UEB1iB1uSTnGhShgGrqL/Oc+qeEJq/3 il3ODajwPsqNVTkG+wlI5WMbLDD+XaQ0Ip8M1wOY0s7v9ARNvJKtGk1AaqjIDq+OhU vnH89d4RCi5Xg== Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-51ab47ce811so2203984e87.1; Sat, 20 Apr 2024 05:32:21 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCVudO6NH6NdmjpL20CLV8PNLY3/Yjw7b/MreugcH0OpMgICHLmKXU7SUFpBTgriFZxuvMs/J9tFwAIh4Sumb6p7sYIgJ+yOFgME9E/3LziKTijYWKexuvP77Ad/2mh3wB795hU/4TBcS6XxxdNGlLL6A89MJDIwWsSBcFrPXzDfUkMw9S8td0IlkiwkpATHiNtoKIZUzTnvsLnFLA== X-Gm-Message-State: AOJu0Yy1rBJgSQqUdA7RQGs/Bp7ubLv9fWXNqMzpwhOD9xDSNpdCBLtS b5I6bBmaJD5yv4G3Xauuqh8WRPFu4PmiWhbctezFOeh6j88oFL4L/l+Lz8KgKp/gjHvbfipSKLf qMv6BZtOn7PLEdgdh1iB+8Uv3Cnw= X-Received: by 2002:a05:6512:ea4:b0:51a:e03a:aa15 with SMTP id bi36-20020a0565120ea400b0051ae03aaa15mr1670235lfb.5.1713616340582; Sat, 20 Apr 2024 05:32:20 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240415162041.2491523-5-ardb+git@google.com> <171327842741.29461.3030265084386428643.git-patchwork-notify@kernel.org> In-Reply-To: From: Masahiro Yamada Date: Sat, 20 Apr 2024 21:31:44 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 0/3] kbuild: Avoid weak external linkage where possible To: Ard Biesheuvel Cc: patchwork-bot+netdevbpf@kernel.org, Ard Biesheuvel , linux-kernel@vger.kernel.org, arnd@arndb.de, martin.lau@linux.dev, linux-arch@vger.kernel.org, linux-kbuild@vger.kernel.org, bpf@vger.kernel.org, andrii@kernel.org, olsajiri@gmail.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Apr 19, 2024 at 4:57=E2=80=AFPM Ard Biesheuvel wr= ote: > > On Tue, 16 Apr 2024 at 16:40, wrote: > > > > Hello: > > > > This series was applied to bpf/bpf-next.git (master) > > by Daniel Borkmann : > > > > On Mon, 15 Apr 2024 18:20:42 +0200 you wrote: > > > From: Ard Biesheuvel > > > > > > Weak external linkage is intended for cases where a symbol reference > > > can remain unsatisfied in the final link. Taking the address of such = a > > > symbol should yield NULL if the reference was not satisfied. > > > > > > Given that ordinary RIP or PC relative references cannot produce NULL= , > > > some kind of indirection is always needed in such cases, and in posit= ion > > > independent code, this results in a GOT entry. In ordinary code, it i= s > > > arch specific but amounts to the same thing. > > > > > > [...] > > > > Here is the summary with links: > > - [v4,1/3] kallsyms: Avoid weak references for kallsyms symbols > > (no matching commit) > > - [v4,2/3] vmlinux: Avoid weak reference to notes section > > (no matching commit) > > - [v4,3/3] btf: Avoid weak external references > > https://git.kernel.org/bpf/bpf-next/c/fc5eb4a84e4c > > > > > Thanks. > > Masahiro, could you pick up patches #1 and #2 please? > I do not like PROVIDE() because it potentially shifts a build error (i.e. link error) into a run-time error, which is usually more difficult to debug than build error. If someone references the kallsyms_* symbols when CONFIG_KALLSYMS=3Dn, it is likely a mistake. In general, it should be reported as a link error. With PROVIDE() added, we will never detect it at a build time. Do you want me to pick up 1/3? -- Best Regards Masahiro Yamada