llvm.org GIT mirror llvm / c8f6c44
Fix incorrect ELF typedefs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141871 91177308-0d34-0410-b5e6-96231b3b80d8 Michael J. Spencer 9 years ago
1 changed file(s) with 19 addition(s) and 21 deletion(s). Raw diff Collapse all Expand all
2727 namespace ELF {
2828
2929 typedef uint32_t Elf32_Addr; // Program address
30 typedef uint32_t Elf32_Off; // File offset
3031 typedef uint16_t Elf32_Half;
31 typedef uint32_t Elf32_Off; // File offset
32 typedef uint32_t Elf32_Word;
3233 typedef int32_t Elf32_Sword;
33 typedef uint32_t Elf32_Word;
3434
3535 typedef uint64_t Elf64_Addr;
3636 typedef uint64_t Elf64_Off;
37 typedef int32_t Elf64_Shalf;
37 typedef uint16_t Elf64_Half;
38 typedef uint32_t Elf64_Word;
3839 typedef int32_t Elf64_Sword;
39 typedef uint32_t Elf64_Word;
40 typedef uint64_t Elf64_Xword;
4041 typedef int64_t Elf64_Sxword;
41 typedef uint64_t Elf64_Xword;
42 typedef uint32_t Elf64_Half;
43 typedef uint16_t Elf64_Quarter;
4442
4543 // Object file magic string.
4644 static const char ElfMagic[] = { 0x7f, 'E', 'L', 'F', '\0' };
8684 // types (see above).
8785 struct Elf64_Ehdr {
8886 unsigned char e_ident[EI_NIDENT];
89 Elf64_Quarter e_type;
90 Elf64_Quarter e_machine;
91 Elf64_Half e_version;
87 Elf64_Half e_type;
88 Elf64_Half e_machine;
89 Elf64_Word e_version;
9290 Elf64_Addr e_entry;
9391 Elf64_Off e_phoff;
9492 Elf64_Off e_shoff;
95 Elf64_Half e_flags;
96 Elf64_Quarter e_ehsize;
97 Elf64_Quarter e_phentsize;
98 Elf64_Quarter e_phnum;
99 Elf64_Quarter e_shentsize;
100 Elf64_Quarter e_shnum;
101 Elf64_Quarter e_shstrndx;
93 Elf64_Word e_flags;
94 Elf64_Half e_ehsize;
95 Elf64_Half e_phentsize;
96 Elf64_Half e_phnum;
97 Elf64_Half e_shentsize;
98 Elf64_Half e_shnum;
99 Elf64_Half e_shstrndx;
102100 bool checkMagic() const {
103101 return (memcmp(e_ident, ElfMagic, strlen(ElfMagic))) == 0;
104102 }
618616
619617 // Section header for ELF64 - same fields as ELF32, different types.
620618 struct Elf64_Shdr {
621 Elf64_Half sh_name;
622 Elf64_Half sh_type;
619 Elf64_Word sh_name;
620 Elf64_Word sh_type;
623621 Elf64_Xword sh_flags;
624622 Elf64_Addr sh_addr;
625623 Elf64_Off sh_offset;
626624 Elf64_Xword sh_size;
627 Elf64_Half sh_link;
628 Elf64_Half sh_info;
625 Elf64_Word sh_link;
626 Elf64_Word sh_info;
629627 Elf64_Xword sh_addralign;
630628 Elf64_Xword sh_entsize;
631629 };