[all-commits] [llvm/llvm-project] cc5c03: [lld-macho] Properly test subtractor relocations &...

Jez Ng via All-commits all-commits at lists.llvm.org
Sat Feb 27 09:32:10 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cc5c03e10957b8dd4ba4efbc5583084c7636a3ba
      https://github.com/llvm/llvm-project/commit/cc5c03e10957b8dd4ba4efbc5583084c7636a3ba
  Author: Jez Ng <jezng at fb.com>
  Date:   2021-02-27 (Sat, 27 Feb 2021)

  Changed paths:
    M lld/MachO/Arch/ARM64.cpp
    M lld/MachO/Arch/X86_64.cpp
    A lld/test/MachO/reloc-subtractor.s
    R lld/test/MachO/x86-64-reloc-subtract.s

  Log Message:
  -----------
  [lld-macho] Properly test subtractor relocations & fix their attributes

`llvm-mc` doesn't generate any relocations for subtractions
between local symbols -- they must be global -- so the previous test
wasn't actually testing any relocation logic. I've fixed that and
extended the test to cover r_length=3 relocations as well as both x86_64
and arm64.

Reviewed By: #lld-macho, smeenai

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


  Commit: 541390131ef72a8dad93c936d816279c8b76374e
      https://github.com/llvm/llvm-project/commit/541390131ef72a8dad93c936d816279c8b76374e
  Author: Jez Ng <jezng at fb.com>
  Date:   2021-02-27 (Sat, 27 Feb 2021)

  Changed paths:
    M lld/MachO/Arch/ARM64.cpp
    M lld/MachO/InputFiles.cpp
    M lld/MachO/InputSection.cpp
    M lld/MachO/Target.h
    M lld/MachO/Writer.cpp
    M lld/test/MachO/reloc-subtractor.s

  Log Message:
  -----------
  [lld-macho] Don't emit rebase opcodes for subtractor minuend relocs

Also add a few asserts to verify that we are indeed handling an
UNSIGNED relocation as the minued. I haven't made it an actual
user-facing error since I don't think llvm-mc is capable of generating
SUBTRACTOR relocations without an associated UNSIGNED.

Reviewed By: #lld-macho, smeenai

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


  Commit: 8da88d4b605bd3e596fc26845969ba83a6bf076d
      https://github.com/llvm/llvm-project/commit/8da88d4b605bd3e596fc26845969ba83a6bf076d
  Author: Jez Ng <jezng at fb.com>
  Date:   2021-02-27 (Sat, 27 Feb 2021)

  Changed paths:
    A lld/test/MachO/arm64-relocs.s
    M lld/test/MachO/compact-unwind.s

  Log Message:
  -----------
  [lld-macho] Add test for a variety of arm64 relocations

Reviewed By: #lld-macho, smeenai

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


  Commit: 82b3da6f6f0e91e47074f454907e82b284b8beda
      https://github.com/llvm/llvm-project/commit/82b3da6f6f0e91e47074f454907e82b284b8beda
  Author: Jez Ng <jezng at fb.com>
  Date:   2021-02-27 (Sat, 27 Feb 2021)

  Changed paths:
    M lld/MachO/Arch/ARM64.cpp
    M lld/MachO/InputFiles.cpp
    M lld/test/MachO/arm64-relocs.s
    M lld/test/MachO/reloc-subtractor.s

  Log Message:
  -----------
  [lld-macho] Extract embedded addends for arm64 UNSIGNED relocations

On arm64, UNSIGNED relocs are the only ones that use embedded addends
instead of the ADDEND relocation.

Also ensure that the addend works when UNSIGNED is part of a SUBTRACTOR
pair.

Reviewed By: #lld-macho, alexshap

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


Compare: https://github.com/llvm/llvm-project/compare/ee90bb348694...82b3da6f6f0e


More information about the All-commits mailing list