Skip to content

Commit

Permalink
Revert "_object: filter non-external symbols in dylibs (#16)"
Browse files Browse the repository at this point in the history
This reverts commit 2b72105.
  • Loading branch information
woodruffw committed Oct 7, 2022
1 parent e7470d5 commit 224b780
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions abi3audit/_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,17 @@ def __iter__(self) -> Iterator[Symbol]:
raise SharedObjectError("shared object has no symbol table")

for symbol in symtab_cmd.symbols:
# We only care about symbols that have the external bit set,
# since these are the ones resolved when linking to CPython.
if not symbol.type & 0x01:
# TODO(ww): Do a better job of filtering here.
# The Mach-O symbol table includes all kinds of junk, including
# symbolic entries for debuggers. We should exclude all of
# these non-function/data entries, as well as any symbols
# that isn't marked as external (since we're linking against
# the Python interpreter for the ABI).
if (name := symbol.name) is None:
continue

# All symbols on macOS are prefixed with _; remove it.
yield Symbol(symbol.name[1:])
yield Symbol(name[1:])


class _Dll(_SharedObjectBase):
Expand Down

0 comments on commit 224b780

Please sign in to comment.