• Home
  • Raw
  • Download

Lines Matching full:symbols

11 A script to help check binary dependencies and disallowed symbols in intermediate build files.
40 # Disallow list of prefixes for standard library symbols.
76 # Cached symbols dictionary.
96 """Read a set of symbols using the nm tool."""
114 nm: str, symbols: Dict[str, Symbol], object_file: Path, source_file: Path
116 """Scrape symbols from a binary object."""
119 if symbol not in symbols:
120 symbols[symbol] = Symbol(
127 if source_file in symbols[symbol].sources:
129 symbols[symbol].sources.append(source_file)
146 """Get the dynamic symbols required by a binary executable."""
158 """Demangle a collection of symbols using the cxxfilt tool."""
164 def check_disallowed_symbols(cxxfilt: str, symbols: Iterable[Symbol]) -> None:
165 """Check a collection of symbols for disallowed prefixes."""
166 for symbol in symbols:
173 """Return a dictionary of symbols scraped from build files"""
178 symbols = {}
198 get_object_symbols(nm, symbols, object_file_path, source_file_path)
200 symbols_cache = symbols
217 """Check that there are no disallowed symbols used in intermediate build files."""
218 symbols = get_cached_symbols(nm, build_root)
219 symbol_list = list(symbols.values())
231 for file, symbols in disallowed_by_file.items():
232 print(f"{file} contains disallowed symbols:")
233 for symbol in symbols:
246 """Check for dynamic symbols required by an executable, categorizing them from the
247 intermediate files that may have included those symbols.
249 symbols = get_cached_symbols(nm, build_root) if build_root is not None else {}
254 if symbols is not None and symbol in symbols:
255 dynamic_symbols.append(symbols[symbol])
273 print("Executable relies on the following dynamic symbols:")
274 for file, symbols in dynamic_by_file.items():
275 print(f"{file} contains dynamic symbols:")
276 for symbol in symbols:
300 description="A tool to help check binary dependencies and statically included symbols."
333 "--check-disallowed-symbols",
335 help="Check for usage of disallowed symbols",
340 help="Check for usage of dynamic symbols",
355 error("--buck-out flag must be specified when checking disallowed symbols")