Lines Matching refs:elf_file
33 std::unique_ptr<ElfFile> elf_file(ElfFile::Open(file, true, false, &error_msg)); in Fixup() local
34 CHECK(elf_file.get() != nullptr) << error_msg; in Fixup()
37 Elf32_Addr oatdata_address = ElfWriter::GetOatDataAddress(elf_file.get()); in Fixup()
40 if (!FixupDynamic(*elf_file.get(), base_address)) { in Fixup()
44 if (!FixupSectionHeaders(*elf_file.get(), base_address)) { in Fixup()
48 if (!FixupProgramHeaders(*elf_file.get(), base_address)) { in Fixup()
52 if (!FixupSymbols(*elf_file.get(), base_address, true)) { in Fixup()
56 if (!FixupSymbols(*elf_file.get(), base_address, false)) { in Fixup()
60 if (!FixupRelocations(*elf_file.get(), base_address)) { in Fixup()
68 bool ElfFixup::FixupDynamic(ElfFile& elf_file, uintptr_t base_address) { in FixupDynamic() argument
69 for (Elf32_Word i = 0; i < elf_file.GetDynamicNum(); i++) { in FixupDynamic()
70 Elf32_Dyn& elf_dyn = elf_file.GetDynamic(i); in FixupDynamic()
72 if (IsDynamicSectionPointer(d_tag, elf_file.GetHeader().e_machine)) { in FixupDynamic()
76 elf_file.GetFile().GetPath().c_str(), i, in FixupDynamic()
86 bool ElfFixup::FixupSectionHeaders(ElfFile& elf_file, uintptr_t base_address) { in FixupSectionHeaders() argument
87 for (Elf32_Word i = 0; i < elf_file.GetSectionHeaderNum(); i++) { in FixupSectionHeaders()
88 Elf32_Shdr* sh = elf_file.GetSectionHeader(i); in FixupSectionHeaders()
96 elf_file.GetFile().GetPath().c_str(), i, in FixupSectionHeaders()
104 bool ElfFixup::FixupProgramHeaders(ElfFile& elf_file, uintptr_t base_address) { in FixupProgramHeaders() argument
106 for (Elf32_Word i = 0; i < elf_file.GetProgramHeaderNum(); i++) { in FixupProgramHeaders()
107 Elf32_Phdr* ph = elf_file.GetProgramHeader(i); in FixupProgramHeaders()
109 CHECK_EQ(ph->p_vaddr, ph->p_paddr) << elf_file.GetFile().GetPath() << " i=" << i; in FixupProgramHeaders()
111 << elf_file.GetFile().GetPath() << " i=" << i; in FixupProgramHeaders()
114 elf_file.GetFile().GetPath().c_str(), i, in FixupProgramHeaders()
120 << elf_file.GetFile().GetPath() << " i=" << i; in FixupProgramHeaders()
125 bool ElfFixup::FixupSymbols(ElfFile& elf_file, uintptr_t base_address, bool dynamic) { in FixupSymbols() argument
128 Elf32_Shdr* symbol_section = elf_file.FindSectionByType(section_type); in FixupSymbols()
131 CHECK(!dynamic) << elf_file.GetFile().GetPath(); in FixupSymbols()
134 for (uint32_t i = 0; i < elf_file.GetSymbolNum(*symbol_section); i++) { in FixupSymbols()
135 Elf32_Sym* symbol = elf_file.GetSymbol(section_type, i); in FixupSymbols()
140 elf_file.GetFile().GetPath().c_str(), i, in FixupSymbols()
149 bool ElfFixup::FixupRelocations(ElfFile& elf_file, uintptr_t base_address) { in FixupRelocations() argument
150 for (Elf32_Word i = 0; i < elf_file.GetSectionHeaderNum(); i++) { in FixupRelocations()
151 Elf32_Shdr* sh = elf_file.GetSectionHeader(i); in FixupRelocations()
154 for (uint32_t i = 0; i < elf_file.GetRelNum(*sh); i++) { in FixupRelocations()
155 Elf32_Rel& rel = elf_file.GetRel(*sh, i); in FixupRelocations()
158 elf_file.GetFile().GetPath().c_str(), i, in FixupRelocations()
164 for (uint32_t i = 0; i < elf_file.GetRelaNum(*sh); i++) { in FixupRelocations()
165 Elf32_Rela& rela = elf_file.GetRela(*sh, i); in FixupRelocations()
168 elf_file.GetFile().GetPath().c_str(), i, in FixupRelocations()