diff options
author | Fangrui Song <i@maskray.me> | 2024-04-10 12:20:28 -0700 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2024-04-10 12:20:28 -0700 |
commit | ca6b8469c16edfe1713e9050dca3cd68bd585410 (patch) | |
tree | d3ab6f6ba527aaecf0c49eadcfb8ffadd156f8b3 | |
parent | fad14707b73d6387e6276507e1c5726e67f08cd6 (diff) | |
download | llvm-ca6b8469c16edfe1713e9050dca3cd68bd585410.zip llvm-ca6b8469c16edfe1713e9050dca3cd68bd585410.tar.gz llvm-ca6b8469c16edfe1713e9050dca3cd68bd585410.tar.bz2 |
[ELF] Avoid unneeded config->isLE and config->wordsize. NFC
-rw-r--r-- | lld/ELF/SyntheticSections.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp index 5506594..d8791e83 100644 --- a/lld/ELF/SyntheticSections.cpp +++ b/lld/ELF/SyntheticSections.cpp @@ -2769,7 +2769,8 @@ readPubNamesAndTypes(const LLDDwarfObj<ELFT> &obj, SmallVector<GdbIndexSection::NameAttrEntry, 0> ret; for (const LLDDWARFSection *pub : {&pubNames, &pubTypes}) { - DWARFDataExtractor data(obj, *pub, config->isLE, config->wordsize); + DWARFDataExtractor data(obj, *pub, ELFT::Endianness == endianness::little, + ELFT::Is64Bits ? 8 : 4); DWARFDebugPubTable table; table.extract(data, /*GnuStyle=*/true, [&](Error e) { warn(toString(pub->sec) + ": " + toString(std::move(e))); @@ -3744,8 +3745,9 @@ template <typename ELFT> void elf::writeEhdr(uint8_t *buf, Partition &part) { memcpy(buf, "\177ELF", 4); auto *eHdr = reinterpret_cast<typename ELFT::Ehdr *>(buf); - eHdr->e_ident[EI_CLASS] = config->is64 ? ELFCLASS64 : ELFCLASS32; - eHdr->e_ident[EI_DATA] = config->isLE ? ELFDATA2LSB : ELFDATA2MSB; + eHdr->e_ident[EI_CLASS] = ELFT::Is64Bits ? ELFCLASS64 : ELFCLASS32; + eHdr->e_ident[EI_DATA] = + ELFT::Endianness == endianness::little ? ELFDATA2LSB : ELFDATA2MSB; eHdr->e_ident[EI_VERSION] = EV_CURRENT; eHdr->e_ident[EI_OSABI] = config->osabi; eHdr->e_ident[EI_ABIVERSION] = getAbiVersion(); |