]> granicus.if.org Git - llvm/commitdiff
[yaml2elf] - An attemp to fix s390x BB after r353607.
authorGeorge Rimar <grimar@accesssoftek.com>
Sat, 9 Feb 2019 15:03:19 +0000 (15:03 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Sat, 9 Feb 2019 15:03:19 +0000 (15:03 +0000)
s390x is big-endian and seems r353607 had an issue with endianess,
Bot was unhappy:
http://lab.llvm.org:8011/builders/clang-s390x-linux-lnt/builds/11168/steps/ninja%20check%201/logs/stdio

This should fix it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353613 91177308-0d34-0410-b5e6-96231b3b80d8

tools/yaml2obj/yaml2elf.cpp

index 4e3a1d7e5d0d8ae8429b894e828c95e4ea4ab851..50644a997df73f06b6c937e6c6fbd25734fbff43 100644 (file)
@@ -594,10 +594,10 @@ void ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader,
 
   auto &OS = CBA.getOSAndAlignedOffset(SHeader.sh_offset, SHeader.sh_addralign);
   for (const ELFYAML::DynamicEntry &DE : Section.Entries) {
-    uintX_t Tag = DE.Tag;
-    OS.write((const char *)&Tag, sizeof(uintX_t));
-    uintX_t Val = DE.Val;
-    OS.write((const char *)&Val, sizeof(uintX_t));
+    ELFT::Xword Tag = (ELFT::Xword)DE.Tag;
+    OS.write((const char *)&Tag, sizeof(ELFT::Xword));
+    ELFT::Xword Val = (ELFT::Xword)DE.Val;
+    OS.write((const char *)&Val, sizeof(ELFT::Xword));
   }
 }