Skip to content

Commit

Permalink
_object: tweak comment
Browse files Browse the repository at this point in the history
Signed-off-by: William Woodruff <[email protected]>
  • Loading branch information
woodruffw committed Oct 7, 2022
1 parent 2b72105 commit e7470d5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions abi3audit/_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,16 @@ class _So(_SharedObjectBase):

def __iter__(self) -> Iterator[Symbol]:
with self._extractor.path.open(mode="rb") as io, ELFFile(io) as elf:
# The dynamic linker on Linux uses .dynsym, not .symtab, for
# link editing and relocation. However, an extension that was
# compiled as non-abi3 might have CPython functions inlined into
# it, and we'd like to detect those. As such, we scan both symbol
# tables.
symtab = elf.get_section_by_name(".symtab")
if symtab is not None:
for sym in symtab.iter_symbols():
yield Symbol(sym.name)

# NOTE: Experimentally, some versions of pyO3 create
# extensions with the symbols in .dynsym instead of .symtab.
dynsym = elf.get_section_by_name(".dynsym")
if dynsym is not None:
for sym in dynsym.iter_symbols():
Expand Down

0 comments on commit e7470d5

Please sign in to comment.