[all-commits] [llvm/llvm-project] 0223ab: [lld-macho] check minimum header length when openi...

Greg McGary via All-commits all-commits at lists.llvm.org
Sat Feb 27 14:42:01 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0223ab035c199e537a0040857ba147ced87fd533
      https://github.com/llvm/llvm-project/commit/0223ab035c199e537a0040857ba147ced87fd533
  Author: Greg McGary <gkm at fb.com>
  Date:   2021-02-27 (Sat, 27 Feb 2021)

  Changed paths:
    M lld/MachO/Driver.cpp
    M lld/MachO/DriverUtils.cpp
    M lld/MachO/InputFiles.cpp
    M lld/MachO/InputFiles.h
    A lld/test/MachO/invalid/tiny-input.s
    M lld/test/MachO/rename.s

  Log Message:
  -----------
  [lld-macho] check minimum header length when opening linkable input files

Bifurcate the `readFile()` API into ...
* `readRawFile()` which performs no checks, and
* `readLinkableFile()` which enforces minimum length of 20 bytes, same as ld64

There are no new tests because tweaks to existing tests are sufficient.

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




More information about the All-commits mailing list