Lines Matching refs:ehdr

97 	uint64_t (*ehdr_shoff)(Elf_Ehdr *ehdr);
98 uint16_t (*ehdr_shstrndx)(Elf_Ehdr *ehdr);
99 uint16_t (*ehdr_shentsize)(Elf_Ehdr *ehdr);
100 uint16_t (*ehdr_shnum)(Elf_Ehdr *ehdr);
118 static uint64_t ehdr64_shoff(Elf_Ehdr *ehdr) in ehdr64_shoff() argument
120 return r8(&ehdr->e64.e_shoff); in ehdr64_shoff()
123 static uint64_t ehdr32_shoff(Elf_Ehdr *ehdr) in ehdr32_shoff() argument
125 return r(&ehdr->e32.e_shoff); in ehdr32_shoff()
128 static uint64_t ehdr_shoff(Elf_Ehdr *ehdr) in ehdr_shoff() argument
130 return e.ehdr_shoff(ehdr); in ehdr_shoff()
134 static uint16_t ehdr64_##fn_name(Elf_Ehdr *ehdr) \
136 return r2(&ehdr->e64.e_##fn_name); \
139 static uint16_t ehdr32_##fn_name(Elf_Ehdr *ehdr) \
141 return r2(&ehdr->e32.e_##fn_name); \
144 static uint16_t ehdr_##fn_name(Elf_Ehdr *ehdr) \
146 return e.ehdr_##fn_name(ehdr); \
686 Elf_Ehdr *ehdr; member
693 static int fill_relocs(void *ptr, uint64_t size, Elf_Ehdr *ehdr, uint64_t start_loc) in fill_relocs() argument
702 shdr_start = (Elf_Shdr *)((char *)ehdr + ehdr_shoff(ehdr)); in fill_relocs()
703 shentsize = ehdr_shentsize(ehdr); in fill_relocs()
705 shnum = ehdr_shnum(ehdr); in fill_relocs()
716 rel = (void *)ehdr + shdr_offset(shdr); in fill_relocs()
750 static void replace_relocs(void *ptr, uint64_t size, Elf_Ehdr *ehdr, uint64_t start_loc) in replace_relocs() argument
757 shdr_start = (Elf_Shdr *)((char *)ehdr + ehdr_shoff(ehdr)); in replace_relocs()
758 shentsize = ehdr_shentsize(ehdr); in replace_relocs()
760 shnum = ehdr_shnum(ehdr); in replace_relocs()
771 rel = (void *)ehdr + shdr_offset(shdr); in replace_relocs()
821 unsigned char *start_loc = (void *)emloc->ehdr + offset; in sort_mcount_loc()
822 Elf_Ehdr *ehdr = emloc->ehdr; in sort_mcount_loc() local
834 count = fill_relocs(vals, size, ehdr, emloc->start_mcount_loc); in sort_mcount_loc()
875 replace_relocs(vals, size, ehdr, emloc->start_mcount_loc); in sort_mcount_loc()
893 sym = (void *)emloc->ehdr + shdr_offset(symtab_sec); in get_mcount_loc()
923 static int do_sort(Elf_Ehdr *ehdr, in do_sort() argument
960 shdr_start = (Elf_Shdr *)((char *)ehdr + ehdr_shoff(ehdr)); in do_sort()
961 shentsize = ehdr_shentsize(ehdr); in do_sort()
963 shstrndx = ehdr_shstrndx(ehdr); in do_sort()
967 secstrings = (const char *)ehdr + shdr_offset(string_sec); in do_sort()
969 shnum = ehdr_shnum(ehdr); in do_sort()
985 symtab_shndx = (Elf32_Word *)((const char *)ehdr + in do_sort()
998 g_orc_ip_table = (int *)((void *)ehdr + in do_sort()
1003 g_orc_table = (struct orc_entry *)((void *)ehdr + in do_sort()
1050 extab_image = (void *)ehdr + shdr_offset(extab_sec); in do_sort()
1051 strtab = (const char *)ehdr + shdr_offset(strtab_sec); in do_sort()
1052 symtab = (const Elf_Sym *)((const char *)ehdr + shdr_offset(symtab_sec)); in do_sort()
1055 mstruct.ehdr = ehdr; in do_sort()
1083 sym_start = (void *)ehdr + shdr_offset(symtab_sec); in do_sort()
1109 sort_needed_loc = (void *)ehdr + in do_sort()
1223 Elf_Ehdr *ehdr = addr; in do_file() local
1226 switch (ehdr->e32.e_ident[EI_DATA]) { in do_file()
1243 ehdr->e32.e_ident[EI_DATA], fname); in do_file()
1247 if (memcmp(ELFMAG, ehdr->e32.e_ident, SELFMAG) != 0 || in do_file()
1248 (r2(&ehdr->e32.e_type) != ET_EXEC && r2(&ehdr->e32.e_type) != ET_DYN) || in do_file()
1249 ehdr->e32.e_ident[EI_VERSION] != EV_CURRENT) { in do_file()
1254 switch (r2(&ehdr->e32.e_machine)) { in do_file()
1284 r2(&ehdr->e32.e_machine), fname); in do_file()
1288 switch (ehdr->e32.e_ident[EI_CLASS]) { in do_file()
1317 if (r2(&ehdr->e32.e_ehsize) != sizeof(Elf32_Ehdr) || in do_file()
1318 r2(&ehdr->e32.e_shentsize) != sizeof(Elf32_Shdr)) { in do_file()
1354 if (r2(&ehdr->e64.e_ehsize) != sizeof(Elf64_Ehdr) || in do_file()
1355 r2(&ehdr->e64.e_shentsize) != sizeof(Elf64_Shdr)) { in do_file()
1366 ehdr->e32.e_ident[EI_CLASS], fname); in do_file()
1370 return do_sort(ehdr, fname, custom_sort); in do_file()