Home | History | Annotate | Download | only in tests

Lines Matching defs:ehdr

1 /* Test program for adding section and program headers and ehdr updates.
68 GElf_Ehdr ehdr;
69 check_elf ("gelf_getehdr", gelf_getehdr (elf, &ehdr) != NULL);
70 check ("e_shnum == 0", ehdr.e_shnum == 0);
71 check ("e_phnum == 0", ehdr.e_phnum == 0);
72 check ("e_shoff == 0", ehdr.e_shoff == 0);
73 check ("e_phoff == 0", ehdr.e_phoff == 0);
84 ehdr.e_ident[EI_DATA] = ELFDATANONE; /* Ask for native encoding. */
85 ehdr.e_type = ET_EXEC;
86 ehdr.e_machine = EM_386;
87 ehdr.e_version = EV_NONE; /* Ask for current version. */
88 check_elf ("gelf_update_ehdr", gelf_update_ehdr (elf, &ehdr) != 0);
92 check_elf ("gelf_getehdr", gelf_getehdr (elf, &ehdr) != NULL);
93 check ("EI_DATA", ehdr.e_ident[EI_DATA] != ELFDATANONE);
94 check ("e_version", ehdr.e_version == EV_CURRENT);
97 check ("e_shnum == 0", ehdr.e_shnum == 0);
98 check ("e_phnum == 0", ehdr.e_phnum == 0);
99 check ("e_shoff == 0", ehdr.e_shoff == 0);
100 check ("e_phoff == 0", ehdr.e_phoff == 0);
116 check_elf ("gelf_getehdr", gelf_getehdr (elf, &ehdr) != NULL);
117 /* phdrs go right after the ehdr. */
118 ehdr.e_phoff = ehdr.e_ehsize;
120 ehdr.e_shoff = ehdr.e_phoff + ehdr.e_phnum * ehdr.e_phentsize;
121 check_elf ("gelf_update_ehdr", gelf_update_ehdr (elf, &ehdr) != 0);
132 check_elf ("gelf_getehdr", gelf_getehdr (elf, &ehdr) != NULL);
134 check ("EI_DATA", ehdr.e_ident[EI_DATA] != ELFDATANONE);
135 check ("e_version", ehdr.e_version == EV_CURRENT);
137 check ("e_shnum == 2", ehdr.e_shnum == 2);
138 check ("e_phnum == 1", ehdr.e_phnum == 1);
139 check ("e_shoff != 0", ehdr.e_shoff != 0);
140 check ("e_phoff != 0", ehdr.e_phoff != 0);
144 check ("e_shentsize", ehdr.e_shentsize == shentsize);
147 check ("e_phentsize", ehdr.e_phentsize == phentsize);