Add the RHEL 211.21.1..211.22.1 backports (1288-1351) from centos-stream-10 and upstream stable, on top of 211.20.1. Bump pkgrelease and specrelease to 211.22.1. (The redhat/ automotive rebuild-changelog tooling change is omitted: it patches redhat/scripts not present in this build base and does not affect the kernel.)
74 lines
2.7 KiB
Diff
74 lines
2.7 KiB
Diff
From 7d08b5aa28b2bdd1d1bedbd6e8722bf3799dce71 Mon Sep 17 00:00:00 2001
|
|
From: Jerome Marchand <jmarchan@redhat.com>
|
|
Date: Tue, 2 Jun 2026 15:56:31 +0200
|
|
Subject: [PATCH] scripts/sorttable: Allow matches to functions before function
|
|
entry
|
|
|
|
JIRA: https://redhat.atlassian.net/browse/RHEL-180193
|
|
|
|
commit dc208c69c033d3caba0509da1ae065d2b5ff165f
|
|
Author: Steven Rostedt <rostedt@goodmis.org>
|
|
Date: Tue Feb 25 13:20:08 2025 -0500
|
|
|
|
scripts/sorttable: Allow matches to functions before function entry
|
|
|
|
ARM 64 uses -fpatchable-function-entry=4,2 which adds padding before the
|
|
function and the addresses in the mcount_loc point there instead of the
|
|
function entry that is returned by nm. In order to find a function from nm
|
|
to make sure it's not an unused weak function, the entries in the
|
|
mcount_loc section needs to match the entries from nm. Since it can be an
|
|
instruction before the entry, add a before_func variable that ARM 64 can
|
|
set to 8, and if the mcount_loc entry is within 8 bytes of the nm function
|
|
entry, then it will be considered a match.
|
|
|
|
Cc: Masami Hiramatsu <mhiramat@kernel.org>
|
|
Cc: Mark Rutland <mark.rutland@arm.com>
|
|
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
|
|
Cc: Andrew Morton <akpm@linux-foundation.org>
|
|
Cc: Masahiro Yamada <masahiroy@kernel.org>
|
|
Cc: Catalin Marinas <catalin.marinas@arm.com>
|
|
Cc: Will Deacon <will@kernel.org>
|
|
Cc: "Arnd Bergmann" <arnd@arndb.de>
|
|
Cc: Mark Brown <broonie@kernel.org>
|
|
Link: https://lore.kernel.org/20250225182054.815536219@goodmis.org
|
|
Fixes: ef378c3b82338 ("scripts/sorttable: Zero out weak functions in mcount_loc table")
|
|
Tested-by: Nathan Chancellor <nathan@kernel.org>
|
|
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
|
|
|
|
Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
|
|
|
|
diff --git a/scripts/sorttable.c b/scripts/sorttable.c
|
|
index 07ad8116bc8d..7b4b3714b1af 100644
|
|
--- a/scripts/sorttable.c
|
|
+++ b/scripts/sorttable.c
|
|
@@ -611,13 +611,16 @@ static int add_field(uint64_t addr, uint64_t size)
|
|
return 0;
|
|
}
|
|
|
|
+/* Used for when mcount/fentry is before the function entry */
|
|
+static int before_func;
|
|
+
|
|
/* Only return match if the address lies inside the function size */
|
|
static int cmp_func_addr(const void *K, const void *A)
|
|
{
|
|
uint64_t key = *(const uint64_t *)K;
|
|
const struct func_info *a = A;
|
|
|
|
- if (key < a->addr)
|
|
+ if (key + before_func < a->addr)
|
|
return -1;
|
|
return key >= a->addr + a->size;
|
|
}
|
|
@@ -1253,6 +1256,8 @@ static int do_file(char const *const fname, void *addr)
|
|
#ifdef MCOUNT_SORT_ENABLED
|
|
sort_reloc = true;
|
|
rela_type = 0x403;
|
|
+ /* arm64 uses patchable function entry placing before function */
|
|
+ before_func = 8;
|
|
#endif
|
|
/* fallthrough */
|
|
case EM_386:
|
|
--
|
|
2.50.1 (Apple Git-155)
|
|
|