Lines Matching refs:fname

96 fail (const char *msg, const char *fname)
99 if (fname != NULL)
100 error (1, 0, "%s: %s", fname, msg);
107 fail_errno (const char *msg, const char *fname)
110 if (fname != NULL)
111 error (1, errno, "%s: %s", fname, msg);
118 fail_idx (const char *msg, const char *fname, size_t idx)
121 if (fname != NULL)
122 error (1, 0, "%s: %s %zd", fname, msg, idx);
129 fail_elf (const char *msg, const char *fname)
132 if (fname != NULL)
133 error (1, 0, "%s: %s: %s", fname, msg, elf_errmsg (-1));
140 fail_elf_idx (const char *msg, const char *fname, size_t idx)
143 if (fname != NULL)
144 error (1, 0, "%s: %s %zd: %s", fname, msg, idx, elf_errmsg (-1));
153 const char *fname,
165 fname, secndx, what, member);
168 fname, secndx, what, widx, member);
171 fname, secndx, what, widx, member, midx);
178 new_data_buf (Elf_Data *d, const char *fname,
183 fail_idx ("Expected data in section", fname, ndx);
187 newscnbufs[newsecndx (ndx, shdrstrndx, shdrnum, fname,
203 const char *fname;
205 fname = argv[1];
207 fname = argv[3];
208 fd = open (fname, O_RDONLY);
210 fail_errno ("couldn't open", fname);
214 fail_elf ("couldn't open ELF file for reading", fname);
218 fail_elf ("Couldn't get ehdr", fname);
223 fail_elf ("couldn't get section header string table index", fname);
229 fail_elf ("couldn't get section header string table section", fname);
232 fail ("section header string table is an allocated section", fname);
243 fail_elf ("couldn't get shdr", fname);
254 fail ("No symtab found", fname);
257 fail ("symtab is an allocated section", fname);
265 fail_elf ("Couldn't get strtab section", fname);
269 error (0, 0, "%s: Nothing to do, shstrtab == strtab", fname);
275 fail ("strtab is an allocated section", fname);
279 fail_elf ("Couldn't get number of phdrs", fname);
293 fail_elf ("Couldn't get number of sections", fname);
313 fail_elf_idx ("couldn't get shdr", fname, scnnum);
319 fail_elf_idx ("couldn't get section name", fname, scnnum);
338 fail_elf ("couldn't get symtab data", fname);
348 fail_elf_idx ("Couldn't get symbol", fname, i);
353 fail_elf_idx ("Couldn't get symbol name", fname, i);
356 fname, i);
367 fail ("Impossible, merged string table is larger", fname);
371 fail_errno("Couldn't fstat", fname);
376 size_t fname_len = strlen (fname);
380 strcpy (mempcpy (fnew, fname, fname_len), ".XXXXXX");
413 fname, "ehdr", 0, "e_shstrndx", 0);
443 fail_elf_idx ("Couldn't get phdr", fname, cnt);
463 fail_elf_idx ("Couldn't get shdr", fname, ndx);
482 fname, "shdr", ndx, "sh_link", 0);
487 fname, "shdr", ndx, "sh_info", 0);
510 fail_elf_idx ("Couldn't get data from section", fname, ndx);
522 fail ("Only one symbol table using strtab expected", fname);
523 new_data_buf (newdata, fname, ndx, shdrstrndx, shdrnum);
530 fail_elf_idx ("Couldn't get symbol", fname, i);
540 fname, "section", ndx, "symbol", i);
554 new_data_buf (newdata, fname, ndx, shdrstrndx, shdrnum);
562 fail_idx ("Not enough data in group section", fname, ndx);
566 fname, "section", ndx, "group", i);
572 new_data_buf (newdata, fname, ndx, shdrstrndx, shdrnum);
585 fname, "section", ndx, "shndx", i);
672 if (rename (fnew, fname) != 0)