Scrape symbols from a binary object.
(
nm: str, symbols: Dict[str, Symbol], object_file: Path, source_file: Path
)
| 111 | |
| 112 | |
| 113 | def get_object_symbols( |
| 114 | nm: str, symbols: Dict[str, Symbol], object_file: Path, source_file: Path |
| 115 | ) -> None: |
| 116 | """Scrape symbols from a binary object.""" |
| 117 | symbol_table = read_nm(nm, object_file) |
| 118 | for t, symbol in symbol_table: |
| 119 | if symbol not in symbols: |
| 120 | symbols[symbol] = Symbol( |
| 121 | mangled=symbol, |
| 122 | demangled="", |
| 123 | defined=(t != "U"), |
| 124 | disallowed=False, |
| 125 | sources=[], |
| 126 | ) |
| 127 | if source_file in symbols[symbol].sources: |
| 128 | continue |
| 129 | symbols[symbol].sources.append(source_file) |
| 130 | |
| 131 | |
| 132 | def get_elf_dependencies(readelf: str, binary_file: Path) -> List[str]: |
no test coverage detected