[all-commits] [llvm/llvm-project] b7e12c: [lld-macho] If export_size is zero, export_off mus...

Jez Ng via All-commits all-commits at lists.llvm.org
Wed Oct 27 11:59:49 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b7e12ca7aab73a00d7a7a2fbbd5214dde9353335
      https://github.com/llvm/llvm-project/commit/b7e12ca7aab73a00d7a7a2fbbd5214dde9353335
  Author: Jez Ng <jezng at fb.com>
  Date:   2021-10-27 (Wed, 27 Oct 2021)

  Changed paths:
    M lld/MachO/SyntheticSections.h
    M lld/MachO/Writer.cpp
    M lld/test/MachO/no-unneeded-dyld-info.s

  Log Message:
  -----------
  [lld-macho] If export_size is zero, export_off must be zero

Otherwise tools like codesign_allocate will choke. We were already
handling this correctly for the other DYLD_INFO sections.

Doing this correctly is a bit subtle: we don't know if export_size will
be zero until we have run `ExportSection::finalizeContents()`. However,
we must still add the ExportSection to the `__LINKEDIT` segment in order
that it gets sorted during `sortSectionsAndSegments()`.

Reviewed By: #lld-macho, oontvoo

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




More information about the All-commits mailing list