35 lines
1.1 KiB
Diff
35 lines
1.1 KiB
Diff
From 8a12d289a01988ec7e2de11ff7f697f63ef74987 Mon Sep 17 00:00:00 2001
|
|
From: ningyu <ningyu9@huawei.com>
|
|
Date: Mon, 27 May 2024 11:16:26 +0000
|
|
Subject: [PATCH] upatch-diff: fix lookup_relf duplicate failure
|
|
|
|
Signed-off-by: ningyu <ningyu9@huawei.com>
|
|
---
|
|
upatch-diff/running-elf.c | 8 +++++++-
|
|
1 file changed, 7 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/upatch-diff/running-elf.c b/upatch-diff/running-elf.c
|
|
index 25b72b7..18ff095 100644
|
|
--- a/upatch-diff/running-elf.c
|
|
+++ b/upatch-diff/running-elf.c
|
|
@@ -125,9 +125,15 @@ bool lookup_relf(struct running_elf *relf,
|
|
symbol = &relf->obj_syms[i];
|
|
sympos++;
|
|
|
|
- if (strcmp(symbol->name, lookup_sym->name) != 0) {
|
|
+ if (result->symbol != NULL && symbol->type == STT_FILE) {
|
|
+ break;
|
|
+ }
|
|
+
|
|
+ if (strcmp(symbol->name, lookup_sym->name) != 0 ||
|
|
+ symbol->bind != lookup_sym->bind) {
|
|
continue;
|
|
}
|
|
+
|
|
if ((result->symbol != NULL) &&
|
|
(result->symbol->bind == symbol->bind)) {
|
|
ERROR("Found duplicate symbol '%s' in %s",
|
|
--
|
|
2.34.1
|
|
|