[PATCH] D112878: [MachO] Properly reset global state

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 30 16:55:51 PDT 2021


smeenai created this revision.
smeenai added a reviewer: lld-macho.
Herald added a reviewer: gkm.
Herald added a project: lld-macho.
smeenai requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

We need to reset global state between runs, similar to the other ports.
There's some file-static state which needs to be reset as well and we
need to add some new helpers for that.

With this change, most LLD Mach-O tests pass with `LLD_IN_TEST=2` (which
runs the linker twice on each test). Some tests will be fixed by the
remainder of this stack, and the rest are fundamentally incompatible
with that mode (e.g. they intentionally throw fatal errors).

Fixes PR52070.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D112878

Files:
  lld/MachO/Driver.cpp
  lld/MachO/Driver.h
  lld/MachO/DriverUtils.cpp
  lld/MachO/InputFiles.h
  lld/MachO/OutputSegment.cpp
  lld/MachO/OutputSegment.h
  lld/MachO/Writer.cpp
  lld/MachO/Writer.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112878.383627.patch
Type: text/x-patch
Size: 4339 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211030/c3da7165/attachment.bin>


More information about the llvm-commits mailing list