Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2702845rdb; Mon, 12 Feb 2024 13:42:01 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWsJymeJWycODmQJkB1pT9yG5NZuk0j1tCc+lODQz7+xjbJUCyOziluZmMWtnJ63TtuV7DG44X2GpZwNSH7KA2b9Y0s0kKvhH/PD/nw1A== X-Google-Smtp-Source: AGHT+IEbtzZi6jBmA4BKRQ6bS8512exkYJj4Z5QQbS2t8oY3NIZaNtSNULRWYlaSeHNcD38IyEm2 X-Received: by 2002:a17:903:11c5:b0:1d0:b1f0:1005 with SMTP id q5-20020a17090311c500b001d0b1f01005mr8903977plh.63.1707774120863; Mon, 12 Feb 2024 13:42:00 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707774120; cv=pass; d=google.com; s=arc-20160816; b=g/RRO7wqawWRBvE2MuomoHVT5Vy1AyjDCkpNFTGI09NMCyRaWxEUBrhER7BMgbtRPn T6FbDPpE0j4dYf66VnUQcwhx5EqcJ1pq4S98QvJk3FHFgJgHWXgcFWEwvZ31gSnmFvhD CZosENf2qKJVpJeuuezUMkS+xmRv7aafVfQOSw/keu7DToXiEbtQ8VOYSf6wXH0Qbk7A pnVSv7MtnWu5kwPJQE3XPLOj6KijjMTfWemB37QUK2eeZMycxtFwo2lB5qkJnpSAHmtT hZpPKF94+4SvWikgWJq7n7vffNmrvIDgqtc2h8DhZYDwCDTQLB9O0NbroEzk85Mhu6Mk 07lA== 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=G9b+4SdACUtX02zckFp4W9j//70BE65Et6Qs8xfY7vk=; fh=wD3hf2dm2rsNoW/hOHZmokH45/eaOx68BM7mlp0S4qQ=; b=L5AVE5FQHfUKyo065UE2tA7uMR7FZPVw77C6ynUnzVMhIiHT2UCpFzajpjR1IgSUaJ yS1EmV8T7InbUIUBuQ8P4CXMN+RsTegKOjfhxow8OYBUVsYemInodat+zzUy2fqh3bR2 aGqfOVjbDpEe8i6CgXhNaVQenbd2gbSxsPDCn+SUKIhoM1GIgJMSPJqchMuD1KJaiu9q /SdF0UXn1XRuPX44yQHvB/HDFmwMfNMiyVI22etZRKuMIJGuPkIFUpqIUG3cOQAMkliy HgJxZNEysG6uZATRDcOkZxN0GStk/HtcxBTIS36SFXrTEdfCIcHOs5MQrBkc10YtVtsk 5wsQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="M/12o5m4"; arc=pass (i=1 spf=pass spfdomain=flex--surenb.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-62408-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62408-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com X-Forwarded-Encrypted: i=2; AJvYcCWyxJQCcsxLK8sdfTt+WbkguKDHhWiNzpSjA7msjGQlLIzHLfxd42KojdN77Lkra9SAuFjTHEJHmjEuUhrGcc9KuHZ/zG5S0XNTVKn70A== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 13-20020a170902c10d00b001d90a16c013si802171pli.616.2024.02.12.13.42.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 13:42:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-62408-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="M/12o5m4"; arc=pass (i=1 spf=pass spfdomain=flex--surenb.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-62408-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62408-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 34E84B244CD for ; Mon, 12 Feb 2024 21:40:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 22ECE4EB36; Mon, 12 Feb 2024 21:39:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="M/12o5m4" Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) (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 EADB04D9FC for ; Mon, 12 Feb 2024 21:39:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707773981; cv=none; b=Xtnixy3a7pPp0z5rcE9PfZlW9t/5DgrrLDjgFuTe63viKah+acoVwWkPsspDKWN6EdD6h5Qi4i+aRkFspJPtlsuZRn7LYzn3sBhX/zFu0Udc4m0FE3bpUAT7j5YfQt14vfWB1Pb7vxvV5EdX98JQIrw3vlIlhmAW5p85hY1CseI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707773981; c=relaxed/simple; bh=xFlCSB2BhnykCmQeRsN0j73C4UQlJIZav61x4g1IDdg=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=dfVQq9kMQmj6pXXZj1wvDNUrdL2CTku8BXW2yn03RCDqW06baEQj1TQ5Pmm2NrYD7+/4OvgWVrHdXSHYs6jGnzYriraKyRae9ns1HqaXp3JbdGADtZpcDW8hk+hmucCaRlb8jLjaKashLEjc/5elHRFFj0vADDy7T60rWL4clfI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--surenb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=M/12o5m4; arc=none smtp.client-ip=209.85.128.202 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--surenb.bounces.google.com Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-60779e8f67fso4370527b3.0 for ; Mon, 12 Feb 2024 13:39:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1707773977; x=1708378777; 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=G9b+4SdACUtX02zckFp4W9j//70BE65Et6Qs8xfY7vk=; b=M/12o5m4O5L7Cmffsgn+3ctDjJPoIyHgXvE3XohbdSYRip+xxol1RqJnieBh2IzGMa IDFtU90EoNVA82v18P0o/JWnTomPM6uY3ZQAPrr4ahvpyZMDM+dStxQlBD5eqVRlffgF snXt0E61LpPpNQ+XIhMNHZrgGIQeSOT0H4s4bTt2zOL2BAmWPW0WMIVI3taQ5KYC3WgQ vOC0dGwchTHXwYRDyWMILr6gMYkQrxa9+ZQNR3UQzbopOalvnHuoAosmbAWDeNx6txbq JjE9mAOFaYIen/RqAR4IL+CSiZDMxLttO3VY8u4Q5LDRwiraX7gghY0g3/Oi96/KNSBW 02Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707773977; x=1708378777; 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=G9b+4SdACUtX02zckFp4W9j//70BE65Et6Qs8xfY7vk=; b=fTlfRFWQehOOwQbBsIhZC7BQ3xSu1v9r9gn6LfIHU+zgtM0UHg38yiuW1LyCfhgy0y KeQYk8hzPiLTeblwNnsM1fYATevifZg4TyK8cVohb1cEHf2ADcDGDwucu+/C9C5yZNEb djxQDNMXlMeacx7Gfl8H0f6tWsZmwGaJi1gZ3nko5Srgec31yTCTLLzARtIQlG0cegJK TXemTpkM1Gj7rQNWOvhZbKe3B2ZyNa/HgJGy+ytx4p5W6QSOSW8F2ULNqmfqkUFaYQQv p//j4yhDULzJl7vPCYUlscuPUPJOxs+1BDCL8oZiCzQ46tUlMj+Cwaph/sK7Lvhcw0Da +k/Q== X-Forwarded-Encrypted: i=1; AJvYcCUZbGF+ZcFn4qTW8iYvIykwUzZThFJv5CkRschZiQDCBg0PqIIUoZGYGSB81kVmjwTYXN2C10tbfOSsUHaO481T6Q8fIBiFJcz5ThDu X-Gm-Message-State: AOJu0YwDRkNtQ+CLLZ8H5aHjBpt2coZvxenTAS2tP669kxj5cN0H92Gs AlEAqoKTn7HjMmoy2qhxtnywpo0xb1BMwIsPoGbSYKTihKk19JL1Mav2xO6sghs8RJK2K2n0rYI WMQ== X-Received: from surenb-desktop.mtv.corp.google.com ([2620:15c:211:201:b848:2b3f:be49:9cbc]) (user=surenb job=sendgmr) by 2002:a0d:d495:0:b0:607:7f86:dc24 with SMTP id w143-20020a0dd495000000b006077f86dc24mr109272ywd.3.1707773976926; Mon, 12 Feb 2024 13:39:36 -0800 (PST) Date: Mon, 12 Feb 2024 13:38:48 -0800 In-Reply-To: <20240212213922.783301-1-surenb@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240212213922.783301-1-surenb@google.com> X-Mailer: git-send-email 2.43.0.687.g38aa6559b0-goog Message-ID: <20240212213922.783301-3-surenb@google.com> Subject: [PATCH v3 02/35] scripts/kallysms: Always include __start and __stop symbols From: Suren Baghdasaryan To: akpm@linux-foundation.org Cc: kent.overstreet@linux.dev, mhocko@suse.com, vbabka@suse.cz, hannes@cmpxchg.org, roman.gushchin@linux.dev, mgorman@suse.de, dave@stgolabs.net, willy@infradead.org, liam.howlett@oracle.com, corbet@lwn.net, void@manifault.com, peterz@infradead.org, juri.lelli@redhat.com, catalin.marinas@arm.com, will@kernel.org, arnd@arndb.de, tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org, peterx@redhat.com, david@redhat.com, axboe@kernel.dk, mcgrof@kernel.org, masahiroy@kernel.org, nathan@kernel.org, dennis@kernel.org, tj@kernel.org, muchun.song@linux.dev, rppt@kernel.org, paulmck@kernel.org, pasha.tatashin@soleen.com, yosryahmed@google.com, yuzhao@google.com, dhowells@redhat.com, hughd@google.com, andreyknvl@gmail.com, keescook@chromium.org, ndesaulniers@google.com, vvvvvv@google.com, gregkh@linuxfoundation.org, ebiggers@google.com, ytcoode@gmail.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, bristot@redhat.com, vschneid@redhat.com, cl@linux.com, penberg@kernel.org, iamjoonsoo.kim@lge.com, 42.hyeyoo@gmail.com, glider@google.com, elver@google.com, dvyukov@google.com, shakeelb@google.com, songmuchun@bytedance.com, jbaron@akamai.com, rientjes@google.com, minchan@google.com, kaleshsingh@google.com, surenb@google.com, kernel-team@android.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux.dev, linux-arch@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-modules@vger.kernel.org, kasan-dev@googlegroups.com, cgroups@vger.kernel.org Content-Type: text/plain; charset="UTF-8" From: Kent Overstreet These symbols are used to denote section boundaries: by always including them we can unify loading sections from modules with loading built-in sections, which leads to some significant cleanup. Signed-off-by: Kent Overstreet Signed-off-by: Suren Baghdasaryan --- scripts/kallsyms.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c index 653b92f6d4c8..47978efe4797 100644 --- a/scripts/kallsyms.c +++ b/scripts/kallsyms.c @@ -204,6 +204,11 @@ static int symbol_in_range(const struct sym_entry *s, return 0; } +static bool string_starts_with(const char *s, const char *prefix) +{ + return strncmp(s, prefix, strlen(prefix)) == 0; +} + static int symbol_valid(const struct sym_entry *s) { const char *name = sym_name(s); @@ -211,6 +216,14 @@ static int symbol_valid(const struct sym_entry *s) /* if --all-symbols is not specified, then symbols outside the text * and inittext sections are discarded */ if (!all_symbols) { + /* + * Symbols starting with __start and __stop are used to denote + * section boundaries, and should always be included: + */ + if (string_starts_with(name, "__start_") || + string_starts_with(name, "__stop_")) + return 1; + if (symbol_in_range(s, text_ranges, ARRAY_SIZE(text_ranges)) == 0) return 0; -- 2.43.0.687.g38aa6559b0-goog