[PATCH] D61171: [ELF] Change std::max<uint64_t> to uint32_t for section alignment

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 25 21:06:19 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL359268: [ELF] Change std::max<uint64_t> to uint32_t for section alignment (authored by MaskRay, committed by ).

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61171/new/

https://reviews.llvm.org/D61171

Files:
  lld/trunk/ELF/InputSection.cpp


Index: lld/trunk/ELF/InputSection.cpp
===================================================================
--- lld/trunk/ELF/InputSection.cpp
+++ lld/trunk/ELF/InputSection.cpp
@@ -75,7 +75,7 @@
 
   // The ELF spec states that a value of 0 means the section has
   // no alignment constraits.
-  uint32_t V = std::max<uint64_t>(Alignment, 1);
+  uint32_t V = std::max<uint32_t>(Alignment, 1);
   if (!isPowerOf2_64(V))
     fatal(toString(this) + ": sh_addralign is not a power of 2");
   this->Alignment = V;
@@ -253,7 +253,7 @@
     }
 
     UncompressedSize = Hdr->ch_size;
-    Alignment = std::max<uint64_t>(Hdr->ch_addralign, 1);
+    Alignment = std::max<uint32_t>(Hdr->ch_addralign, 1);
     RawData = RawData.slice(sizeof(*Hdr));
     return;
   }
@@ -271,7 +271,7 @@
   }
 
   UncompressedSize = Hdr->ch_size;
-  Alignment = std::max<uint64_t>(Hdr->ch_addralign, 1);
+  Alignment = std::max<uint32_t>(Hdr->ch_addralign, 1);
   RawData = RawData.slice(sizeof(*Hdr));
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61171.196793.patch
Type: text/x-patch
Size: 981 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190426/5c835ed9/attachment.bin>


More information about the llvm-commits mailing list