[all-commits] [llvm/llvm-project] 0d30e9: [lld-macho] Add support for emitting chained fixups

Daniel Bertalan via All-commits all-commits at lists.llvm.org
Tue Oct 4 02:51:32 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0d30e92f59589de44a185c53671b7fe2e83cd2ae
      https://github.com/llvm/llvm-project/commit/0d30e92f59589de44a185c53671b7fe2e83cd2ae
  Author: Daniel Bertalan <dani at danielbertalan.dev>
  Date:   2022-10-04 (Tue, 04 Oct 2022)

  Changed paths:
    M lld/MachO/Arch/ARM.cpp
    M lld/MachO/Arch/ARM64.cpp
    M lld/MachO/Arch/ARM64Common.h
    M lld/MachO/Arch/ARM64_32.cpp
    M lld/MachO/Arch/X86_64.cpp
    M lld/MachO/Config.h
    M lld/MachO/Driver.cpp
    M lld/MachO/InputSection.cpp
    M lld/MachO/InputSection.h
    M lld/MachO/Options.td
    M lld/MachO/Symbols.cpp
    M lld/MachO/Symbols.h
    M lld/MachO/SyntheticSections.cpp
    M lld/MachO/SyntheticSections.h
    M lld/MachO/Target.h
    M lld/MachO/Writer.cpp
    A lld/test/MachO/chained-fixups-addend.s
    A lld/test/MachO/chained-fixups-empty.s
    M lld/test/MachO/flat-namespace-interposable.s
    A lld/test/MachO/invalid/chained-fixups-incompatible.s
    M lld/test/MachO/tlv-dylib.s
    M lld/test/MachO/weak-binding.s
    M lld/test/MachO/weak-reference.s
    M llvm/include/llvm/BinaryFormat/MachO.h

  Log Message:
  -----------
  [lld-macho] Add support for emitting chained fixups

This commit adds support for chained fixups, which were introduced in
Apple's late 2020 OS releases. This format replaces the dyld opcodes
used for supplying rebase and binding information, and encodes most of
that data directly in the memory location that will have the fixup
applied.

This reduces binary size and is a requirement for page-in linking, which
will be available starting with macOS 13.

A high-level overview of the format and my implementation can be found
in SyntheticSections.h.

This feature is currently gated behind the `-fixup_chains` flag, and
will be enabled by default for supported targets in a later commit.

Like in ld64, lazy binding is disabled when chained fixups are in use,
and the `-init_offsets` transformation is performed by default.

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




More information about the All-commits mailing list