SuccessChanges

Changes from Git (git http://labmaster3.local/git/llvm-project.git)

Summary

  1. [sanitizer] Enable whitelist/blacklist in new PM (details)
  2. [lld-macho] Follow-up to D77893 (details)
  3. [lld-macho] Support calls to functions in dylibs (details)
  4. [lld-macho] Dylib symbols should always replace undefined symbols (details)
  5. [lld-macho] Use export trie instead of symtab when linking against dylibs (details)
  6. [lld-macho] Support pc-relative section relocations (details)
  7. Add missing pass initialization (details)
Commit a72b9dfd45cdbe079a2a48b4d1e0b83a7f3a95bd by Jinsong Ji
[sanitizer] Enable whitelist/blacklist in new PM

https://reviews.llvm.org/D63616 added `-fsanitize-coverage-whitelist`
and `-fsanitize-coverage-blacklist` for clang.

However, it was done only for legacy pass manager.
This patch enable it for new pass manager as well.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D79653
The file was modifiedllvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
The file was modifiedllvm/include/llvm/Transforms/Instrumentation/SanitizerCoverage.h
The file was modifiedclang/lib/CodeGen/BackendUtil.cpp
The file was modifiedcompiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_whitelist_blacklist.cpp
Commit db157d27337fcd13017051d125bf6e1439138da1 by jezng
[lld-macho] Follow-up to D77893

Summary:
1. Don't have isHidden() depend on isNeeded(). Whether a section is
  hidden is orthogonal from whether it is needed: hidden sections will
  never have a header regardless of whether they have a body. (I know we
  override this method with return false for synthetic sections, but
  regardless I think it's confusing to write it this way for non-synthetic
  sections.)

2. Don't call writeTo() on unneeded sections. D78270 assumes that this
  is true when implementing the stub helper section.

3. Filter out the unneeded sections early on to avoid having to deal
   with them in multiple places.

4. Remove assumption in test that the referenced file has no other symbols.
  (We should create separate input files for future tests to avoid such
  issues.)

Reviewers: ruiu, pcc, MaskRay, smeenai, alexshap, gkm, Ktwu, christylee

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79460
The file was modifiedlld/MachO/OutputSegment.h
The file was modifiedlld/MachO/Writer.cpp
The file was modifiedlld/MachO/OutputSegment.cpp
The file was modifiedlld/MachO/OutputSection.h
The file was modifiedlld/test/MachO/section-merge.s
Commit b3e2fc931d2e06560cc8c1640e006aa25ff1ef5a by jezng
[lld-macho] Support calls to functions in dylibs

Summary:
This diff implements lazy symbol binding -- very similar to the PLT
mechanism in ELF.

ELF's .plt section is broken up into two sections in Mach-O:
StubsSection and StubHelperSection. Calls to functions in dylibs will
end up calling into StubsSection, which contains indirect jumps to
addresses stored in the LazyPointerSection (the counterpart to ELF's
.plt.got).

Initially, the LazyPointerSection contains addresses that point into one
of the entry points in the middle of the StubHelperSection. The code in
StubHelperSection will push on the stack an offset into the
LazyBindingSection. The push is followed by a jump to the beginning of
the StubHelperSection (similar to PLT0), which then calls into
dyld_stub_binder. dyld_stub_binder is a non-lazily bound symbol, so this
call looks it up in the GOT.

The stub binder will look up the bind opcodes in the LazyBindingSection
at the given offset. The bind opcodes will tell the binder to update the
address in the LazyPointerSection to point to the symbol, so that
subsequent calls don't have to redo the symbol resolution. The binder
will then jump to the resolved symbol.

Depends on D78269.

Reviewers: ruiu, pcc, MaskRay, smeenai, alexshap, gkm, Ktwu, christylee

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78270
The file was modifiedlld/MachO/InputSection.cpp
The file was modifiedlld/MachO/Driver.cpp
The file was modifiedlld/test/MachO/Inputs/libhello.s
The file was modifiedlld/MachO/Symbols.h
The file was modifiedlld/MachO/SyntheticSections.cpp
The file was modifiedlld/test/MachO/Inputs/libgoodbye.s
The file was addedlld/test/MachO/dylink-lazy.s
The file was modifiedlld/MachO/Arch/X86_64.cpp
The file was modifiedlld/MachO/OutputSegment.h
The file was modifiedlld/MachO/Writer.cpp
The file was modifiedlld/MachO/SyntheticSections.h
The file was modifiedlld/MachO/InputFiles.h
The file was modifiedlld/MachO/Target.h
The file was modifiedlld/MachO/InputFiles.cpp
Commit 5d3feefa0df9c054f6d683ca13316a822b596f87 by jezng
[lld-macho] Dylib symbols should always replace undefined symbols

Summary:
Otherwise we get undefined symbol errors depending on the order of
arguments on the command line.

Depends on D78270.

Reviewers: ruiu, pcc, MaskRay, smeenai, alexshap, gkm, Ktwu, christylee

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79114
The file was modifiedlld/MachO/SymbolTable.cpp
The file was addedlld/test/MachO/resolution.s
Commit 7bbdbacd00ae04f9c0d609bf2c00036cafb55fef by jezng
[lld-macho] Use export trie instead of symtab when linking against dylibs

Summary:
This allows us to link against stripped dylibs. Moreover, it's simply
more correct: The symbol table includes symbols that the dylib uses but
doesn't export.

This temporarily regresses our ability to do lazy symbol binding because
dyld_stub_binder isn't in libSystem's export trie. Rather, it is in one
of the sub-libraries libSystem re-exports. (This doesn't affect our
tests since we are mocking out dyld_stub_binder there.) A follow-up diff
will address this by adding support for sub-libraries.

Depends on D79114.

Reviewers: ruiu, pcc, MaskRay, smeenai, alexshap, gkm, Ktwu, christylee

Subscribers: mgorny, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79226
The file was modifiedlld/test/MachO/dylink.s
The file was modifiedlld/MachO/ExportTrie.h
The file was modifiedlld/MachO/InputFiles.cpp
The file was modifiedlld/test/CMakeLists.txt
The file was modifiedlld/MachO/ExportTrie.cpp
Commit 198b0c57dffbca309dd5acaebe58300203f4c12d by jezng
[lld-macho] Support pc-relative section relocations

Summary: So far we've only supported symbol relocations.

Reviewers: ruiu, pcc, MaskRay, smeenai, alexshap, gkm, Ktwu, christylee

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79211
The file was modifiedlld/test/MachO/relocations.s
The file was modifiedlld/MachO/InputSection.cpp
The file was modifiedlld/MachO/InputFiles.cpp
The file was modifiedlld/MachO/InputSection.h
The file was modifiedlld/test/MachO/x86-64-reloc-signed.s
Commit 73a9b7dee08ba74d75fffc93d0e8ebdf9aa8cce1 by aeubanks
Add missing pass initialization

Summary: This was preventing MemorySanitizerLegacyPass from appearing in --print-after-all.

Reviewers: vitalybuka

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79661
The file was modifiedllvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
The file was modifiedllvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
The file was modifiedllvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
The file was modifiedllvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp