Blob Blame History Raw
From b479edd20f6083c65cda9c9277cc54cc56ce0939 Mon Sep 17 00:00:00 2001
From: Song Liu <song@kernel.org>
Date: Wed, 15 Mar 2023 11:21:31 -0700
Subject: [PATCH 107/112] kpatch-build: skip more symbols in locals_match

Skip table_sym  with maybe_discarded_sym() == true. This is probably only
needed for LTO build.

Signed-off-by: Song Liu <song@kernel.org>
---
 kpatch-build/lookup.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/kpatch-build/lookup.c b/kpatch-build/lookup.c
index 2ccc181..c8844f8 100644
--- a/kpatch-build/lookup.c
+++ b/kpatch-build/lookup.c
@@ -107,6 +107,8 @@ static bool locals_match(struct lookup_table *table, int idx,
 		if (table_sym->type != STT_FUNC && table_sym->type != STT_OBJECT)
 			continue;
 
+		if (maybe_discarded_sym(table_sym->name))
+			continue;
 		found = 0;
 		sym = file_sym;
 		list_for_each_entry_continue(sym, sym_list, list) {
@@ -115,6 +117,8 @@ static bool locals_match(struct lookup_table *table, int idx,
 			if (sym->bind != STB_LOCAL)
 				continue;
 
+			if (maybe_discarded_sym(sym->name))
+				continue;
 			if (sym->type == table_sym->type &&
 			    !strcmp(sym->name, table_sym->name)) {
 				found = 1;
-- 
2.45.1