[all-commits] [llvm/llvm-project] a8ec90: [lld-macho] Simplify linker optimization hint proc...

Daniel Bertalan via All-commits all-commits at lists.llvm.org
Mon Sep 5 23:27:11 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a8ec90ad9cfd5f3d4fda1272490a92c5b295c46f
      https://github.com/llvm/llvm-project/commit/a8ec90ad9cfd5f3d4fda1272490a92c5b295c46f
  Author: Daniel Bertalan <dani at danielbertalan.dev>
  Date:   2022-09-06 (Tue, 06 Sep 2022)

  Changed paths:
    M lld/MachO/Arch/ARM64.cpp
    M lld/MachO/InputSection.cpp
    M lld/MachO/Target.h
    M lld/test/MachO/loh-adrp-add.s
    M lld/test/MachO/loh-adrp-ldr.s

  Log Message:
  -----------
  [lld-macho] Simplify linker optimization hint processing

This commit removes the `relocTargets` vector, and instead makes the
code reconstruct the referent addresses from the relocated instructions.
This will allow us to move `applyOptimizationHints` from
`ConcatInputSection::writeTo` to a separate pass that parses and applies
LOHs in one step, on a per-file basis. This will improve performance, as
parsing is currently done serially in `ObjFile::parse`.

I opted to remove the sanity check that ensures that all relocations
within a LOH point to the same symbol. This completely eliminates the
need to search through relocations. It is my understanding that
mismatched relocation targets should not be present in valid object
files, so it's unlikely that the removal will lead to mislinks.

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




More information about the All-commits mailing list