[all-commits] [llvm/llvm-project] 24979e: [lld/mac] Don't load DylibFiles from the DylibFile...

Nico Weber via All-commits all-commits at lists.llvm.org
Tue Jun 1 12:31:57 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 24979e1113adf077572fcc1022ee4e3a534a8a4d
      https://github.com/llvm/llvm-project/commit/24979e1113adf077572fcc1022ee4e3a534a8a4d
  Author: Nico Weber <thakis at chromium.org>
  Date:   2021-06-01 (Tue, 01 Jun 2021)

  Changed paths:
    M lld/MachO/DriverUtils.cpp
    M lld/MachO/InputFiles.cpp
    M lld/MachO/InputFiles.h

  Log Message:
  -----------
  [lld/mac] Don't load DylibFiles from the DylibFile constructor

loadDylib() keeps a name->DylibFile cache, but it only writes
to the cache once the DylibFile constructor has completed.
So dylib loads done recursively from the DylibFile constructor
wouldn't use the cache.

Now, we load additional dylibs after writing to the cache,
which means the cache now gets used for dylibs loaded because
they're referenced from other dylibs.

Related to PR49514 and PR50101, but no dramatic behavior change in itself.
(Technically we no longer crash when a tbd file reexports itself,
but that doesn't happen in practice. We now accept it silently instead
of crashing; ld64 has a diag for the reexport cycle.)

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




More information about the All-commits mailing list