Lines Matching refs:Ehdr
903 const auto &Ehdr = *ElfFile.getHeader(); in readProgramHeaders() local
911 PrHdr.OriginalOffset = PrHdr.Offset = PrHdr.VAddr = Ehdr.e_phoff; in readProgramHeaders()
913 PrHdr.FileSize = PrHdr.MemSize = Ehdr.e_phentsize * Ehdr.e_phnum; in readProgramHeaders()
1163 const auto &Ehdr = *ElfFile.getHeader(); in build() local
1165 Obj.OSABI = Ehdr.e_ident[EI_OSABI]; in build()
1166 Obj.ABIVersion = Ehdr.e_ident[EI_ABIVERSION]; in build()
1167 Obj.Type = Ehdr.e_type; in build()
1168 Obj.Machine = Ehdr.e_machine; in build()
1169 Obj.Version = Ehdr.e_version; in build()
1170 Obj.Entry = Ehdr.e_entry; in build()
1171 Obj.Flags = Ehdr.e_flags; in build()
1176 uint32_t ShstrIndex = Ehdr.e_shstrndx; in build()
1183 "e_shstrndx field value " + Twine(Ehdr.e_shstrndx) + in build()
1185 "e_shstrndx field value " + Twine(Ehdr.e_shstrndx) + in build()
1226 Elf_Ehdr &Ehdr = *reinterpret_cast<Elf_Ehdr *>(B); in writeEhdr() local
1227 std::fill(Ehdr.e_ident, Ehdr.e_ident + 16, 0); in writeEhdr()
1228 Ehdr.e_ident[EI_MAG0] = 0x7f; in writeEhdr()
1229 Ehdr.e_ident[EI_MAG1] = 'E'; in writeEhdr()
1230 Ehdr.e_ident[EI_MAG2] = 'L'; in writeEhdr()
1231 Ehdr.e_ident[EI_MAG3] = 'F'; in writeEhdr()
1232 Ehdr.e_ident[EI_CLASS] = ELFT::Is64Bits ? ELFCLASS64 : ELFCLASS32; in writeEhdr()
1233 Ehdr.e_ident[EI_DATA] = in writeEhdr()
1235 Ehdr.e_ident[EI_VERSION] = EV_CURRENT; in writeEhdr()
1236 Ehdr.e_ident[EI_OSABI] = Obj.OSABI; in writeEhdr()
1237 Ehdr.e_ident[EI_ABIVERSION] = Obj.ABIVersion; in writeEhdr()
1239 Ehdr.e_type = Obj.Type; in writeEhdr()
1240 Ehdr.e_machine = Obj.Machine; in writeEhdr()
1241 Ehdr.e_version = Obj.Version; in writeEhdr()
1242 Ehdr.e_entry = Obj.Entry; in writeEhdr()
1245 Ehdr.e_phnum = llvm::size(Obj.segments()); in writeEhdr()
1246 Ehdr.e_phoff = (Ehdr.e_phnum != 0) ? Obj.ProgramHdrSegment.Offset : 0; in writeEhdr()
1247 Ehdr.e_phentsize = (Ehdr.e_phnum != 0) ? sizeof(Elf_Phdr) : 0; in writeEhdr()
1248 Ehdr.e_flags = Obj.Flags; in writeEhdr()
1249 Ehdr.e_ehsize = sizeof(Elf_Ehdr); in writeEhdr()
1251 Ehdr.e_shentsize = sizeof(Elf_Shdr); in writeEhdr()
1252 Ehdr.e_shoff = Obj.SHOffset; in writeEhdr()
1261 Ehdr.e_shnum = 0; in writeEhdr()
1263 Ehdr.e_shnum = Shnum; in writeEhdr()
1271 Ehdr.e_shstrndx = SHN_XINDEX; in writeEhdr()
1273 Ehdr.e_shstrndx = Obj.SectionNames->Index; in writeEhdr()
1275 Ehdr.e_shentsize = 0; in writeEhdr()
1276 Ehdr.e_shoff = 0; in writeEhdr()
1277 Ehdr.e_shnum = 0; in writeEhdr()
1278 Ehdr.e_shstrndx = 0; in writeEhdr()