Lines Matching defs:elf

33  * Find elf or it's class from a pointer to an Elf_Data struct.
55 gelf_fsize(Elf * elf, Elf_Type type, size_t count, unsigned ver)
59 if (elf == NULL)
62 class = gelf_getclass(elf);
74 gelf_getclass(Elf *elf)
76 if (elf == NULL)
82 return (elf->ed_class);
87 gelf_getehdr(Elf *elf, GElf_Ehdr *dst)
91 if (elf == NULL)
94 class = gelf_getclass(elf);
96 Elf32_Ehdr * e = elf32_getehdr(elf);
101 ELFRLOCK(elf);
116 ELFUNLOCK(elf);
120 Elf64_Ehdr * e = elf64_getehdr(elf);
125 ELFRLOCK(elf);
127 ELFUNLOCK(elf);
138 gelf_update_ehdr(Elf *elf, GElf_Ehdr *src)
142 if (elf == NULL)
146 * In case elf isn't cooked.
148 class = gelf_getclass(elf);
154 Elf32_Ehdr * d = elf32_getehdr(elf);
159 ELFWLOCK(elf);
178 ELFUNLOCK(elf);
182 Elf64_Ehdr * d = elf64_getehdr(elf);
187 ELFWLOCK(elf);
189 ELFUNLOCK(elf);
200 gelf_newehdr(Elf *elf, int class)
202 if (elf == NULL)
206 return ((unsigned long)elf32_newehdr(elf));
208 return ((unsigned long)elf64_newehdr(elf));
216 gelf_getphdr(Elf *elf, int ndx, GElf_Phdr *dst)
221 if (elf == NULL)
224 if (elf_getphdrnum(elf, &phnum) == -1)
232 class = gelf_getclass(elf);
239 Elf32_Phdr *p = &((Elf32_Phdr *)elf32_getphdr(elf))[ndx];
241 ELFRLOCK(elf);
250 ELFUNLOCK(elf);
252 Elf64_Phdr *phdrs = elf64_getphdr(elf);
253 ELFRLOCK(elf);
255 ELFUNLOCK(elf);
263 gelf_update_phdr(Elf *elf, int ndx, GElf_Phdr *src)
268 if (elf == NULL)
271 if (elf_getphdrnum(elf, &phnum) == -1)
279 class = gelf_getclass(elf);
281 Elf32_Phdr *dst = &((Elf32_Phdr *)elf32_getphdr(elf))[ndx];
282 ELFWLOCK(elf);
297 ELFUNLOCK(elf);
299 Elf64_Phdr *dst = elf64_getphdr(elf);
300 ELFWLOCK(elf);
302 ELFUNLOCK(elf);
312 gelf_newphdr(Elf *elf, size_t phnum)
316 if (elf == NULL)
319 class = gelf_getclass(elf);
321 return ((unsigned long)elf32_newphdr(elf, phnum));
323 return ((unsigned long)elf64_newphdr(elf, phnum));
424 * gelf_xlatetof/gelf_xlatetom use 'elf' to find the class
430 gelf_xlatetof(Elf *elf, Elf_Data *dst, const Elf_Data *src, unsigned encode)
434 if ((elf == NULL) || (dst == NULL) || (src == NULL))
437 class = gelf_getclass(elf);
449 gelf_xlatetom(Elf *elf, Elf_Data *dst, const Elf_Data *src, unsigned encode)
453 if ((elf == NULL) || (dst == NULL) || (src == NULL))
456 class = gelf_getclass(elf);
1003 gelf_checksum(Elf *elf)
1005 int class = gelf_getclass(elf);
1008 return (elf32_checksum(elf));
1010 return (elf64_checksum(elf));
1094 _gelf_getdyndtflags_1(Elf *elf)
1102 while (scn = elf_nextscn(elf, scn)) {