diff options
author | W. J. van der Laan <laanwj@protonmail.com> | 2021-06-14 20:24:52 +0200 |
---|---|---|
committer | W. J. van der Laan <laanwj@protonmail.com> | 2021-06-14 20:31:58 +0200 |
commit | 19e598bab0a1cb5ad93321eb9fa25d1a58d5e276 (patch) | |
tree | 2f57b912276ed7602a1caddb1a9930afcdf2cf66 | |
parent | 3a2c84a6b5144f4ee1181373604133751b40d5ce (diff) |
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.
-rw-r--r-- | contrib/devtools/pixie.py | 2 |
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 |