Lines Matching refs:shdr

344   ShdrType shdr;  in ReadSectionHeaders()  local
347 if (memory_->ReadFully(sh_offset, &shdr, sizeof(shdr))) { in ReadSectionHeaders()
348 sec_offset = shdr.sh_offset; in ReadSectionHeaders()
349 sec_size = shdr.sh_size; in ReadSectionHeaders()
356 if (!memory_->ReadFully(offset, &shdr, sizeof(shdr))) { in ReadSectionHeaders()
360 if (shdr.sh_type == SHT_SYMTAB || shdr.sh_type == SHT_DYNSYM) { in ReadSectionHeaders()
364 if (shdr.sh_link >= ehdr.e_shnum) { in ReadSectionHeaders()
367 uint64_t str_offset = ehdr.e_shoff + shdr.sh_link * ehdr.e_shentsize; in ReadSectionHeaders()
374 symbols_.push_back(new Symbols(shdr.sh_offset, shdr.sh_size, shdr.sh_entsize, in ReadSectionHeaders()
376 } else if ((shdr.sh_type == SHT_PROGBITS || shdr.sh_type == SHT_NOBITS) && sec_size != 0) { in ReadSectionHeaders()
378 if (shdr.sh_name < sec_size) { in ReadSectionHeaders()
380 if (memory_->ReadString(sec_offset + shdr.sh_name, &name, sec_size - shdr.sh_name)) { in ReadSectionHeaders()
383 .offset = shdr.sh_offset, in ReadSectionHeaders()
384 .size = shdr.sh_size, in ReadSectionHeaders()
385 .flags = shdr.sh_flags, in ReadSectionHeaders()
386 .bias = static_cast<int64_t>(static_cast<uint64_t>(shdr.sh_addr) - shdr.sh_offset)}; in ReadSectionHeaders()
388 gnu_debugdata_offset_ = shdr.sh_offset; in ReadSectionHeaders()
389 gnu_debugdata_size_ = shdr.sh_size; in ReadSectionHeaders()
392 .offset = shdr.sh_offset, in ReadSectionHeaders()
393 .size = shdr.sh_size, in ReadSectionHeaders()
394 .flags = shdr.sh_flags, in ReadSectionHeaders()
395 .bias = static_cast<int64_t>(static_cast<uint64_t>(shdr.sh_addr) - shdr.sh_offset)}; in ReadSectionHeaders()
398 .offset = shdr.sh_offset, in ReadSectionHeaders()
399 .size = shdr.sh_size, in ReadSectionHeaders()
400 .flags = shdr.sh_flags, in ReadSectionHeaders()
401 .bias = static_cast<int64_t>(static_cast<uint64_t>(shdr.sh_addr) - shdr.sh_offset)}; in ReadSectionHeaders()
403 data_offset_ = shdr.sh_offset; in ReadSectionHeaders()
404 data_vaddr_start_ = shdr.sh_addr; in ReadSectionHeaders()
405 if (__builtin_add_overflow(data_vaddr_start_, shdr.sh_size, &data_vaddr_end_)) { in ReadSectionHeaders()
411 text_addr_ = shdr.sh_addr; in ReadSectionHeaders()
412 text_size_ = shdr.sh_size; in ReadSectionHeaders()
416 } else if (shdr.sh_type == SHT_STRTAB) { in ReadSectionHeaders()
418 strtabs_.push_back(std::make_pair<uint64_t, uint64_t>(static_cast<uint64_t>(shdr.sh_addr), in ReadSectionHeaders()
419 static_cast<uint64_t>(shdr.sh_offset))); in ReadSectionHeaders()
420 } else if (shdr.sh_type == SHT_NOTE) { in ReadSectionHeaders()
421 if (shdr.sh_name < sec_size) { in ReadSectionHeaders()
423 if (memory_->ReadString(sec_offset + shdr.sh_name, &name, sec_size - shdr.sh_name) && in ReadSectionHeaders()
425 gnu_build_id_offset_ = shdr.sh_offset; in ReadSectionHeaders()
426 gnu_build_id_size_ = shdr.sh_size; in ReadSectionHeaders()
631 ShdrType shdr; in GetBuildIDInfo() local
637 if (!memory->ReadFully(sh_offset, &shdr, sizeof(shdr))) { in GetBuildIDInfo()
640 sec_offset = shdr.sh_offset; in GetBuildIDInfo()
641 sec_size = shdr.sh_size; in GetBuildIDInfo()
646 if (!memory->ReadFully(offset, &shdr, sizeof(shdr))) { in GetBuildIDInfo()
650 if (shdr.sh_type == SHT_NOTE && shdr.sh_name < sec_size && in GetBuildIDInfo()
651 memory->ReadString(sec_offset + shdr.sh_name, &name, sec_size - shdr.sh_name) && in GetBuildIDInfo()
653 *build_id_offset = shdr.sh_offset; in GetBuildIDInfo()
654 *build_id_size = shdr.sh_size; in GetBuildIDInfo()