From 711940c9b8eff389b5ab6b33c75b195fca843e45 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Sat, 13 Jul 2024 15:40:01 -0400 Subject: [PATCH] _object: skip unknown ELF visibilities (#96) Signed-off-by: William Woodruff --- abi3audit/_object.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/abi3audit/_object.py b/abi3audit/_object.py index f43adc8..88356d5 100644 --- a/abi3audit/_object.py +++ b/abi3audit/_object.py @@ -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" @@ -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