Lines Matching refs:elf

31 #include ELFUTILS_HEADER(elf)
55 check_orig_strings (Elf *elf, int ndx, const char *msg)
59 const char *str = elf_strptr (elf, ndx, 0);
64 str = elf_strptr (elf, ndx, 1);
69 str = elf_strptr (elf, ndx, orig_str1_off);
74 str = elf_strptr (elf, ndx, orig_str2_off);
79 str = elf_strptr (elf, ndx, orig_str3_off);
86 check_strings (Elf *elf, int ndx, const char *msg)
88 check_orig_strings (elf, ndx, msg);
90 const char *str = elf_strptr (elf, ndx, str1_off);
95 str = elf_strptr (elf, ndx, str2_off);
100 str = elf_strptr (elf, ndx, str3_off);
145 Elf *elf = elf_begin (fd, use_mmap ? ELF_C_WRITE_MMAP : ELF_C_WRITE, NULL);
146 if (elf == NULL)
153 if (gelf_newehdr (elf, class) == 0)
160 GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem);
175 Elf_Scn *scn = elf_newscn (elf);
207 if (gelf_update_ehdr (elf, ehdr) == 0)
231 if (elf_update (elf, ELF_C_NULL) < 0)
238 check_orig_strings (elf, ndx, "first elf_update, before write");
241 if (elf_update (elf, ELF_C_WRITE) < 0)
248 check_orig_strings (elf, ndx, "first elf_update, after write");
251 scn = elf_getscn (elf, ndx);
266 if (elf_update (elf, ELF_C_NULL) < 0)
273 check_strings (elf, ndx, "first extra strings");
275 if (elf_end (elf) != 0)
291 elf = elf_begin (fd, use_mmap ? ELF_C_RDWR_MMAP : ELF_C_RDWR, NULL);
292 if (elf == NULL)
299 check_orig_strings (elf, ndx, "read ELF file, orig strings");
302 scn = elf_getscn (elf, ndx);
328 if (elf_update (elf, ELF_C_NULL) < 0)
335 check_strings (elf, ndx, "read file, added strings");
338 if (elf_update (elf, ELF_C_WRITE) < 0)
344 if (elf_end (elf) != 0)
360 elf = elf_begin (fd, use_mmap ? ELF_C_READ_MMAP : ELF_C_READ, NULL);
361 if (elf == NULL)
368 check_strings (elf, ndx, "all together now");
370 if (elf_end (elf) != 0)
390 check_elf ("strtab.elf.32", ELFCLASS32, 0);
391 check_elf ("strtab.elf.32.mmap", ELFCLASS32, 1);
392 check_elf ("strtab.elf.64", ELFCLASS64, 0);
393 check_elf ("strtab.elf.64.mmap", ELFCLASS64, 1);