54dc0a
From b479edd20f6083c65cda9c9277cc54cc56ce0939 Mon Sep 17 00:00:00 2001
54dc0a
From: Song Liu <song@kernel.org>
54dc0a
Date: Wed, 15 Mar 2023 11:21:31 -0700
54dc0a
Subject: [PATCH 107/107] kpatch-build: skip more symbols in locals_match
54dc0a
54dc0a
Skip table_sym  with maybe_discarded_sym() == true. This is probably only
54dc0a
needed for LTO build.
54dc0a
54dc0a
Signed-off-by: Song Liu <song@kernel.org>
54dc0a
---
54dc0a
 kpatch-build/lookup.c | 4 ++++
54dc0a
 1 file changed, 4 insertions(+)
54dc0a
54dc0a
diff --git a/kpatch-build/lookup.c b/kpatch-build/lookup.c
54dc0a
index 2ccc181..c8844f8 100644
54dc0a
--- a/kpatch-build/lookup.c
54dc0a
+++ b/kpatch-build/lookup.c
54dc0a
@@ -107,6 +107,8 @@ static bool locals_match(struct lookup_table *table, int idx,
54dc0a
 		if (table_sym->type != STT_FUNC && table_sym->type != STT_OBJECT)
54dc0a
 			continue;
54dc0a
 
54dc0a
+		if (maybe_discarded_sym(table_sym->name))
54dc0a
+			continue;
54dc0a
 		found = 0;
54dc0a
 		sym = file_sym;
54dc0a
 		list_for_each_entry_continue(sym, sym_list, list) {
54dc0a
@@ -115,6 +117,8 @@ static bool locals_match(struct lookup_table *table, int idx,
54dc0a
 			if (sym->bind != STB_LOCAL)
54dc0a
 				continue;
54dc0a
 
54dc0a
+			if (maybe_discarded_sym(sym->name))
54dc0a
+				continue;
54dc0a
 			if (sym->type == table_sym->type &&
54dc0a
 			    !strcmp(sym->name, table_sym->name)) {
54dc0a
 				found = 1;
54dc0a
-- 
54dc0a
2.37.3
54dc0a