diff --git a/abi3audit/_object.py b/abi3audit/_object.py index f654f23..afdfc99 100644 --- a/abi3audit/_object.py +++ b/abi3audit/_object.py @@ -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):