diff mbox series

[fyi,1/1] dwarf_loader: Add missing cus__add(cus, cu) to cus__merge_and_process_cu()

Message ID ZnGZ71a4E29kPrvS@x1 (mailing list archive)
State Not Applicable
Headers show
Series [fyi,1/1] dwarf_loader: Add missing cus__add(cus, cu) to cus__merge_and_process_cu() | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Arnaldo Carvalho de Melo June 18, 2024, 2:30 p.m. UTC
Just FYI, I added this on top of the previous one initializing cu->node.

Tested with that cast_common.ko and the vmlinux you made available.

- Arnaldo

---

In cus__finalize() if cu__finalize() returns LSK__DELETE, i.e. if the
tool processing the cu is done with it, we will assume that it is in the
cus list of cu instances, remove it and then delete it.

This was not being done by cus__merge_and_process_cu(), used when
merging all DWARF CUs into a single 'struct cu', such as when processing
binaries generated by clang using LTO. Add the missing cus__add() to
keep cus->nr_entries consistent.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 dwarf_loader.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/dwarf_loader.c b/dwarf_loader.c
index b832c93cc2194eaf..3caf32457f42ec2e 100644
--- a/dwarf_loader.c
+++ b/dwarf_loader.c
@@ -3452,6 +3452,7 @@  static int cus__merge_and_process_cu(struct cus *cus, struct conf_load *conf,
 			cu->priv = dcu;
 			cu->dfops = &dwarf__ops;
 			cu->language = attr_numeric(cu_die, DW_AT_language);
+			cus__add(cus, cu);
 		}
 
 		Dwarf_Die child;