[PATCH] D35646: [lld] [COFF] Minor tweaks to ARM64 relocation code. NFC.

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 19 22:51:35 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL308586: [COFF] Minor tweaks to ARM64 relocation code. NFC. (authored by mstorsjo).

Changed prior to commit:
  https://reviews.llvm.org/D35646?vs=107384&id=107445#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D35646

Files:
  lld/trunk/COFF/Chunks.cpp


Index: lld/trunk/COFF/Chunks.cpp
===================================================================
--- lld/trunk/COFF/Chunks.cpp
+++ lld/trunk/COFF/Chunks.cpp
@@ -183,11 +183,10 @@
 }
 
 static void applyArm64Ldr(uint8_t *Off, uint64_t Imm) {
-  int Size = read32le(Off) >> 30;
+  uint32_t Size = read32le(Off) >> 30;
   if ((Imm & ((1 << Size) - 1)) != 0)
     fatal("misaligned ldr/str offset");
-  Imm >>= Size;
-  applyArm64Imm(Off, Imm);
+  applyArm64Imm(Off, Imm >> Size);
 }
 
 void SectionChunk::applyRelARM64(uint8_t *Off, uint16_t Type, OutputSection *OS,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35646.107445.patch
Type: text/x-patch
Size: 568 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170720/aba1af5e/attachment.bin>


More information about the llvm-commits mailing list