aboutsummaryrefslogtreecommitdiff
path: root/contrib/devtools
diff options
context:
space:
mode:
authorW. J. van der Laan <laanwj@protonmail.com>2021-06-14 20:24:52 +0200
committerW. J. van der Laan <laanwj@protonmail.com>2021-06-14 20:31:58 +0200
commit19e598bab0a1cb5ad93321eb9fa25d1a58d5e276 (patch)
tree2f57b912276ed7602a1caddb1a9930afcdf2cf66 /contrib/devtools
parent3a2c84a6b5144f4ee1181373604133751b40d5ce (diff)
downloadbitcoin-19e598bab0a1cb5ad93321eb9fa25d1a58d5e276.tar.xz
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.
Diffstat (limited to 'contrib/devtools')
-rw-r--r--contrib/devtools/pixie.py2
1 files changed, 1 insertions, 1 deletions
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