Lines Matching refs:shdr
301 ShdrType shdr; in ReadSectionHeaders() local
304 if (memory_->ReadFully(sh_offset, &shdr, sizeof(shdr))) { in ReadSectionHeaders()
305 sec_offset = shdr.sh_offset; in ReadSectionHeaders()
306 sec_size = shdr.sh_size; in ReadSectionHeaders()
313 if (!memory_->ReadFully(offset, &shdr, sizeof(shdr))) { in ReadSectionHeaders()
317 if (shdr.sh_type == SHT_SYMTAB || shdr.sh_type == SHT_DYNSYM) { in ReadSectionHeaders()
321 if (shdr.sh_link >= ehdr.e_shnum) { in ReadSectionHeaders()
324 uint64_t str_offset = ehdr.e_shoff + shdr.sh_link * ehdr.e_shentsize; in ReadSectionHeaders()
331 symbols_.push_back(new Symbols(shdr.sh_offset, shdr.sh_size, shdr.sh_entsize, in ReadSectionHeaders()
333 } else if (shdr.sh_type == SHT_PROGBITS && sec_size != 0) { in ReadSectionHeaders()
335 if (shdr.sh_name < sec_size) { in ReadSectionHeaders()
337 if (memory_->ReadString(sec_offset + shdr.sh_name, &name)) { in ReadSectionHeaders()
354 *offset_ptr = shdr.sh_offset; in ReadSectionHeaders()
355 *size_ptr = shdr.sh_size; in ReadSectionHeaders()
359 } else if (shdr.sh_type == SHT_STRTAB) { in ReadSectionHeaders()
361 strtabs_.push_back(std::make_pair<uint64_t, uint64_t>(static_cast<uint64_t>(shdr.sh_addr), in ReadSectionHeaders()
362 static_cast<uint64_t>(shdr.sh_offset))); in ReadSectionHeaders()
363 } else if (shdr.sh_type == SHT_NOTE) { in ReadSectionHeaders()
364 if (shdr.sh_name < sec_size) { in ReadSectionHeaders()
366 if (memory_->ReadString(sec_offset + shdr.sh_name, &name) && in ReadSectionHeaders()
368 gnu_build_id_offset_ = shdr.sh_offset; in ReadSectionHeaders()
369 gnu_build_id_size_ = shdr.sh_size; in ReadSectionHeaders()
549 ShdrType shdr; in GetBuildIDInfo() local
555 if (!memory->ReadFully(sh_offset, &shdr, sizeof(shdr))) { in GetBuildIDInfo()
558 sec_offset = shdr.sh_offset; in GetBuildIDInfo()
559 sec_size = shdr.sh_size; in GetBuildIDInfo()
564 if (!memory->ReadFully(offset, &shdr, sizeof(shdr))) { in GetBuildIDInfo()
568 if (shdr.sh_type == SHT_NOTE && shdr.sh_name < sec_size && in GetBuildIDInfo()
569 memory->ReadString(sec_offset + shdr.sh_name, &name) && name == ".note.gnu.build-id") { in GetBuildIDInfo()
570 *build_id_offset = shdr.sh_offset; in GetBuildIDInfo()
571 *build_id_size = shdr.sh_size; in GetBuildIDInfo()