Lines Matching defs:Ehdr
34 T Ehdr{}; // Zero-initialise the header.
35 Ehdr.e_ident[ELF::EI_MAG0] = 0x7f;
36 Ehdr.e_ident[ELF::EI_MAG1] = 'E';
37 Ehdr.e_ident[ELF::EI_MAG2] = 'L';
38 Ehdr.e_ident[ELF::EI_MAG3] = 'F';
39 Ehdr.e_ident[ELF::EI_CLASS] = Class;
40 Ehdr.e_ident[ELF::EI_DATA] = Encoding;
41 Ehdr.e_ident[ELF::EI_VERSION] = 1;
42 Ehdr.e_ident[ELF::EI_OSABI] = OS;
43 Ehdr.e_type = ELF::ET_REL;
44 Ehdr.e_machine = Machine;
45 Ehdr.e_version = 1;
46 Ehdr.e_flags = Flags;
47 Ehdr.e_ehsize = sizeof(T);
51 sys::swapByteOrder(Ehdr.e_type);
52 sys::swapByteOrder(Ehdr.e_machine);
53 sys::swapByteOrder(Ehdr.e_version);
54 sys::swapByteOrder(Ehdr.e_ehsize);
57 uint8_t *EhdrBytes = reinterpret_cast<uint8_t *>(&Ehdr);
59 std::copy(EhdrBytes, EhdrBytes + sizeof(Ehdr), std::back_inserter(Bytes));