Skip to content

Commit 2763353

Browse files
authored
[Object,ELFType] Rename TargetEndianness to Endianness (#86604)
`TargetEndianness` is long and unwieldy. "Target" in the name is confusing. Rename it to "Endianness". I cannot find noticeable out-of-tree users of `TargetEndianness`, but keep `TargetEndianness` to make this patch safer. `TargetEndianness` will be removed by a subsequent change.
1 parent 7789ec0 commit 2763353

File tree

15 files changed

+130
-138
lines changed

15 files changed

+130
-138
lines changed

lld/ELF/Arch/Mips.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ bool MIPS<ELFT>::needsThunk(RelExpr expr, RelType type, const InputFile *file,
380380

381381
template <class ELFT>
382382
int64_t MIPS<ELFT>::getImplicitAddend(const uint8_t *buf, RelType type) const {
383-
const endianness e = ELFT::TargetEndianness;
383+
const endianness e = ELFT::Endianness;
384384
switch (type) {
385385
case R_MIPS_32:
386386
case R_MIPS_REL32:
@@ -521,7 +521,7 @@ static uint64_t fixupCrossModeJump(uint8_t *loc, RelType type, uint64_t val) {
521521
// to a microMIPS target and vice versa. In that cases jump
522522
// instructions need to be replaced by their "cross-mode"
523523
// equivalents.
524-
const endianness e = ELFT::TargetEndianness;
524+
const endianness e = ELFT::Endianness;
525525
bool isMicroTgt = val & 0x1;
526526
bool isCrossJump = (isMicroTgt && isBranchReloc(type)) ||
527527
(!isMicroTgt && isMicroBranchReloc(type));
@@ -567,7 +567,7 @@ static uint64_t fixupCrossModeJump(uint8_t *loc, RelType type, uint64_t val) {
567567
template <class ELFT>
568568
void MIPS<ELFT>::relocate(uint8_t *loc, const Relocation &rel,
569569
uint64_t val) const {
570-
const endianness e = ELFT::TargetEndianness;
570+
const endianness e = ELFT::Endianness;
571571
RelType type = rel.type;
572572

573573
if (ELFT::Is64Bits || config->mipsN32Abi)

lld/ELF/DWARF.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ template <class ELFT> class LLDDwarfObj final : public llvm::DWARFObject {
7474
StringRef getLineStrSection() const override { return lineStrSection; }
7575

7676
bool isLittleEndian() const override {
77-
return ELFT::TargetEndianness == llvm::endianness::little;
77+
return ELFT::Endianness == llvm::endianness::little;
7878
}
7979

8080
std::optional<llvm::RelocAddrEntry> find(const llvm::DWARFSection &sec,

lld/ELF/InputFiles.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -971,8 +971,8 @@ template <class ELFT> static uint32_t readAndFeatures(const InputSection &sec) {
971971
const uint8_t *place = desc.data();
972972
if (desc.size() < 8)
973973
reportFatal(place, "program property is too short");
974-
uint32_t type = read32<ELFT::TargetEndianness>(desc.data());
975-
uint32_t size = read32<ELFT::TargetEndianness>(desc.data() + 4);
974+
uint32_t type = read32<ELFT::Endianness>(desc.data());
975+
uint32_t size = read32<ELFT::Endianness>(desc.data() + 4);
976976
desc = desc.slice(8);
977977
if (desc.size() < size)
978978
reportFatal(place, "program property is too short");
@@ -983,7 +983,7 @@ template <class ELFT> static uint32_t readAndFeatures(const InputSection &sec) {
983983
// accumulate the bits set.
984984
if (size < 4)
985985
reportFatal(place, "FEATURE_1_AND entry is too short");
986-
featuresSet |= read32<ELFT::TargetEndianness>(desc.data());
986+
featuresSet |= read32<ELFT::Endianness>(desc.data());
987987
}
988988

989989
// Padding is present in the note descriptor, if necessary.

lld/ELF/InputSection.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,10 +1258,10 @@ void EhInputSection::split(ArrayRef<RelTy> rels) {
12581258
msg = "CIE/FDE too small";
12591259
break;
12601260
}
1261-
uint64_t size = endian::read32<ELFT::TargetEndianness>(d.data());
1261+
uint64_t size = endian::read32<ELFT::Endianness>(d.data());
12621262
if (size == 0) // ZERO terminator
12631263
break;
1264-
uint32_t id = endian::read32<ELFT::TargetEndianness>(d.data() + 4);
1264+
uint32_t id = endian::read32<ELFT::Endianness>(d.data() + 4);
12651265
size += 4;
12661266
if (LLVM_UNLIKELY(size > d.size())) {
12671267
// If it is 0xFFFFFFFF, the next 8 bytes contain the size instead,

lld/ELF/SyntheticSections.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ void EhFrameSection::addRecords(EhInputSection *sec, ArrayRef<RelTy> rels) {
415415
for (EhSectionPiece &cie : sec->cies)
416416
offsetToCie[cie.inputOff] = addCie<ELFT>(cie, rels);
417417
for (EhSectionPiece &fde : sec->fdes) {
418-
uint32_t id = endian::read32<ELFT::TargetEndianness>(fde.data().data() + 4);
418+
uint32_t id = endian::read32<ELFT::Endianness>(fde.data().data() + 4);
419419
CieRecord *rec = offsetToCie[fde.inputOff + 4 - id];
420420
if (!rec)
421421
fatal(toString(sec) + ": invalid CIE reference");
@@ -448,7 +448,7 @@ void EhFrameSection::iterateFDEWithLSDAAux(
448448
if (hasLSDA(cie))
449449
ciesWithLSDA.insert(cie.inputOff);
450450
for (EhSectionPiece &fde : sec.fdes) {
451-
uint32_t id = endian::read32<ELFT::TargetEndianness>(fde.data().data() + 4);
451+
uint32_t id = endian::read32<ELFT::Endianness>(fde.data().data() + 4);
452452
if (!ciesWithLSDA.contains(fde.inputOff + 4 - id))
453453
continue;
454454

llvm/include/llvm/ExecutionEngine/Orc/ExecutionUtils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ class DLLImportDefinitionGenerator : public DefinitionGenerator {
352352
: ES(ES), L(L) {}
353353

354354
static Expected<unsigned> getTargetPointerSize(const Triple &TT);
355-
static Expected<llvm::endianness> getTargetEndianness(const Triple &TT);
355+
static Expected<llvm::endianness> getEndianness(const Triple &TT);
356356
Expected<std::unique_ptr<jitlink::LinkGraph>>
357357
createStubsGraph(const SymbolMap &Resolved);
358358

llvm/include/llvm/Object/ELFObjectFile.h

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ template <class ELFT> class ELFObjectFile : public ELFObjectFileBase {
419419
if (Contents[0] != ELFAttrs::Format_Version || Contents.size() == 1)
420420
return Error::success();
421421

422-
if (Error E = Attributes.parse(Contents, ELFT::TargetEndianness))
422+
if (Error E = Attributes.parse(Contents, ELFT::Endianness))
423423
return E;
424424
break;
425425
}
@@ -482,7 +482,7 @@ template <class ELFT> class ELFObjectFile : public ELFObjectFileBase {
482482
bool isDyldType() const { return isDyldELFObject; }
483483
static bool classof(const Binary *v) {
484484
return v->getType() ==
485-
getELFType(ELFT::TargetEndianness == llvm::endianness::little,
485+
getELFType(ELFT::Endianness == llvm::endianness::little,
486486
ELFT::Is64Bits);
487487
}
488488

@@ -1155,10 +1155,9 @@ ELFObjectFile<ELFT>::ELFObjectFile(MemoryBufferRef Object, ELFFile<ELFT> EF,
11551155
const Elf_Shdr *DotDynSymSec,
11561156
const Elf_Shdr *DotSymtabSec,
11571157
const Elf_Shdr *DotSymtabShndx)
1158-
: ELFObjectFileBase(
1159-
getELFType(ELFT::TargetEndianness == llvm::endianness::little,
1160-
ELFT::Is64Bits),
1161-
Object),
1158+
: ELFObjectFileBase(getELFType(ELFT::Endianness == llvm::endianness::little,
1159+
ELFT::Is64Bits),
1160+
Object),
11621161
EF(EF), DotDynSymSec(DotDynSymSec), DotSymtabSec(DotSymtabSec),
11631162
DotSymtabShndxSec(DotSymtabShndx) {}
11641163

@@ -1226,8 +1225,7 @@ uint8_t ELFObjectFile<ELFT>::getBytesInAddress() const {
12261225

12271226
template <class ELFT>
12281227
StringRef ELFObjectFile<ELFT>::getFileFormatName() const {
1229-
constexpr bool IsLittleEndian =
1230-
ELFT::TargetEndianness == llvm::endianness::little;
1228+
constexpr bool IsLittleEndian = ELFT::Endianness == llvm::endianness::little;
12311229
switch (EF.getHeader().e_ident[ELF::EI_CLASS]) {
12321230
case ELF::ELFCLASS32:
12331231
switch (EF.getHeader().e_machine) {
@@ -1305,7 +1303,7 @@ StringRef ELFObjectFile<ELFT>::getFileFormatName() const {
13051303
}
13061304

13071305
template <class ELFT> Triple::ArchType ELFObjectFile<ELFT>::getArch() const {
1308-
bool IsLittleEndian = ELFT::TargetEndianness == llvm::endianness::little;
1306+
bool IsLittleEndian = ELFT::Endianness == llvm::endianness::little;
13091307
switch (EF.getHeader().e_machine) {
13101308
case ELF::EM_68K:
13111309
return Triple::m68k;

llvm/include/llvm/Object/ELFTypes.h

Lines changed: 51 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ template <endianness E, bool Is64> struct ELFType {
5252

5353
public:
5454
static const endianness TargetEndianness = E;
55+
static const endianness Endianness = E;
5556
static const bool Is64Bits = Is64;
5657

5758
using uint = std::conditional_t<Is64, uint64_t, uint32_t>;
@@ -145,9 +146,9 @@ using ELF64BE = ELFType<llvm::endianness::big, true>;
145146
// Section header.
146147
template <class ELFT> struct Elf_Shdr_Base;
147148

148-
template <endianness TargetEndianness>
149-
struct Elf_Shdr_Base<ELFType<TargetEndianness, false>> {
150-
LLVM_ELF_IMPORT_TYPES(TargetEndianness, false)
149+
template <endianness Endianness>
150+
struct Elf_Shdr_Base<ELFType<Endianness, false>> {
151+
LLVM_ELF_IMPORT_TYPES(Endianness, false)
151152
Elf_Word sh_name; // Section name (index into string table)
152153
Elf_Word sh_type; // Section type (SHT_*)
153154
Elf_Word sh_flags; // Section flags (SHF_*)
@@ -160,9 +161,9 @@ struct Elf_Shdr_Base<ELFType<TargetEndianness, false>> {
160161
Elf_Word sh_entsize; // Size of records contained within the section
161162
};
162163

163-
template <endianness TargetEndianness>
164-
struct Elf_Shdr_Base<ELFType<TargetEndianness, true>> {
165-
LLVM_ELF_IMPORT_TYPES(TargetEndianness, true)
164+
template <endianness Endianness>
165+
struct Elf_Shdr_Base<ELFType<Endianness, true>> {
166+
LLVM_ELF_IMPORT_TYPES(Endianness, true)
166167
Elf_Word sh_name; // Section name (index into string table)
167168
Elf_Word sh_type; // Section type (SHT_*)
168169
Elf_Xword sh_flags; // Section flags (SHF_*)
@@ -190,9 +191,9 @@ struct Elf_Shdr_Impl : Elf_Shdr_Base<ELFT> {
190191

191192
template <class ELFT> struct Elf_Sym_Base;
192193

193-
template <endianness TargetEndianness>
194-
struct Elf_Sym_Base<ELFType<TargetEndianness, false>> {
195-
LLVM_ELF_IMPORT_TYPES(TargetEndianness, false)
194+
template <endianness Endianness>
195+
struct Elf_Sym_Base<ELFType<Endianness, false>> {
196+
LLVM_ELF_IMPORT_TYPES(Endianness, false)
196197
Elf_Word st_name; // Symbol name (index into string table)
197198
Elf_Addr st_value; // Value or address associated with the symbol
198199
Elf_Word st_size; // Size of the symbol
@@ -201,9 +202,9 @@ struct Elf_Sym_Base<ELFType<TargetEndianness, false>> {
201202
Elf_Half st_shndx; // Which section (header table index) it's defined in
202203
};
203204

204-
template <endianness TargetEndianness>
205-
struct Elf_Sym_Base<ELFType<TargetEndianness, true>> {
206-
LLVM_ELF_IMPORT_TYPES(TargetEndianness, true)
205+
template <endianness Endianness>
206+
struct Elf_Sym_Base<ELFType<Endianness, true>> {
207+
LLVM_ELF_IMPORT_TYPES(Endianness, true)
207208
Elf_Word st_name; // Symbol name (index into string table)
208209
unsigned char st_info; // Symbol's type and binding attributes
209210
unsigned char st_other; // Must be zero; reserved
@@ -349,19 +350,19 @@ struct Elf_Vernaux_Impl {
349350
/// table section (.dynamic) look like.
350351
template <class ELFT> struct Elf_Dyn_Base;
351352

352-
template <endianness TargetEndianness>
353-
struct Elf_Dyn_Base<ELFType<TargetEndianness, false>> {
354-
LLVM_ELF_IMPORT_TYPES(TargetEndianness, false)
353+
template <endianness Endianness>
354+
struct Elf_Dyn_Base<ELFType<Endianness, false>> {
355+
LLVM_ELF_IMPORT_TYPES(Endianness, false)
355356
Elf_Sword d_tag;
356357
union {
357358
Elf_Word d_val;
358359
Elf_Addr d_ptr;
359360
} d_un;
360361
};
361362

362-
template <endianness TargetEndianness>
363-
struct Elf_Dyn_Base<ELFType<TargetEndianness, true>> {
364-
LLVM_ELF_IMPORT_TYPES(TargetEndianness, true)
363+
template <endianness Endianness>
364+
struct Elf_Dyn_Base<ELFType<Endianness, true>> {
365+
LLVM_ELF_IMPORT_TYPES(Endianness, true)
365366
Elf_Sxword d_tag;
366367
union {
367368
Elf_Xword d_val;
@@ -381,9 +382,9 @@ struct Elf_Dyn_Impl : Elf_Dyn_Base<ELFT> {
381382
uintX_t getPtr() const { return d_un.d_ptr; }
382383
};
383384

384-
template <endianness TargetEndianness>
385-
struct Elf_Rel_Impl<ELFType<TargetEndianness, false>, false> {
386-
LLVM_ELF_IMPORT_TYPES(TargetEndianness, false)
385+
template <endianness Endianness>
386+
struct Elf_Rel_Impl<ELFType<Endianness, false>, false> {
387+
LLVM_ELF_IMPORT_TYPES(Endianness, false)
387388
static const bool IsRela = false;
388389
Elf_Addr r_offset; // Location (file byte offset, or program virtual addr)
389390
Elf_Word r_info; // Symbol table index and type of relocation to apply
@@ -416,17 +417,17 @@ struct Elf_Rel_Impl<ELFType<TargetEndianness, false>, false> {
416417
}
417418
};
418419

419-
template <endianness TargetEndianness>
420-
struct Elf_Rel_Impl<ELFType<TargetEndianness, false>, true>
421-
: public Elf_Rel_Impl<ELFType<TargetEndianness, false>, false> {
422-
LLVM_ELF_IMPORT_TYPES(TargetEndianness, false)
420+
template <endianness Endianness>
421+
struct Elf_Rel_Impl<ELFType<Endianness, false>, true>
422+
: public Elf_Rel_Impl<ELFType<Endianness, false>, false> {
423+
LLVM_ELF_IMPORT_TYPES(Endianness, false)
423424
static const bool IsRela = true;
424425
Elf_Sword r_addend; // Compute value for relocatable field by adding this
425426
};
426427

427-
template <endianness TargetEndianness>
428-
struct Elf_Rel_Impl<ELFType<TargetEndianness, true>, false> {
429-
LLVM_ELF_IMPORT_TYPES(TargetEndianness, true)
428+
template <endianness Endianness>
429+
struct Elf_Rel_Impl<ELFType<Endianness, true>, false> {
430+
LLVM_ELF_IMPORT_TYPES(Endianness, true)
430431
static const bool IsRela = false;
431432
Elf_Addr r_offset; // Location (file byte offset, or program virtual addr)
432433
Elf_Xword r_info; // Symbol table index and type of relocation to apply
@@ -469,10 +470,10 @@ struct Elf_Rel_Impl<ELFType<TargetEndianness, true>, false> {
469470
}
470471
};
471472

472-
template <endianness TargetEndianness>
473-
struct Elf_Rel_Impl<ELFType<TargetEndianness, true>, true>
474-
: public Elf_Rel_Impl<ELFType<TargetEndianness, true>, false> {
475-
LLVM_ELF_IMPORT_TYPES(TargetEndianness, true)
473+
template <endianness Endianness>
474+
struct Elf_Rel_Impl<ELFType<Endianness, true>, true>
475+
: public Elf_Rel_Impl<ELFType<Endianness, true>, false> {
476+
LLVM_ELF_IMPORT_TYPES(Endianness, true)
476477
static const bool IsRela = true;
477478
Elf_Sxword r_addend; // Compute value for relocatable field by adding this.
478479
};
@@ -504,9 +505,9 @@ struct Elf_Ehdr_Impl {
504505
unsigned char getDataEncoding() const { return e_ident[ELF::EI_DATA]; }
505506
};
506507

507-
template <endianness TargetEndianness>
508-
struct Elf_Phdr_Impl<ELFType<TargetEndianness, false>> {
509-
LLVM_ELF_IMPORT_TYPES(TargetEndianness, false)
508+
template <endianness Endianness>
509+
struct Elf_Phdr_Impl<ELFType<Endianness, false>> {
510+
LLVM_ELF_IMPORT_TYPES(Endianness, false)
510511
Elf_Word p_type; // Type of segment
511512
Elf_Off p_offset; // FileOffset where segment is located, in bytes
512513
Elf_Addr p_vaddr; // Virtual Address of beginning of segment
@@ -517,9 +518,9 @@ struct Elf_Phdr_Impl<ELFType<TargetEndianness, false>> {
517518
Elf_Word p_align; // Segment alignment constraint
518519
};
519520

520-
template <endianness TargetEndianness>
521-
struct Elf_Phdr_Impl<ELFType<TargetEndianness, true>> {
522-
LLVM_ELF_IMPORT_TYPES(TargetEndianness, true)
521+
template <endianness Endianness>
522+
struct Elf_Phdr_Impl<ELFType<Endianness, true>> {
523+
LLVM_ELF_IMPORT_TYPES(Endianness, true)
523524
Elf_Word p_type; // Type of segment
524525
Elf_Word p_flags; // Segment flags
525526
Elf_Off p_offset; // FileOffset where segment is located, in bytes
@@ -574,17 +575,17 @@ struct Elf_GnuHash_Impl {
574575

575576
// Compressed section headers.
576577
// http://www.sco.com/developers/gabi/latest/ch4.sheader.html#compression_header
577-
template <endianness TargetEndianness>
578-
struct Elf_Chdr_Impl<ELFType<TargetEndianness, false>> {
579-
LLVM_ELF_IMPORT_TYPES(TargetEndianness, false)
578+
template <endianness Endianness>
579+
struct Elf_Chdr_Impl<ELFType<Endianness, false>> {
580+
LLVM_ELF_IMPORT_TYPES(Endianness, false)
580581
Elf_Word ch_type;
581582
Elf_Word ch_size;
582583
Elf_Word ch_addralign;
583584
};
584585

585-
template <endianness TargetEndianness>
586-
struct Elf_Chdr_Impl<ELFType<TargetEndianness, true>> {
587-
LLVM_ELF_IMPORT_TYPES(TargetEndianness, true)
586+
template <endianness Endianness>
587+
struct Elf_Chdr_Impl<ELFType<Endianness, true>> {
588+
LLVM_ELF_IMPORT_TYPES(Endianness, true)
588589
Elf_Word ch_type;
589590
Elf_Word ch_reserved;
590591
Elf_Xword ch_size;
@@ -742,17 +743,17 @@ template <class ELFT> struct Elf_CGProfile_Impl {
742743
template <class ELFT>
743744
struct Elf_Mips_RegInfo;
744745

745-
template <llvm::endianness TargetEndianness>
746-
struct Elf_Mips_RegInfo<ELFType<TargetEndianness, false>> {
747-
LLVM_ELF_IMPORT_TYPES(TargetEndianness, false)
746+
template <llvm::endianness Endianness>
747+
struct Elf_Mips_RegInfo<ELFType<Endianness, false>> {
748+
LLVM_ELF_IMPORT_TYPES(Endianness, false)
748749
Elf_Word ri_gprmask; // bit-mask of used general registers
749750
Elf_Word ri_cprmask[4]; // bit-mask of used co-processor registers
750751
Elf_Addr ri_gp_value; // gp register value
751752
};
752753

753-
template <llvm::endianness TargetEndianness>
754-
struct Elf_Mips_RegInfo<ELFType<TargetEndianness, true>> {
755-
LLVM_ELF_IMPORT_TYPES(TargetEndianness, true)
754+
template <llvm::endianness Endianness>
755+
struct Elf_Mips_RegInfo<ELFType<Endianness, true>> {
756+
LLVM_ELF_IMPORT_TYPES(Endianness, true)
756757
Elf_Word ri_gprmask; // bit-mask of used general registers
757758
Elf_Word ri_pad; // unused padding field
758759
Elf_Word ri_cprmask[4]; // bit-mask of used co-processor registers

llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ ELFLinkGraphBuilder<ELFT>::ELFLinkGraphBuilder(
193193
StringRef FileName, LinkGraph::GetEdgeKindNameFunction GetEdgeKindName)
194194
: ELFLinkGraphBuilderBase(std::make_unique<LinkGraph>(
195195
FileName.str(), Triple(std::move(TT)), std::move(Features),
196-
ELFT::Is64Bits ? 8 : 4, llvm::endianness(ELFT::TargetEndianness),
196+
ELFT::Is64Bits ? 8 : 4, llvm::endianness(ELFT::Endianness),
197197
std::move(GetEdgeKindName))),
198198
Obj(Obj) {
199199
LLVM_DEBUG(

llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ DLLImportDefinitionGenerator::getTargetPointerSize(const Triple &TT) {
545545
}
546546

547547
Expected<llvm::endianness>
548-
DLLImportDefinitionGenerator::getTargetEndianness(const Triple &TT) {
548+
DLLImportDefinitionGenerator::getEndianness(const Triple &TT) {
549549
switch (TT.getArch()) {
550550
case Triple::x86_64:
551551
return llvm::endianness::little;
@@ -562,7 +562,7 @@ DLLImportDefinitionGenerator::createStubsGraph(const SymbolMap &Resolved) {
562562
auto PointerSize = getTargetPointerSize(TT);
563563
if (!PointerSize)
564564
return PointerSize.takeError();
565-
auto Endianness = getTargetEndianness(TT);
565+
auto Endianness = getEndianness(TT);
566566
if (!Endianness)
567567
return Endianness.takeError();
568568

llvm/lib/InterfaceStub/ELFObjHandler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ static void initELFHeader(typename ELFT::Ehdr &ElfHeader, uint16_t Machine) {
5757
ElfHeader.e_ident[EI_MAG2] = ElfMagic[EI_MAG2];
5858
ElfHeader.e_ident[EI_MAG3] = ElfMagic[EI_MAG3];
5959
ElfHeader.e_ident[EI_CLASS] = ELFT::Is64Bits ? ELFCLASS64 : ELFCLASS32;
60-
bool IsLittleEndian = ELFT::TargetEndianness == llvm::endianness::little;
60+
bool IsLittleEndian = ELFT::Endianness == llvm::endianness::little;
6161
ElfHeader.e_ident[EI_DATA] = IsLittleEndian ? ELFDATA2LSB : ELFDATA2MSB;
6262
ElfHeader.e_ident[EI_VERSION] = EV_CURRENT;
6363
ElfHeader.e_ident[EI_OSABI] = ELFOSABI_NONE;

0 commit comments

Comments
 (0)