[lld] r251155 - ELF2: Use character literals for ELF file magic.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 23 15:31:47 PDT 2015
Author: ruiu
Date: Fri Oct 23 17:31:47 2015
New Revision: 251155
URL: http://llvm.org/viewvc/llvm-project?rev=251155&view=rev
Log:
ELF2: Use character literals for ELF file magic.
This is consitent with Support/ELF.h and more obvious than before.
Modified:
lld/trunk/ELF/Writer.cpp
Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=251155&r1=251154&r2=251155&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Fri Oct 23 17:31:47 2015
@@ -705,9 +705,9 @@ template <class ELFT> void Writer<ELFT>:
uint8_t *Buf = Buffer->getBufferStart();
auto *EHdr = reinterpret_cast<Elf_Ehdr *>(Buf);
EHdr->e_ident[EI_MAG0] = 0x7F;
- EHdr->e_ident[EI_MAG1] = 0x45;
- EHdr->e_ident[EI_MAG2] = 0x4C;
- EHdr->e_ident[EI_MAG3] = 0x46;
+ EHdr->e_ident[EI_MAG1] = 'E';
+ EHdr->e_ident[EI_MAG2] = 'L';
+ EHdr->e_ident[EI_MAG3] = 'F';
EHdr->e_ident[EI_CLASS] = ELFT::Is64Bits ? ELFCLASS64 : ELFCLASS32;
EHdr->e_ident[EI_DATA] = ELFT::TargetEndianness == llvm::support::little
? ELFDATA2LSB
More information about the llvm-commits
mailing list