From: Zequan Wu Date: Sun, 12 Jul 2020 03:49:26 +0000 (-0700) Subject: [COFF] Fix endianness of .llvm.call-graph-profile section data X-Git-Tag: llvmorg-12-init~327 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=77272d177a2d7128cf09dc2d27b353cc3e1ecae0;p=platform%2Fupstream%2Fllvm.git [COFF] Fix endianness of .llvm.call-graph-profile section data --- diff --git a/llvm/lib/MC/WinCOFFObjectWriter.cpp b/llvm/lib/MC/WinCOFFObjectWriter.cpp index 94a8d56..4796ef5 100644 --- a/llvm/lib/MC/WinCOFFObjectWriter.cpp +++ b/llvm/lib/MC/WinCOFFObjectWriter.cpp @@ -1116,9 +1116,9 @@ uint64_t WinCOFFObjectWriter::writeObject(MCAssembler &Asm, for (const MCAssembler::CGProfileEntry &CGPE : Asm.CGProfile) { uint32_t FromIndex = CGPE.From->getSymbol().getIndex(); uint32_t ToIndex = CGPE.To->getSymbol().getIndex(); - OS.write((const char *)&FromIndex, sizeof(uint32_t)); - OS.write((const char *)&ToIndex, sizeof(uint32_t)); - OS.write((const char *)&CGPE.Count, sizeof(uint64_t)); + support::endian::write(OS, FromIndex, W.Endian); + support::endian::write(OS, ToIndex, W.Endian); + support::endian::write(OS, CGPE.Count, W.Endian); } }