[all-commits] [llvm/llvm-project] 1b65d2: [lld-macho] Diagnose unaligned arm64 PAGEOFF12 rel...

Daniel Bertalan via All-commits all-commits at lists.llvm.org
Mon Sep 5 08:00:45 PDT 2022


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

  Changed paths:
    M lld/MachO/Arch/ARM64Common.cpp
    M lld/MachO/Arch/ARM64Common.h
    M lld/MachO/Relocations.cpp
    M lld/MachO/Relocations.h
    A lld/test/MachO/invalid/arm64-unaligned-load.s
    M lld/test/MachO/loh-adrp-ldr.s

  Log Message:
  -----------
  [lld-macho] Diagnose unaligned arm64 PAGEOFF12 relocations

The LDR and STR instructions store their immediate offsets as a multiple
of the load/store's size. Therefore, if the target address is not
aligned, the relocation is not representable. We now emit an error if
that happens, similarly to ld64.

This commit removes a test case from loh-adrp-ldr.s that contained an
unaligned LDR.

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




More information about the All-commits mailing list