Lines Matching refs:elf
7 #include <elf.h>
29 Elf_Scn *FindElfSection(Elf *elf, const std::vector<string> &names) {
31 if (elf_getshdrstrndx(elf, &shstrndx) != 0) {
36 if (!elf_rawdata(elf_getscn(elf, shstrndx), nullptr)) return nullptr;
41 while ((sec = elf_nextscn(elf, sec)) != nullptr) {
44 char *n = elf_strptr(elf, shstrndx, shdr.sh_name);
61 bool GetBuildID(Elf *elf, string *buildid) {
62 Elf_Kind kind = elf_kind(elf);
64 DLOG(ERROR) << "Not an ELF file: " << elf_errmsg(-1);
70 Elf_Scn *section = FindElfSection(elf, kNoteSectionNames);
108 if (errno != ENOENT) LOG(ERROR) << "Failed to open ELF file: " << filename;
119 Elf *elf = elf_begin(fd, ELF_C_READ_MMAP, nullptr);
120 if (elf == nullptr) {
121 LOG(ERROR) << "Could not read ELF file.";
126 bool err = GetBuildID(elf, buildid);
128 elf_end(elf);