llvm-project/lldb/lit/SymbolFile
Nico Weber 8883ec7da2 Add support for deterministically linked binaries on macOS to lldb.
When ld64 links a binary deterministically using the flag ZERO_AR_DATE,
it sets a timestamp of 0 for N_OSO members in the symtab section, rather
than the usual last modified date of the object file. Prior to this
patch, lldb would compare the timestamp from the N_OSO member against
the last modified date of the object file, and skip loading the object
file if there was a mismatch. This patch updates the logic to ignore the
timestamp check if the N_OSO member has timestamp 0.

The original logic was added in https://reviews.llvm.org/rL181631 as a
safety check to avoid problems when debugging if the object file was out
of date. This was prior to the introduction of deterministic build in
ld64. lld still doesn't support deterministic build.

Other code in llvm already relies on and uses the assumption that a
timestamp of 0 means deterministic build. For example, commit
9ccfddc39d adds similar timestamp checking
logic to dsymutil, but special cases timestamp 0. Likewise, commit
0d1bb79a04 adds a long comment describing
deterministic archive, which mostly uses timestamp 0 for determinism.

Patch from Erik Chen <erikchen@chromium.org>!

Differential Revision: https://reviews.llvm.org/D65826

llvm-svn: 368199
2019-08-07 19:29:04 +00:00
..
Breakpad [FuncUnwinders] Use "symbol file" unwind plans for unwinding 2019-05-24 09:54:39 +00:00
DWARF Add support for deterministically linked binaries on macOS to lldb. 2019-08-07 19:29:04 +00:00
Inputs Fix lookup of symbols at the same address with no size vs. size 2019-07-01 14:31:26 +00:00
NativePDB Changing representation of .cv_def_range directives in Codeview debug info assembly format for better readability 2019-08-05 14:16:58 +00:00
PDB Fix PDB tests after r367820 2019-08-05 11:29:01 +00:00
sizeless-symbol.test Fix lookup of symbols at the same address with no size vs. size 2019-07-01 14:31:26 +00:00
target-symbols-add-unwind.test [lldb] [lit/SymbolFile] Avoid -nostdlib in target-symbols-add-unwind.test 2019-04-13 09:49:39 +00:00