Lines Matching defs:ehdr
64 EhdrType ehdr;
65 if (!Read(0, &ehdr, sizeof(ehdr))) {
69 if (!ParseElfHeaders<EhdrType>(ehdr)) {
74 if (!ParseProgramHeaders<EhdrType, PhdrType>(ehdr)) {
79 if (!ParseSectionHeaders<EhdrType, ShdrType>(ehdr)) {
87 bool ElfParser::ParseElfHeaders(const EhdrType& ehdr)
89 if (ehdr.e_shnum == 0) {
93 auto machine = ehdr.e_machine;
107 elfSize_ = ehdr.e_shoff + ehdr.e_shentsize * ehdr.e_shnum;
112 bool ElfParser::ParseProgramHeaders(const EhdrType& ehdr)
114 uint64_t offset = ehdr.e_phoff;
116 for (size_t i = 0; i < ehdr.e_phnum; i++, offset += ehdr.e_phentsize) {
172 bool ElfParser::ParseSectionHeaders(const EhdrType& ehdr)
174 uint64_t offset = ehdr.e_shoff;
178 if (ehdr.e_shstrndx < ehdr.e_shnum) {
181 uint64_t shNdxOffset = offset + ehdr.e_shstrndx * ehdr.e_shentsize;
193 ehdr.e_shstrndx, ehdr.e_shnum);
197 offset += ehdr.e_shentsize;
198 for (size_t i = 1; i < ehdr.e_shnum; i++, offset += ehdr.e_shentsize) {
199 if (i == ehdr.e_shstrndx) {
226 if (shdr.sh_link >= ehdr.e_shnum) {