MCPcopy Create free account
hub / github.com/pytorch/executorch / get_object_symbols

Function get_object_symbols

scripts/check_binary_dependencies.py:113–129  ·  view source on GitHub ↗

Scrape symbols from a binary object.

(
    nm: str, symbols: Dict[str, Symbol], object_file: Path, source_file: Path
)

Source from the content-addressed store, hash-verified

111
112
113def 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
132def get_elf_dependencies(readelf: str, binary_file: Path) -> List[str]:

Callers 1

get_cached_symbolsFunction · 0.85

Calls 3

read_nmFunction · 0.85
SymbolClass · 0.85
appendMethod · 0.45

Tested by

no test coverage detected