[all-commits] [llvm/llvm-project] daf208: [lld][AArch64] Fix getImplicitAddend in big-endian...

Simon Tatham via All-commits all-commits at lists.llvm.org
Tue Sep 10 04:38:53 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: daf208598b06a0b8b3dc3c30b023334182bdf170
      https://github.com/llvm/llvm-project/commit/daf208598b06a0b8b3dc3c30b023334182bdf170
  Author: Simon Tatham <simon.tatham at arm.com>
  Date:   2024-09-10 (Tue, 10 Sep 2024)

  Changed paths:
    M lld/ELF/Arch/AArch64.cpp
    M lld/test/ELF/aarch64-reloc-implicit-addend.test

  Log Message:
  -----------
  [lld][AArch64] Fix getImplicitAddend in big-endian mode. (#107845)

In AArch64, the endianness of instruction encodings is always little,
whereas the endianness of data swaps between LE and BE modes. So
getImplicitAddend must use the right one of read32() and read32le(), for
data and code respectively. It was using read32() throughout, causing
instructions to be read as big-endian in BE mode, getting the wrong
addend.

Fixed, and updated the existing test to check both endiannesses. The
expected results for data must be byte-swapped, but the ones for code
need no adjustment.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list