| 409 | } |
| 410 | |
| 411 | void ElfView::GetRelocEntries(BinaryReader& reader, const vector<Elf64SectionHeader>& sections, |
| 412 | bool implicit, vector<ELFRelocEntry>& result) |
| 413 | { |
| 414 | size_t relocSize = m_elf32 ? 8 : 16; |
| 415 | if (!implicit) |
| 416 | relocSize += m_elf32 ? 4 : 8; |
| 417 | |
| 418 | for (auto& section : sections) |
| 419 | { |
| 420 | for (uint64_t j = 0; j < section.size / relocSize; j++) |
| 421 | { |
| 422 | reader.Seek(section.offset + (j * relocSize)); |
| 423 | uint64_t ofs = m_elf32 ? reader.Read32() : reader.Read64(); |
| 424 | uint64_t info = m_elf32 ? reader.Read32() : reader.Read64(); |
| 425 | uint64_t addend = 0; |
| 426 | if (!implicit) |
| 427 | addend = m_elf32 ? reader.Read32() : reader.Read64(); |
| 428 | |
| 429 | result.push_back(ELFRelocEntry(ofs, info >> (m_elf32 ? 8 : 32), info & (m_elf32 ? 0xff : 0xffffffff), |
| 430 | addend, section.info, implicit)); |
| 431 | } |
| 432 | } |
| 433 | } |
| 434 | |
| 435 | static bool In(const string& str, const vector<string>& list) |
| 436 | { |
nothing calls this directly
no test coverage detected