@@ -2769,7 +2769,8 @@ readPubNamesAndTypes(const LLDDwarfObj<ELFT> &obj,
2769
2769
2770
2770
SmallVector<GdbIndexSection::NameAttrEntry, 0 > ret;
2771
2771
for (const LLDDWARFSection *pub : {&pubNames, &pubTypes}) {
2772
- DWARFDataExtractor data (obj, *pub, config->isLE , config->wordsize );
2772
+ DWARFDataExtractor data (obj, *pub, ELFT::Endianness == endianness::little,
2773
+ ELFT::Is64Bits ? 8 : 4 );
2773
2774
DWARFDebugPubTable table;
2774
2775
table.extract (data, /* GnuStyle=*/ true , [&](Error e) {
2775
2776
warn (toString (pub->sec ) + " : " + toString (std::move (e)));
@@ -3744,8 +3745,9 @@ template <typename ELFT> void elf::writeEhdr(uint8_t *buf, Partition &part) {
3744
3745
memcpy (buf, " \177 ELF" , 4 );
3745
3746
3746
3747
auto *eHdr = reinterpret_cast <typename ELFT::Ehdr *>(buf);
3747
- eHdr->e_ident [EI_CLASS] = config->is64 ? ELFCLASS64 : ELFCLASS32;
3748
- eHdr->e_ident [EI_DATA] = config->isLE ? ELFDATA2LSB : ELFDATA2MSB;
3748
+ eHdr->e_ident [EI_CLASS] = ELFT::Is64Bits ? ELFCLASS64 : ELFCLASS32;
3749
+ eHdr->e_ident [EI_DATA] =
3750
+ ELFT::Endianness == endianness::little ? ELFDATA2LSB : ELFDATA2MSB;
3749
3751
eHdr->e_ident [EI_VERSION] = EV_CURRENT;
3750
3752
eHdr->e_ident [EI_OSABI] = config->osabi ;
3751
3753
eHdr->e_ident [EI_ABIVERSION] = getAbiVersion ();
0 commit comments