Lines Matching refs:error_msg

64                                                    std::string* error_msg) {  in Open()  argument
76 if (!elf_file->Setup(file, prot, flags, low_4gb, error_msg)) { in Open()
87 std::string* error_msg) { in Open() argument
90 if (!elf_file->Setup(file, prot, flags, low_4gb, error_msg)) { in Open()
101 std::string* error_msg) { in Setup() argument
105 *error_msg = StringPrintf("Failed to get length of file: '%s' fd=%d: %s", in Setup()
111 *error_msg = StringPrintf("File size of %zd bytes not large enough to contain ELF header of " in Setup()
128 error_msg), in Setup()
129 error_msg)) { in Setup()
135 *error_msg = StringPrintf("File size of %zd bytes not large enough to contain ELF program " in Setup()
148 error_msg), in Setup()
149 error_msg)) { in Setup()
150 *error_msg = StringPrintf("Failed to map ELF program headers: %s", error_msg->c_str()); in Setup()
163 error_msg), in Setup()
164 error_msg)) { in Setup()
165 *error_msg = StringPrintf("Failed to map ELF file: %s", error_msg->c_str()); in Setup()
173 if (!CheckAndSet(GetHeader().e_phoff, "program headers", &program_headers_start_, error_msg)) { in Setup()
178 if (!CheckAndSet(GetHeader().e_shoff, "section headers", &section_headers_start_, error_msg)) { in Setup()
185 *error_msg = StringPrintf("Failed to find shstrtab section header in ELF file: '%s'", in Setup()
193 *error_msg = StringPrintf("Failed to find PT_DYNAMIC program header in ELF file: '%s'", in Setup()
199 reinterpret_cast<uint8_t**>(&dynamic_section_start_), error_msg)) { in Setup()
207 *error_msg = StringPrintf("Failed to find section header for section %d in ELF file: '%s'", in Setup()
214 reinterpret_cast<uint8_t**>(&symtab_section_start_), error_msg)) { in Setup()
221 reinterpret_cast<uint8_t**>(&dynsym_section_start_), error_msg)) { in Setup()
233 reinterpret_cast<uint8_t**>(&dynstr_section_start_), error_msg)) { in Setup()
242 reinterpret_cast<uint8_t**>(&strtab_section_start_), error_msg)) { in Setup()
262 reinterpret_cast<uint8_t**>(&hash_section_start_), error_msg)) { in Setup()
271 if (!CheckSectionsExist(file, error_msg)) { in Setup()
287 uint8_t** target, std::string* error_msg) { in CheckAndSet() argument
289 *error_msg = StringPrintf("Offset %d is out of range for %s in ELF file: '%s'", offset, label, in CheckAndSet()
331 bool ElfFileImpl<ElfTypes>::CheckSectionsExist(File* file, std::string* error_msg) const { in CheckSectionsExist()
335 *error_msg = StringPrintf("No section headers in ELF file: '%s'", file->GetPath().c_str()); in CheckSectionsExist()
342 *error_msg = StringPrintf("Failed to find PT_DYNAMIC program header in ELF file: '%s'", in CheckSectionsExist()
349 *error_msg = StringPrintf("Failed to find dynamic section in ELF file: '%s'", in CheckSectionsExist()
359 *error_msg = StringPrintf("No strtab for symtab in ELF file: '%s'", file->GetPath().c_str()); in CheckSectionsExist()
366 *error_msg = StringPrintf("Symtab is not linked to the strtab in ELF file: '%s'", in CheckSectionsExist()
374 *error_msg = StringPrintf("No dynstr in ELF file: '%s'", file->GetPath().c_str()); in CheckSectionsExist()
378 *error_msg = StringPrintf("No dynsym in ELF file: '%s'", file->GetPath().c_str()); in CheckSectionsExist()
384 *error_msg = StringPrintf("Failed to find hash section in ELF file: '%s'", in CheckSectionsExist()
392 *error_msg = StringPrintf("Hash section is not linked to the dynstr in ELF file: '%s'", in CheckSectionsExist()
405 *error_msg = StringPrintf("Shstrtab is not in the mapped ELF file: '%s'", in CheckSectionsExist()
415 bool ElfFileImpl<ElfTypes>::SetMap(File* file, MemMap&& map, std::string* error_msg) { in SetMap() argument
418 DCHECK(!error_msg->empty()); in SetMap()
430 *error_msg = StringPrintf("Failed to find ELF magic value %d %d %d %d in %s, found %d %d %d %d", in SetMap()
441 *error_msg = StringPrintf("Failed to find expected EI_CLASS value %d in %s, found %d", in SetMap()
448 *error_msg = StringPrintf("Failed to find expected EI_DATA value %d in %s, found %d", in SetMap()
455 *error_msg = StringPrintf("Failed to find expected EI_VERSION value %d in %s, found %d", in SetMap()
462 *error_msg = StringPrintf("Failed to find expected e_type value %d in %s, found %d", in SetMap()
469 *error_msg = StringPrintf("Failed to find expected e_version value %d in %s, found %d", in SetMap()
476 *error_msg = StringPrintf("Failed to find expected e_entry value %d in %s, found %d", in SetMap()
483 *error_msg = StringPrintf("Failed to find non-zero e_phoff value in %s", in SetMap()
488 *error_msg = StringPrintf("Failed to find non-zero e_shoff value in %s", in SetMap()
493 *error_msg = StringPrintf("Failed to find non-zero e_ehsize value in %s", in SetMap()
498 *error_msg = StringPrintf("Failed to find non-zero e_phentsize value in %s", in SetMap()
503 *error_msg = StringPrintf("Failed to find non-zero e_phnum value in %s", in SetMap()
508 *error_msg = StringPrintf("Failed to find non-zero e_shentsize value in %s", in SetMap()
513 *error_msg = StringPrintf("Failed to find non-zero e_shnum value in %s", in SetMap()
518 *error_msg = StringPrintf("Failed to find non-zero e_shstrndx value in %s", in SetMap()
523 *error_msg = StringPrintf("Failed to find e_shnum value %d less than %d in %s", in SetMap()
532 *error_msg = StringPrintf("Failed to find e_phoff value %" PRIu64 " less than %zd in %s", in SetMap()
539 *error_msg = StringPrintf("Failed to find e_shoff value %" PRIu64 " less than %zd in %s", in SetMap()
1023 bool ElfFileImpl<ElfTypes>::GetLoadedSize(size_t* size, std::string* error_msg) const { in GetLoadedSize()
1025 return GetLoadedAddressRange(&vaddr_begin, size, error_msg); in GetLoadedSize()
1032 /*out*/std::string* error_msg) const { in GetLoadedAddressRange()
1050 *error_msg = oss.str(); in GetLoadedAddressRange()
1068 *error_msg = oss.str(); in GetLoadedAddressRange()
1098 /*out*/std::string* error_msg) { in Load() argument
1106 *error_msg = oss.str(); in Load()
1138 *error_msg = StringPrintf("Failed to get length of file: '%s' fd=%d: %s", in Load()
1146 if (!GetLoadedAddressRange(&vaddr_begin, &vaddr_size, error_msg)) { in Load()
1147 DCHECK(!error_msg->empty()); in Load()
1159 error_msg); in Load()
1161 *error_msg = StringPrintf("Failed to allocate %s: %s", in Load()
1163 error_msg->c_str()); in Load()
1201 *error_msg = StringPrintf("Invalid p_filesz > p_memsz (%" PRIu64 " > %" PRIu64 "): %s", in Load()
1209 *error_msg = StringPrintf("Unsupported unaligned p_filesz < p_memsz (%" PRIu64 in Load()
1217 *error_msg = StringPrintf("File size of %zd bytes not large enough to contain ELF segment " in Load()
1235 error_msg); in Load()
1237 *error_msg = StringPrintf("Failed to map ELF file segment %d from %s: %s", in Load()
1238 i, file->GetPath().c_str(), error_msg->c_str()); in Load()
1242 … *error_msg = StringPrintf("Failed to map ELF file segment %d from %s at expected address %p, " in Load()
1259 error_msg); in Load()
1261 *error_msg = StringPrintf("Failed to map zero-initialized ELF file segment %d from %s: %s", in Load()
1262 i, file->GetPath().c_str(), error_msg->c_str()); in Load()
1266 *error_msg = StringPrintf("Failed to map zero-initialized ELF file segment %d from %s " in Load()
1278 *error_msg = StringPrintf("dynamic section address invalid in ELF file %s", in Load()
1290 *error_msg = StringPrintf("DT_HASH value %p does not refer to a loaded ELF segment of %s", in Load()
1299 *error_msg = StringPrintf("DT_HASH value %p does not refer to a loaded ELF segment of %s", in Load()
1308 *error_msg = StringPrintf("DT_HASH value %p does not refer to a loaded ELF segment of %s", in Load()
1317 *error_msg = StringPrintf("DT_NULL found after %d .dynamic entries, " in Load()
1328 if (!CheckSectionsExist(file, error_msg)) { in Load()
1421 bool ElfFileImpl<ElfTypes>::Strip(File* file, std::string* error_msg) { in Strip() argument
1515 *error_msg = StringPrintf("Failed to truncate while stripping ELF file: '%s': %s", in Strip()
1698 /*out*/std::string* error_msg) { in Open() argument
1700 *error_msg = StringPrintf("File %s is too short to be a valid ELF file", in Open()
1711 error_msg); in Open()
1721 error_msg); in Open()
1731 error_msg); in Open()
1737 *error_msg = StringPrintf("Failed to find expected EI_CLASS value %d or %d in %s, found %d", in Open()
1745 ElfFile* ElfFile::Open(File* file, int mmap_prot, int mmap_flags, /*out*/std::string* error_msg) { in Open() argument
1749 *error_msg = StringPrintf("File %s is too short to be a valid ELF file", in Open()
1760 error_msg); in Open()
1770 error_msg); in Open()
1780 error_msg); in Open()
1786 *error_msg = StringPrintf("Failed to find expected EI_CLASS value %d or %d in %s, found %d", in Open()
1806 /*out*/std::string* error_msg) { in Load() argument
1807 DELEGATE_TO_IMPL(Load, file, executable, low_4gb, reservation, error_msg); in Load()
1875 bool ElfFile::GetLoadedSize(size_t* size, std::string* error_msg) const { in GetLoadedSize()
1876 DELEGATE_TO_IMPL(GetLoadedSize, size, error_msg); in GetLoadedSize()
1879 bool ElfFile::Strip(File* file, std::string* error_msg) { in Strip() argument
1880 std::unique_ptr<ElfFile> elf_file(ElfFile::Open(file, true, false, /*low_4gb=*/false, error_msg)); in Strip()
1886 return elf_file->elf64_->Strip(file, error_msg); in Strip()
1888 return elf_file->elf32_->Strip(file, error_msg); in Strip()