parent
1ec5dd85a2
commit
f2dc4362c0
|
@ -1628,12 +1628,6 @@ template <class ELFT> typename ELFT::uint Writer<ELFT>::getEntryAddr() {
|
|||
return 0;
|
||||
}
|
||||
|
||||
template <class ELFT> static uint8_t getELFEncoding() {
|
||||
if (ELFT::TargetEndianness == llvm::support::little)
|
||||
return ELFDATA2LSB;
|
||||
return ELFDATA2MSB;
|
||||
}
|
||||
|
||||
static uint16_t getELFType() {
|
||||
if (Config->Pic)
|
||||
return ET_DYN;
|
||||
|
@ -1705,8 +1699,8 @@ template <class ELFT> void Writer<ELFT>::writeHeader() {
|
|||
|
||||
// Write the ELF header.
|
||||
auto *EHdr = reinterpret_cast<Elf_Ehdr *>(Buf);
|
||||
EHdr->e_ident[EI_CLASS] = ELFT::Is64Bits ? ELFCLASS64 : ELFCLASS32;
|
||||
EHdr->e_ident[EI_DATA] = getELFEncoding<ELFT>();
|
||||
EHdr->e_ident[EI_CLASS] = Config->Is64 ? ELFCLASS64 : ELFCLASS32;
|
||||
EHdr->e_ident[EI_DATA] = Config->IsLE ? ELFDATA2LSB : ELFDATA2MSB;
|
||||
EHdr->e_ident[EI_VERSION] = EV_CURRENT;
|
||||
EHdr->e_ident[EI_OSABI] = Config->OSABI;
|
||||
EHdr->e_type = getELFType();
|
||||
|
|
Loading…
Reference in New Issue