[all-commits] [llvm/llvm-project] e6382d: [lld-macho][nfc] Simplify unwind section lookup

Jez Ng via All-commits all-commits at lists.llvm.org
Fri Apr 22 12:37:11 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e6382d23fcc8138d7dec4b23cb1b7f4e5cb4c335
      https://github.com/llvm/llvm-project/commit/e6382d23fcc8138d7dec4b23cb1b7f4e5cb4c335
  Author: Jez Ng <jezng at fb.com>
  Date:   2022-04-22 (Fri, 22 Apr 2022)

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

  Log Message:
  -----------
  [lld-macho][nfc] Simplify unwind section lookup

Previously, we stored a pointer from the ObjFile to its compact unwind
section in order to avoid iterating over the file's sections a second
time. However, given the small number of sections (not subsections) per
file, this caching was really quite unnecessary. We will soon do lookups
for more sections (such as the `__eh_frame` section), so let's simplify
the code first.

Reviewed By: #lld-macho, Roger

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


  Commit: c242e10c74d28d97a9e7f99f00a06a9a599be402
      https://github.com/llvm/llvm-project/commit/c242e10c74d28d97a9e7f99f00a06a9a599be402
  Author: Jez Ng <jezng at fb.com>
  Date:   2022-04-22 (Fri, 22 Apr 2022)

  Changed paths:
    M lld/MachO/ICF.cpp
    M lld/test/MachO/icf-literals.s

  Log Message:
  -----------
  [lld-macho] Fix ICF crash when comparing symbol relocs

Previously, when encountering a symbol reloc located in a literal section, we
would look up the contents of the literal at the `symbol value + addend` offset
within the literal section. However, it seems that this offset is not guaranteed
to be valid. Instead, we should use just the symbol value to retrieve the
literal's contents, and compare the addend values separately. ld64 seems to do
this.

Reviewed By: #lld-macho, thevinster

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


Compare: https://github.com/llvm/llvm-project/compare/cbbc66290044...c242e10c74d2


More information about the All-commits mailing list