Skip to content

Commit

Permalink
_object: skip unknown ELF visibilities (#96)
Browse files Browse the repository at this point in the history
Signed-off-by: William Woodruff <[email protected]>
  • Loading branch information
woodruffw authored Jul 13, 2024
1 parent 76d9e66 commit 711940c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions abi3audit/_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class _So(_SharedObjectBase):
"""

def __iter__(self) -> Iterator[Symbol]:
def get_visibility(_sym: Any) -> Visibility:
def get_visibility(_sym: Any) -> Visibility | None:
elfviz: str = _sym.entry.st_info.bind
if elfviz == "STB_LOCAL":
return "local"
Expand All @@ -83,7 +83,8 @@ def get_visibility(_sym: Any) -> Visibility:
elif elfviz == "STB_WEAK":
return "weak"
else:
raise TypeError(f"unexpected ELF visibility value {elfviz!r}")
logger.warning(f"unexpected ELF visibility value {elfviz!r}")
return None

with self._extractor.path.open(mode="rb") as io, ELFFile(io) as elf:
# The dynamic linker on Linux uses .dynsym, not .symtab, for
Expand Down

0 comments on commit 711940c

Please sign in to comment.