Lines Matching refs:shdr
176 ShdrType shdr;
182 if (!Read((uintptr_t)shNdxOffset, &shdr, sizeof(shdr))) {
186 secOffset = shdr.sh_offset;
187 secSize = shdr.sh_size;
202 if (!Read((uintptr_t)offset, &shdr, sizeof(shdr))) {
207 if (!GetSectionNameByIndex(secName, shdr.sh_name)) {
212 if (shdr.sh_size != 0 && secName == GNU_DEBUGDATA) {
214 minidebugInfo_->offset = static_cast<uint64_t>(shdr.sh_offset);
215 minidebugInfo_->size = static_cast<uintptr_t>(shdr.sh_size);
219 shdrInfo.addr = static_cast<uint64_t>(shdr.sh_addr);
220 shdrInfo.entSize = static_cast<uint64_t>(shdr.sh_entsize);
221 shdrInfo.size = static_cast<uint64_t>(shdr.sh_size);
222 shdrInfo.offset = static_cast<uint64_t>(shdr.sh_offset);
225 if (shdr.sh_type == SHT_SYMTAB || shdr.sh_type == SHT_DYNSYM) {
226 if (shdr.sh_link >= ehdr.e_shnum) {
230 elfShdr.name = static_cast<uint32_t>(shdr.sh_name);
231 elfShdr.type = static_cast<uint32_t>(shdr.sh_type);
232 elfShdr.flags = static_cast<uint64_t>(shdr.sh_flags);
233 elfShdr.addr = static_cast<uint64_t>(shdr.sh_addr);
234 elfShdr.offset = static_cast<uint64_t>(shdr.sh_offset);
235 elfShdr.size = static_cast<uint64_t>(shdr.sh_size);
236 elfShdr.link = static_cast<uint32_t>(shdr.sh_link);
237 elfShdr.info = static_cast<uint32_t>(shdr.sh_info);
238 elfShdr.addrAlign = static_cast<uint64_t>(shdr.sh_addralign);
239 elfShdr.entSize = static_cast<uint64_t>(shdr.sh_entsize);
307 const auto &shdr = iter;
308 ParseElfSymbols<SymType>(shdr, isFunc);
314 bool ElfParser::ParseElfSymbols(ElfShdr shdr, bool isFunc)
317 if (!GetSectionInfo(linkShdrInfo, shdr.link)) {
321 uint32_t count = static_cast<uint32_t>((shdr.entSize != 0) ? (shdr.size / shdr.entSize) : 0);
323 uintptr_t offset = static_cast<uintptr_t>(shdr.offset + idx * shdr.entSize);
362 for (const auto &shdr : symShdrs_) {
364 if (!GetSectionInfo(linkShdrInfo, shdr.link)) {
368 uint32_t count = static_cast<uint32_t>((shdr.entSize != 0) ? (shdr.size / shdr.entSize) : 0);
370 uintptr_t offset = static_cast<uintptr_t>(shdr.offset + idx * shdr.entSize);
431 bool ElfParser::GetSectionInfo(ShdrInfo& shdr, const uint32_t idx)
436 shdr = iter.second;
443 bool ElfParser::GetSectionInfo(ShdrInfo& shdr, const std::string& secName)
448 shdr = iter.second;
457 ShdrInfo shdr;
458 if (GetSectionInfo(shdr, secName)) {
459 if (Read(shdr.offset, buf, size)) {