Lines Matching refs:elf
20 #include ELFUTILS_HEADER(elf)
58 test (Elf *elf, int class, bool layout)
60 fprintf (stderr, "testing ELF class: %d, layout: %d\n", class, layout);
62 check_elf ("gelf_newehdr", gelf_newehdr (elf, class) != 0);
63 check_elf ("gelf_getclass", gelf_getclass (elf) == class);
65 check_elf ("elf_flagelf", elf_flagelf (elf, layout ? ELF_C_SET : ELF_C_CLR,
69 check_elf ("gelf_getehdr", gelf_getehdr (elf, &ehdr) != NULL);
76 check_elf ("elf_getshdrnum", elf_getshdrnum (elf, &shnum) == 0);
80 check_elf ("elf_getphdrnum", elf_getphdrnum (elf, &phnum) == 0);
88 check_elf ("gelf_update_ehdr", gelf_update_ehdr (elf, &ehdr) != 0);
90 check_elf ("elf_update", elf_update (elf, ELF_C_NULL) > 0);
92 check_elf ("gelf_getehdr", gelf_getehdr (elf, &ehdr) != NULL);
102 check_elf ("elf_getshdrnum", elf_getshdrnum (elf, &shnum) == 0);
105 check_elf ("elf_getphdrnum", elf_getphdrnum (elf, &phnum) == 0);
109 check_elf ("elf_newscn", elf_newscn (elf) != NULL);
110 check_elf ("gelf_newphdr", gelf_newphdr (elf, 1) != 0);
116 check_elf ("gelf_getehdr", gelf_getehdr (elf, &ehdr) != NULL);
121 check_elf ("gelf_update_ehdr", gelf_update_ehdr (elf, &ehdr) != 0);
124 check_elf ("elf_update", elf_update (elf, ELF_C_NULL) > 0);
126 check_elf ("elf_getshdrnum", elf_getshdrnum (elf, &shnum) == 0);
129 check_elf ("elf_getphdrnum", elf_getphdrnum (elf, &phnum) != 0);
132 check_elf ("gelf_getehdr", gelf_getehdr (elf, &ehdr) != NULL);
158 Elf *elf;
160 elf = elf_begin (fd, ELF_C_WRITE, NULL);
161 check_elf ("elf_begin", elf != NULL);
162 test (elf, ELFCLASS32, false);
163 elf_end (elf);
165 elf = elf_begin (fd, ELF_C_WRITE, NULL);
166 check_elf ("elf_begin", elf != NULL);
167 test (elf, ELFCLASS32, true);
168 elf_end (elf);
170 elf = elf_begin (fd, ELF_C_WRITE, NULL);
171 check_elf ("elf_begin", elf != NULL);
172 test (elf, ELFCLASS64, false);
173 elf_end (elf);
175 elf = elf_begin (fd, ELF_C_WRITE, NULL);
176 check_elf ("elf_begin", elf != NULL);
177 test (elf, ELFCLASS64, true);
178 elf_end (elf);