@@ -52,6 +52,7 @@ template <endianness E, bool Is64> struct ELFType {
52
52
53
53
public:
54
54
static const endianness TargetEndianness = E;
55
+ static const endianness Endianness = E;
55
56
static const bool Is64Bits = Is64;
56
57
57
58
using uint = std::conditional_t <Is64, uint64_t , uint32_t >;
@@ -145,9 +146,9 @@ using ELF64BE = ELFType<llvm::endianness::big, true>;
145
146
// Section header.
146
147
template <class ELFT > struct Elf_Shdr_Base ;
147
148
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 )
151
152
Elf_Word sh_name; // Section name (index into string table)
152
153
Elf_Word sh_type; // Section type (SHT_*)
153
154
Elf_Word sh_flags; // Section flags (SHF_*)
@@ -160,9 +161,9 @@ struct Elf_Shdr_Base<ELFType<TargetEndianness, false>> {
160
161
Elf_Word sh_entsize; // Size of records contained within the section
161
162
};
162
163
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 )
166
167
Elf_Word sh_name; // Section name (index into string table)
167
168
Elf_Word sh_type; // Section type (SHT_*)
168
169
Elf_Xword sh_flags; // Section flags (SHF_*)
@@ -190,9 +191,9 @@ struct Elf_Shdr_Impl : Elf_Shdr_Base<ELFT> {
190
191
191
192
template <class ELFT > struct Elf_Sym_Base ;
192
193
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 )
196
197
Elf_Word st_name; // Symbol name (index into string table)
197
198
Elf_Addr st_value; // Value or address associated with the symbol
198
199
Elf_Word st_size; // Size of the symbol
@@ -201,9 +202,9 @@ struct Elf_Sym_Base<ELFType<TargetEndianness, false>> {
201
202
Elf_Half st_shndx; // Which section (header table index) it's defined in
202
203
};
203
204
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 )
207
208
Elf_Word st_name; // Symbol name (index into string table)
208
209
unsigned char st_info; // Symbol's type and binding attributes
209
210
unsigned char st_other; // Must be zero; reserved
@@ -349,19 +350,19 @@ struct Elf_Vernaux_Impl {
349
350
// / table section (.dynamic) look like.
350
351
template <class ELFT > struct Elf_Dyn_Base ;
351
352
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 )
355
356
Elf_Sword d_tag;
356
357
union {
357
358
Elf_Word d_val;
358
359
Elf_Addr d_ptr;
359
360
} d_un;
360
361
};
361
362
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 )
365
366
Elf_Sxword d_tag;
366
367
union {
367
368
Elf_Xword d_val;
@@ -381,9 +382,9 @@ struct Elf_Dyn_Impl : Elf_Dyn_Base<ELFT> {
381
382
uintX_t getPtr () const { return d_un.d_ptr ; }
382
383
};
383
384
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 )
387
388
static const bool IsRela = false ;
388
389
Elf_Addr r_offset; // Location (file byte offset, or program virtual addr)
389
390
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> {
416
417
}
417
418
};
418
419
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 )
423
424
static const bool IsRela = true ;
424
425
Elf_Sword r_addend; // Compute value for relocatable field by adding this
425
426
};
426
427
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 )
430
431
static const bool IsRela = false ;
431
432
Elf_Addr r_offset; // Location (file byte offset, or program virtual addr)
432
433
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> {
469
470
}
470
471
};
471
472
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 )
476
477
static const bool IsRela = true ;
477
478
Elf_Sxword r_addend; // Compute value for relocatable field by adding this.
478
479
};
@@ -504,9 +505,9 @@ struct Elf_Ehdr_Impl {
504
505
unsigned char getDataEncoding () const { return e_ident[ELF::EI_DATA]; }
505
506
};
506
507
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 )
510
511
Elf_Word p_type; // Type of segment
511
512
Elf_Off p_offset; // FileOffset where segment is located, in bytes
512
513
Elf_Addr p_vaddr; // Virtual Address of beginning of segment
@@ -517,9 +518,9 @@ struct Elf_Phdr_Impl<ELFType<TargetEndianness, false>> {
517
518
Elf_Word p_align; // Segment alignment constraint
518
519
};
519
520
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 )
523
524
Elf_Word p_type; // Type of segment
524
525
Elf_Word p_flags; // Segment flags
525
526
Elf_Off p_offset; // FileOffset where segment is located, in bytes
@@ -574,17 +575,17 @@ struct Elf_GnuHash_Impl {
574
575
575
576
// Compressed section headers.
576
577
// 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 )
580
581
Elf_Word ch_type;
581
582
Elf_Word ch_size;
582
583
Elf_Word ch_addralign;
583
584
};
584
585
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 )
588
589
Elf_Word ch_type;
589
590
Elf_Word ch_reserved;
590
591
Elf_Xword ch_size;
@@ -742,17 +743,17 @@ template <class ELFT> struct Elf_CGProfile_Impl {
742
743
template <class ELFT >
743
744
struct Elf_Mips_RegInfo ;
744
745
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 )
748
749
Elf_Word ri_gprmask; // bit-mask of used general registers
749
750
Elf_Word ri_cprmask[4 ]; // bit-mask of used co-processor registers
750
751
Elf_Addr ri_gp_value; // gp register value
751
752
};
752
753
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 )
756
757
Elf_Word ri_gprmask; // bit-mask of used general registers
757
758
Elf_Word ri_pad; // unused padding field
758
759
Elf_Word ri_cprmask[4 ]; // bit-mask of used co-processor registers
0 commit comments