Skip to content

Commit 19e598b

Browse files
committed
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.
1 parent 3a2c84a commit 19e598b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contrib/devtools/pixie.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ def _parse_verneed(section: Section, strings: bytes, eh: ELFHeader) -> Dict[int,
217217
result = {}
218218
while True:
219219
verneed = Verneed(data, ofs, eh)
220-
aofs = verneed.vn_aux
220+
aofs = ofs + verneed.vn_aux
221221
while True:
222222
vernaux = Vernaux(data, aofs, eh, strings)
223223
result[vernaux.vna_other] = vernaux.name

0 commit comments

Comments
 (0)