Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp2043237lqe; Tue, 9 Apr 2024 08:04:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV1Ev7TyoEjxHLDRmXOVK7TqWmfCc41BVRrtLKr0C7IChUySPtbkSp2byQkRIJcryccdsdCooC9LRx55/q+rwa6UUwdEwCxI1p9O1KrhA== X-Google-Smtp-Source: AGHT+IExBThB2Skt/4sbWmWoe3MztKoCZ/kymLRt5VmMtYmGf6em1V8p17J5KP7tO5NrcCj1LhHe X-Received: by 2002:a50:8711:0:b0:56c:be3:7cef with SMTP id i17-20020a508711000000b0056c0be37cefmr9855286edb.11.1712675055164; Tue, 09 Apr 2024 08:04:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712675055; cv=pass; d=google.com; s=arc-20160816; b=cMU5d/joyqEXpkHfdnlVavfQ+EPTUOakhSXG7H546ziEd3gk1zxnl6FnZPQ9AnwDSo Y2RiwPqtIX0SsYdhhnsO+RwhJPUnsU3XGOyQ+BOJqLr4PQVGLqbCqvIbhx/WEGkVzGUW Ff9g+LwrRwreynNFHAIPzhqPDEexBT09R5QumdiY+rpfMCR3lk4HoSq2MoCynehBwN58 9FbrHDzw1YhTUgfM1np+8Duh5e+jeyNzn6SgxeqAcF+P73dkA9AkOOradLocl9FBcb5E ExyHp+rLmvTcgKCivNJ1+niIpDvF60qbaGv4Qh8wXvMmsIkQ/VxsZGsvqC1v3LVuYdAu GpWA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:references:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to:date :dkim-signature; bh=24D5emD5FgWK1X1kR0N5gec4wW0lY0v4XxqAgq53xkE=; fh=MaAnUuq8iqXPiTVvqFB8Yae/m/Oex4hVT+gabuDSVzA=; b=liGXMPBq6FnmnE24kPyqr7lnBVUyZSlW8LuJ7geUk979n8HegX7u7sEQwz1MqIt7fZ rO5KOBP98tHRUNN1Ifz55WdDdk2AK3xaoyrez5ExTEnRQM9/eNHq61L3vhTsRsWscviD mkIkLMEFmEVHhD0yv/B4uxqXHT+PcIL2+z72oN7nK/PbLN827Fkn4blffHN/ZCduOeeA gU43jgQIXtzZArVr+sLk13CmSE3P4BL9L/wzh04bUVJqlJEShEToA6xpafswm+wb4d// oLTNGZe4/wHHaqTQUwtXYpAMP+RuN4DBuFX9/q6IdMgcjX5vfzw7bvy8rGH/qfaOqi5F ChxQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Nmjz20d3; arc=pass (i=1 spf=pass spfdomain=flex--ardb.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-137150-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137150-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id r20-20020a50aad4000000b0056c3e3a1293si4675224edc.66.2024.04.09.08.04.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 08:04:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-137150-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Nmjz20d3; arc=pass (i=1 spf=pass spfdomain=flex--ardb.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-137150-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137150-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 16A4F1F25EA9 for ; Tue, 9 Apr 2024 15:03:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7E78513342A; Tue, 9 Apr 2024 15:01:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Nmjz20d3" Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 89E7C132808 for ; Tue, 9 Apr 2024 15:01:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712674908; cv=none; b=k7wClJFC6n4rZpQeebN4m1dPU515v/VKLAruEWzVX5resDm8roMTIAr2QXq4Zhj3FCvRqZQbBUff/5RCXTK/ADuRqeUtEKgGuj7FxSB3oOA3a4eKV7k5U2zf4/a8Qdi9o56vt2zDG7j41wdcfoqV1mYQ5vcI0R4XBSHb4B7BFWs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712674908; c=relaxed/simple; bh=ne1nIh0Qwrvg61AZAr4OTz8Z0LGxASlvMGm2cM6SR1I=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=gxBRr9S5T7JebQJRlUM4RKeDCwGa78WHQfVgoQ3E/0qV4ygicgHOXOFD41xNr0+Q30X5PNYMjg06ucVP/oftvRlRKiO/7Po9vxzyukfYNpmtdbn4BBSc3RqvFKN6c+gGvn20G/inaW/5U6CFp1r1FGkeMCxNqk9gTOveAhZefYE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--ardb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=Nmjz20d3; arc=none smtp.client-ip=209.85.219.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--ardb.bounces.google.com Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-dd944567b6cso7435606276.2 for ; Tue, 09 Apr 2024 08:01:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1712674905; x=1713279705; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=24D5emD5FgWK1X1kR0N5gec4wW0lY0v4XxqAgq53xkE=; b=Nmjz20d33u9rLdxGdphKCSSWa8Z2ty3V/+CLOg5WSz0CFekw0qSm5qfxo81mFO1Pli 0FkXH2yjBZDcKnoydobfGzHkbR/F32YcPRHkphoe8fud7kYjjlMzxB6O8+HZK3d3WuHO RJR7P9T3Y0Db1GzXMWt+LSStmKLkVNcIwWXklaIn2plbesmwY31tXGm/Av+Tb/ZOHvGe 88X7fDsP35AroaSA4Lf5pX9xYwetQn2dFGmqtWRqF65pxpHR039dzHpWciflpnw3Za0Y BoLXMhPq0/c1VjtRnnMf9EjQkGC6Ss2/kZQf/66xLH00zAW1mAIZlVX+csPI6sOXvJcM xKrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712674905; x=1713279705; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=24D5emD5FgWK1X1kR0N5gec4wW0lY0v4XxqAgq53xkE=; b=jR1idj9DCq3UdQVg6lvODrFshvetG3qfzORTP5mnHzuvqzxNJLdibD6jvg4NjLAt49 rxjq7XTVuo98i3696oFqT8lrfh9zTH8NF6sGFCavtOPIKiV/Iif6qVfDFtMu9DAhKXpS d81lVGtUPTsPmldskU9jFHmiKCVgxiAMi++J3tXFSprZcPwisi9ok38eyaLTkpkivKpe 6JMzx2L8Yaj52SlzTgeRWOkCB1eNBHUm7p405ol9UgafoqeS80jDaddQuTCZVTk7CAqW XCgvok2g3oVJku+Y8A+BddI1XDXoVJhjUOMMVFbgQdNihmv9EgXvWYpuBd1qPadlfKi0 FTVw== X-Gm-Message-State: AOJu0Yzw5KymBtKgoUQtWXvfS6tNPsPak37Tnkaya18ZuUy7jw2Vcl52 /9BeSGQgnISJpa69HHcbam/6zxUVP0reB+sHJsmq7sTy2kRHKwAbP+Y+J3RdENKeA7RauvVp/+X BJtaoySiIbW/4oaMWetvUSU9rp0Jv6m4te0iW7dZELGfJvM6fLG+LQJ5t8nNC4yEAvo2UhZNDUn XcK/UxAGvumCS8MLgoQ7yORxdPgSmCcw== X-Received: from palermo.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:118a]) (user=ardb job=sendgmr) by 2002:a05:6902:1082:b0:dd9:2d94:cd8a with SMTP id v2-20020a056902108200b00dd92d94cd8amr926332ybu.9.1712674905221; Tue, 09 Apr 2024 08:01:45 -0700 (PDT) Date: Tue, 9 Apr 2024 17:01:35 +0200 In-Reply-To: <20240409150132.4097042-5-ardb+git@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240409150132.4097042-5-ardb+git@google.com> X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 X-Developer-Signature: v=1; a=openpgp-sha256; l=1618; i=ardb@kernel.org; h=from:subject; bh=ORZChgCpQukYWaId1hq+FAluQSgY7FsL4Hz5iVd1jE8=; b=owGbwMvMwCFmkMcZplerG8N4Wi2JIU00wp9pL9M1t7Sty6RbsvftP5R05JPTl/bSvhflPYdjj uy5XCjfUcrCIMbBICumyCIw+++7nacnStU6z5KFmcPKBDKEgYtTACZic56R4eKb17tar+vu7Z2R ts6cJfreoohXvLd4uqbeXs1usvGY6R+G/+nnFziwnjNYNonhd07J3e9rEjaJan0+WCn35czN9MM cYhwA X-Mailer: git-send-email 2.44.0.478.gd926399ef9-goog Message-ID: <20240409150132.4097042-7-ardb+git@google.com> Subject: [PATCH v2 2/3] vmlinux: Avoid weak reference to notes section From: Ard Biesheuvel To: linux-kernel@vger.kernel.org Cc: Ard Biesheuvel , Masahiro Yamada , Arnd Bergmann , Martin KaFai Lau , linux-arch@vger.kernel.org, linux-kbuild@vger.kernel.org, bpf@vger.kernel.org, Andrii Nakryiko Content-Type: text/plain; charset="UTF-8" From: Ard Biesheuvel Weak references are references that are permitted to remain unsatisfied in the final link. This means they cannot be implemented using place relative relocations, resulting in GOT entries when using position independent code generation. The notes section should always exist, so the weak annotations can be omitted. Signed-off-by: Ard Biesheuvel --- kernel/ksysfs.c | 4 ++-- lib/buildid.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c index 495b69a71a5d..07fb5987b42b 100644 --- a/kernel/ksysfs.c +++ b/kernel/ksysfs.c @@ -228,8 +228,8 @@ KERNEL_ATTR_RW(rcu_normal); /* * Make /sys/kernel/notes give the raw contents of our kernel .notes section. */ -extern const void __start_notes __weak; -extern const void __stop_notes __weak; +extern const void __start_notes; +extern const void __stop_notes; #define notes_size (&__stop_notes - &__start_notes) static ssize_t notes_read(struct file *filp, struct kobject *kobj, diff --git a/lib/buildid.c b/lib/buildid.c index 898301b49eb6..7954dd92e36c 100644 --- a/lib/buildid.c +++ b/lib/buildid.c @@ -182,8 +182,8 @@ unsigned char vmlinux_build_id[BUILD_ID_SIZE_MAX] __ro_after_init; */ void __init init_vmlinux_build_id(void) { - extern const void __start_notes __weak; - extern const void __stop_notes __weak; + extern const void __start_notes; + extern const void __stop_notes; unsigned int size = &__stop_notes - &__start_notes; build_id_parse_buf(&__start_notes, vmlinux_build_id, size); -- 2.44.0.478.gd926399ef9-goog