Skip to contentSkip to conversation

scripts-kallysms-always-include-__start-and-__stop-symbols.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Apr 26, 2024

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: scripts/kallysms: always include __start and __stop symbols
has been removed from the -mm tree. Its filename was
scripts-kallysms-always-include-__start-and-__stop-symbols.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Kent Overstreet <[email protected]>
Subject: scripts/kallysms: always include __start and __stop symbols
Date: Thu, 21 Mar 2024 09:36:26 -0700

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.

Cc Alexander Viro <[email protected]>
Cc Alex Gaynor <[email protected]>
Cc Alice Ryhl <[email protected]>
Cc Andreas Hindborg <[email protected]>
Cc Benno Lossin <[email protected]>
Cc "Björn Roy Baron" <[email protected]>
Cc Boqun Feng <[email protected]>
Cc Christoph Lameter <[email protected]>
Cc Dennis Zhou <[email protected]>
Cc Gary Guo <[email protected]>
Cc Miguel Ojeda <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Tejun Heo <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Wedson Almeida Filho <[email protected]>

---

 scripts/kallsyms.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)
scripts/kallsyms.c renamed from scripts/kallsyms.c~scripts-kallysms-always-include-__start-and-__stop-symbols +13 -0
@@ -204,6 +204,11 @@ static int symbol_in_range(const struct
 	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
 	/* 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;

_

Patches currently in -mm which might be from [email protected] are