[PATCH] D96188: [ELF] Support aarch64_be

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 5 17:03:30 PST 2021


MaskRay created this revision.
Herald added subscribers: danielkiss, kristof.beyls, arichardson, emaste.
MaskRay requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

https://github.com/ClangBuiltLinux/linux/issues/1288


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D96188

Files:
  lld/ELF/Arch/AArch64.cpp
  lld/ELF/Driver.cpp


Index: lld/ELF/Driver.cpp
===================================================================
--- lld/ELF/Driver.cpp
+++ lld/ELF/Driver.cpp
@@ -146,6 +146,7 @@
       StringSwitch<std::pair<ELFKind, uint16_t>>(s)
           .Cases("aarch64elf", "aarch64linux", "aarch64_elf64_le_vec",
                  {ELF64LEKind, EM_AARCH64})
+          .Cases("aarch64elfb", "aarch64linuxb", {ELF64BEKind, EM_AARCH64})
           .Cases("armelf", "armelf_linux_eabi", {ELF32LEKind, EM_ARM})
           .Case("elf32_x86_64", {ELF32LEKind, EM_X86_64})
           .Cases("elf32btsmip", "elf32btsmipn32", {ELF32BEKind, EM_MIPS})
Index: lld/ELF/Arch/AArch64.cpp
===================================================================
--- lld/ELF/Arch/AArch64.cpp
+++ lld/ELF/Arch/AArch64.cpp
@@ -195,7 +195,7 @@
 }
 
 void AArch64::writeGotPlt(uint8_t *buf, const Symbol &) const {
-  write64le(buf, in.plt->getVA());
+  write64(buf, in.plt->getVA());
 }
 
 void AArch64::writePltHeader(uint8_t *buf) const {
@@ -323,12 +323,12 @@
   case R_AARCH64_ABS16:
   case R_AARCH64_PREL16:
     checkIntUInt(loc, val, 16, rel);
-    write16le(loc, val);
+    write16(loc, val);
     break;
   case R_AARCH64_ABS32:
   case R_AARCH64_PREL32:
     checkIntUInt(loc, val, 32, rel);
-    write32le(loc, val);
+    write32(loc, val);
     break;
   case R_AARCH64_PLT32:
     checkInt(loc, val, 32, rel);
@@ -336,7 +336,7 @@
     break;
   case R_AARCH64_ABS64:
   case R_AARCH64_PREL64:
-    write64le(loc, val);
+    write64(loc, val);
     break;
   case R_AARCH64_ADD_ABS_LO12_NC:
     or32AArch64Imm(loc, val);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96188.321897.patch
Type: text/x-patch
Size: 1582 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210206/279a165f/attachment.bin>


More information about the llvm-commits mailing list