[all-commits] [llvm/llvm-project] 321b2b: [lld-macho] Use DO_BIND_ADD_ADDR_IMM_SCALED for bi...

Vincent Lee via All-commits all-commits at lists.llvm.org
Mon Jul 19 16:19:07 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 321b2bef098553ec648e4174aae92c63a6e1a810
      https://github.com/llvm/llvm-project/commit/321b2bef098553ec648e4174aae92c63a6e1a810
  Author: Vincent Lee <leevince at fb.com>
  Date:   2021-07-19 (Mon, 19 Jul 2021)

  Changed paths:
    M lld/MachO/SyntheticSections.cpp
    M lld/test/MachO/bind-opcodes.s

  Log Message:
  -----------
  [lld-macho] Use DO_BIND_ADD_ADDR_IMM_SCALED for bind opcodes

Implement pass 3 of bind opcodes from ld64 (which supports both 32-bit and 64-bit).
Pass 3 implementation condenses BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB opcode
to BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED.  This change is already behind an
O2 flag so it shouldn't impact current performance. I verified ld64's output with x86_64 LLD
and they were both emitting the same optimized bind opcodes (although in a slightly different
order). Tested with arm64_32 LLD and compared that with x86 LLD that the order of the bind
opcodes are the same (offset values are different which should be expected).

Reviewed By: int3, #lld-macho

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




More information about the All-commits mailing list