Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1283181lqp; Mon, 15 Apr 2024 01:13:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVewoTSjtoMhgNjNwWgdqMfTFTcqMGBO+LTW8sETn4gy5Z1vSiTKdxKlU1j4YZ2M1nXsyc5WnMxuq8PHMeVcd8ecNMj2Hi9PHkuCd6Vxg== X-Google-Smtp-Source: AGHT+IEmU76JwRngDs/1XphJp4yqQkWBwymL4zw1XGgskwOaCCLXfGZceZsa1FpsVTymGUA/2hHk X-Received: by 2002:a17:90b:1243:b0:2a5:bf83:8db8 with SMTP id gx3-20020a17090b124300b002a5bf838db8mr6684000pjb.4.1713168839438; Mon, 15 Apr 2024 01:13:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713168839; cv=pass; d=google.com; s=arc-20160816; b=CgX7thXNB/rh3m/jKUTg9XxSq0gFnhSjDs86uiIPc4yx78vr2KywCKu+V5bYu8LCW1 DhedDv1+nTOG0s/0FrNIvmFeVBSC1KAWx+XD4/18xq2Ifh+4k9SvtEuOq9WMtYtI2RUC ImoTWkfD6PQ5JhIxq09CBZMIPNcnIP7CwWJ24r7J/I6g0oL/6w4psUwp+tBjDTnIzYAj oAx/TY8gGpoR78hP/MUrJc/e0s29pRSdZYn12NTrW+xOQmCE5BidwDs3916woOLHRN9H wUfE2f+toRWA4PCLjCkNhXSxcLYvVYFX7zgCHQo0v9QV6guMKKMf3SDrbECO7HLHrsr6 Mx9A== 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=nirUBk2IWA4nfF0nBoVFV5ytdr6rujdVL1Z+GvYP3xQ=; fh=37SgqZs8NHw5UWa65nNC35xbN7HF32A7CKr0tgrvZK0=; b=tsQjiKAD02moE9g/KBRJahNYwFtvkd/kciQMIrE8sCJ2pf+HtPsbOgl4DrGenYGPEQ /q6UFSR3WPkshbvdysxKODmhiPajUdEnjyf+yl6kk3h3P+UZme1BDFiOvGbK3dgKkg1N hve3+aRrOw/MoPyC20h2B20qCsFQg+WyLbEWi/d0FXmAzSKqfsk7OqrtGdiUHlr4ZAYH 6AKPwIUVMnhDo6JjORUhwOR+GFVT9l6Yzp9OV+aSfj42o/Yxkf92zxU7L1I0tglRKm/B 0l7NGd2koVRoRy4FZZX8GWiTXvVlgs2ANI2O6IloaeGI5eCibYfSfkcK6qLdVk6KO7TM krQA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=k4qEGlA6; 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-144713-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-144713-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id bg24-20020a17090b0d9800b002a539f46c08si7731284pjb.39.2024.04.15.01.13.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 01:13:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-144713-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=k4qEGlA6; 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-144713-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-144713-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 5DCAAB24B55 for ; Mon, 15 Apr 2024 07:59:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6BEA73770C; Mon, 15 Apr 2024 07:58:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="k4qEGlA6" Received: from mail-wr1-f73.google.com (mail-wr1-f73.google.com [209.85.221.73]) (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 11F2136B1D for ; Mon, 15 Apr 2024 07:58:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713167931; cv=none; b=E/KAzuTqA+cApk4l2QbcsfCAKdUzjpx/kdy3G3sPxpNQii9opC7I0ibvdHM3vDGTMA+BMlJrX7ONV3B2HjMi87JRmfJMRvzX6euS8fDIsEDhgc1EMbUQaGgrQeQdx464+JSG/DsjRc8/TItxXLe5uBS9dKVOK1y9eAfP5XHixwk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713167931; c=relaxed/simple; bh=DkpORLakWw5z143JLN76w0dBh5hI4i2x8TQpiySZiJU=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=P1qot5c4ouzt2qy8rIJl64kb7cOphphe23dV7AitrtTEx03NiyRhg84olThxGkAU69+blZjA4pxWRN9spa7Vpr7+NB6/f7MkT1rBwTCa1Kb/pFASZJhjcqO+JasCupnYOEAIjFWQBAt0ddxYRC/eUL4E7hxjIMNFgoLfWEXPcl4= 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=k4qEGlA6; arc=none smtp.client-ip=209.85.221.73 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-wr1-f73.google.com with SMTP id ffacd0b85a97d-343bb240f70so2030570f8f.1 for ; Mon, 15 Apr 2024 00:58:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1713167928; x=1713772728; 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=nirUBk2IWA4nfF0nBoVFV5ytdr6rujdVL1Z+GvYP3xQ=; b=k4qEGlA6yPmLSRUWj3VhIDRGReCoCkra8/37M7U5wzOdaaDOGK7KtyjVh1URO70ByQ YK5CCqJ5/e2QQ87Hwdb9R4Lu3Fi+DKS3t7OFZRlS3b68GRtEHgTRYc03Vj+i8qwR1JgS 8oIfVBALC8OCOnvQGoSmsyJ5v1/1GCsLk7rbG02aSjb6oO6TODqx6WI6FJ+nNSDotOhQ +cIieU2ZTrsYZpkz6ffTJLAS5YtDe7U+VgjO45A4h5ZtrBiBQOs5PjvBTr1+FSrAAz7D 2Nj1ITgfvJZU+L8VwrE8Md5S6BXbDnlkDOWQZpXPuOQPyLfFJwY8S7OLxKqR3jDL9Zw2 9zfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713167928; x=1713772728; 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=nirUBk2IWA4nfF0nBoVFV5ytdr6rujdVL1Z+GvYP3xQ=; b=J3eUedzkta25tS6Zv51ft6wU4cfMt+NQNL+tNsXMqSDKsCmBl5dFKEYAqPCC0nt6CZ Kxynx3UlQKJx9E6zIZXcowl5IjohgBvOSg1VNJTxdb+lqrnrQIS7lobfBm17vgdslxij he4STMmSL1nua1r3dkyCOirvkaSXqJFx68x4DTpywYhmMIqcGowIl6J8u8oph2FgV49D vbbnRkX6l1+ODKhGWSUt7Q4zgfzGXNl9aO1cVXprGTsU6RoMb+n3X8r61Pp8iLAtuMx4 aOfT1r+j2RV0YQedSnrEKuBcv5HDYddkFwODFPchHDLJS4L+XOYre4mjZxZCml54Q3+d +n8g== X-Gm-Message-State: AOJu0YxPNg7p4PMClbgn5G+cAAQtUypEMBrXuRrF0TnI0JbNHeUbnBI6 Rt+9MiN786+QuzpB7vEyhbx1ipbQSgPBUNU9RAhOVKSHl83W4hM1w8ckL8vfdVcVVpOxZzV+xx0 7Vvtd0+gNWdvzJYqaI0D7h5kYXEjQlpa9cR2D6Ii4RU/DD56TR7VLTxv7R0nuOwPrbjyiNj0dwe 41jyWSBgoDQEmRE9SBUSwWWW88hwk/bQ== X-Received: from palermo.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:118a]) (user=ardb job=sendgmr) by 2002:adf:f2ca:0:b0:343:668b:be05 with SMTP id d10-20020adff2ca000000b00343668bbe05mr21274wrp.3.1713167928341; Mon, 15 Apr 2024 00:58:48 -0700 (PDT) Date: Mon, 15 Apr 2024 09:58:40 +0200 In-Reply-To: <20240415075837.2349766-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: <20240415075837.2349766-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=1659; i=ardb@kernel.org; h=from:subject; bh=iEnd1kipFuUW1SJUvbH5tb3oJXutwpN4deu2O40wcts=; b=owGbwMvMwCFmkMcZplerG8N4Wi2JIU3mnv7dQ+w3umb8jUpXzD++6X70lFcO50+yRerp3Fu1w u7gZeuEjlIWBjEOBlkxRRaB2X/f7Tw9UarWeZYszBxWJpAhDFycAjCRJ64Mf8XPzF71ff/fFSHP jscwXJcx+urf8D5r276S3g3vGGWPPznH8D+FlWu3ew9/xPHLtTaJmu9bXyRru679z7f1Z9muwK/ uMqwA X-Mailer: git-send-email 2.44.0.683.g7961c838ac-goog Message-ID: <20240415075837.2349766-7-ardb+git@google.com> Subject: [PATCH v3 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 , Jiri Olsa 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. Acked-by: Arnd Bergmann 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.683.g7961c838ac-goog