From 19e598bab0a1cb5ad93321eb9fa25d1a58d5e276 Mon Sep 17 00:00:00 2001 From: "W. J. van der Laan" Date: Mon, 14 Jun 2021 20:24:52 +0200 Subject: devtools: Fix verneed section parsing in pixie I misunderstood the ELF specification for version symbols (verneed): The `vn_aux` pointer is relative to the main verneed record, not the start of the section. This caused many symbols to not be versioned properly in the return value of `elf.dyn_symbols`. This was discovered in #21454. Fix it by correcting the offset computation. --- contrib/devtools/pixie.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contrib/devtools/pixie.py') diff --git a/contrib/devtools/pixie.py b/contrib/devtools/pixie.py index 8cf06a799a..64660968ad 100644 --- a/contrib/devtools/pixie.py +++ b/contrib/devtools/pixie.py @@ -217,7 +217,7 @@ def _parse_verneed(section: Section, strings: bytes, eh: ELFHeader) -> Dict[int, result = {} while True: verneed = Verneed(data, ofs, eh) - aofs = verneed.vn_aux + aofs = ofs + verneed.vn_aux while True: vernaux = Vernaux(data, aofs, eh, strings) result[vernaux.vna_other] = vernaux.name -- cgit v1.2.3