[all-commits] [llvm/llvm-project] f0a5af: Merge in symbols from Mach-O dyld trie to the symb...

Jason Molenda via All-commits all-commits at lists.llvm.org
Fri Mar 27 22:53:36 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: f0a5af906b41b654ef0c71dee5f81bf7496524b2
      https://github.com/llvm/llvm-project/commit/f0a5af906b41b654ef0c71dee5f81bf7496524b2
  Author: Jason Molenda <jason at molenda.com>
  Date:   2020-03-27 (Fri, 27 Mar 2020)

  Changed paths:
    M lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
    A lldb/test/API/macosx/dyld-trie-symbols/Makefile
    A lldb/test/API/macosx/dyld-trie-symbols/TestDyldTrieSymbols.py
    A lldb/test/API/macosx/dyld-trie-symbols/main.cpp

  Log Message:
  -----------
  Merge in symbols from Mach-O dyld trie to the symbol table

In ObjectFileMachO we construct the symbol table from multiple
sources -- primarily the binary's nlist records, but when the nlist
symbols have been stripped, we would augment those with function
start address from the LC_FUNCTION_STARTS or eh_frame.  This patch
adds another source of symbols - the exported symbols that the
dynamic linker, dyld, uses at runtime from its trie structure.  This
provides us names and addresses for these functions/data.

This patch removes the code from ParseSymtab that would reject an
empty symbol table / nlist source.  It adds a new symbols_added
set which tracks the address of every symbol we've added to the
symtab.  We add symbols in most-information-ful order, and before
adding a symbol from less-informational-ful source (e.g.
LC_FUNCTION_STARTS with no function name), we check if that symbol
has already been added.

On targets with thumb code generation, instead of using the 0th bit
in these addresses in FunctionStarts (or now the trie entries), we
use the data field of FunctionStarts (formerly used to track if the
func_start should be added) and a flag for the trie entries to
encode this, and only store the actual addresses in the symbols_seen
and these vectors.

<rdar://problem/50791451>

Differential revision: https://reviews.llvm.org/D76758




More information about the All-commits mailing list