Lines Matching refs:LIBELFBITS
48 #ifndef LIBELFBITS
49 # define LIBELFBITS 32 macro
59 if ((*scna)->shdr.ELFW(e,LIBELFBITS)->sh_offset in compare_sections()
60 < (*scnb)->shdr.ELFW(e,LIBELFBITS)->sh_offset) in compare_sections()
63 if ((*scna)->shdr.ELFW(e,LIBELFBITS)->sh_offset in compare_sections()
64 > (*scnb)->shdr.ELFW(e,LIBELFBITS)->sh_offset) in compare_sections()
67 if ((*scna)->shdr.ELFW(e,LIBELFBITS)->sh_size in compare_sections()
68 < (*scnb)->shdr.ELFW(e,LIBELFBITS)->sh_size) in compare_sections()
71 if ((*scna)->shdr.ELFW(e,LIBELFBITS)->sh_size in compare_sections()
72 > (*scnb)->shdr.ELFW(e,LIBELFBITS)->sh_size) in compare_sections()
129 __elfw2(LIBELFBITS,updatemmap) (Elf *elf, int change_bo, size_t shnum) in __elfw2() argument
134 ElfW2(LIBELFBITS,Ehdr) *ehdr = elf->state.ELFW(elf,LIBELFBITS).ehdr; in __elfw2()
137 if ((elf->state.ELFW(elf,LIBELFBITS).ehdr_flags | elf->flags) & ELF_F_DIRTY) in __elfw2()
141 assert (sizeof (ElfW2(LIBELFBITS,Ehdr)) in __elfw2()
142 == elf_typesize (LIBELFBITS, ELF_T_EHDR, 1)); in __elfw2()
149 …fctp = __elf_xfctstom[__libelf_version - 1][EV_CURRENT - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_… in __elfw2()
152 # define fctp __elf_xfctstom[0][EV_CURRENT - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_EHDR] in __elfw2()
157 sizeof (ElfW2(LIBELFBITS,Ehdr)), 1); in __elfw2()
161 sizeof (ElfW2(LIBELFBITS,Ehdr))); in __elfw2()
163 elf->state.ELFW(elf,LIBELFBITS).ehdr_flags &= ~ELF_F_DIRTY; in __elfw2()
167 previous_scn_changed = elf->state.ELFW(elf,LIBELFBITS).phdr == NULL; in __elfw2()
175 if (elf->state.ELFW(elf,LIBELFBITS).phdr != NULL in __elfw2()
176 && ((elf->state.ELFW(elf,LIBELFBITS).phdr_flags | elf->flags) in __elfw2()
181 assert (sizeof (ElfW2(LIBELFBITS,Phdr)) in __elfw2()
182 == elf_typesize (LIBELFBITS, ELF_T_PHDR, 1)); in __elfw2()
195 …fctp = __elf_xfctstom[__libelf_version - 1][EV_CURRENT - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_… in __elfw2()
198 # define fctp __elf_xfctstom[0][EV_CURRENT - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_PHDR] in __elfw2()
203 elf->state.ELFW(elf,LIBELFBITS).phdr, in __elfw2()
204 sizeof (ElfW2(LIBELFBITS,Phdr)) * phnum, 1); in __elfw2()
208 elf->state.ELFW(elf,LIBELFBITS).phdr, in __elfw2()
209 sizeof (ElfW2(LIBELFBITS,Phdr)) * phnum); in __elfw2()
211 elf->state.ELFW(elf,LIBELFBITS).phdr_flags &= ~ELF_F_DIRTY; in __elfw2()
221 + MAX (elf_typesize (LIBELFBITS, ELF_T_EHDR, 1), in __elfw2()
223 + elf_typesize (LIBELFBITS, ELF_T_PHDR, phnum)); in __elfw2()
231 Elf_ScnList *list = &elf->state.ELFW(elf,LIBELFBITS).scns; in __elfw2()
243 … = __elf_xfctstom[__libelf_version - 1][EV_CURRENT - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_SHDR… in __elfw2()
246 # define shdr_fctp __elf_xfctstom[0][EV_CURRENT - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_SHDR] in __elfw2()
248 #define shdr_dest ((ElfW2(LIBELFBITS,Shdr) *) shdr_start) in __elfw2()
259 if (!elf->state.ELFW(elf,LIBELFBITS).shdr_malloced in __elfw2()
261 && scn->shdr.ELFW(e,LIBELFBITS) != &shdr_dest[scn->index]) in __elfw2()
264 < (char *) scn->shdr.ELFW(e,LIBELFBITS)); in __elfw2()
265 assert ((char *) scn->shdr.ELFW(e,LIBELFBITS) in __elfw2()
269 void *p = malloc (sizeof (ElfW2(LIBELFBITS,Shdr))); in __elfw2()
275 scn->shdr.ELFW(e,LIBELFBITS) in __elfw2()
276 = memcpy (p, scn->shdr.ELFW(e,LIBELFBITS), in __elfw2()
277 sizeof (ElfW2(LIBELFBITS,Shdr))); in __elfw2()
292 + scn->shdr.ELFW(e,LIBELFBITS)->sh_offset) in __elfw2()
320 ElfW2(LIBELFBITS,Shdr) *shdr = scn->shdr.ELFW(e,LIBELFBITS); in __elfw2()
361 …fctp = __elf_xfctstom[__libelf_version - 1][dl->data.d.d_version - 1][ELFW(ELFCLASS, LIBELFBITS) -… in __elfw2()
364 # define fctp __elf_xfctstom[0][EV_CURRENT - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][dl->data.d.d_type] in __elfw2()
427 scn->shdr.ELFW(e,LIBELFBITS), in __elfw2()
428 sizeof (ElfW2(LIBELFBITS,Shdr)), 1); in __elfw2()
431 scn->shdr.ELFW(e,LIBELFBITS), in __elfw2()
432 sizeof (ElfW2(LIBELFBITS,Shdr))); in __elfw2()
437 if (!elf->state.ELFW(elf,LIBELFBITS).shdr_malloced in __elfw2()
439 && scn->shdr.ELFW(e,LIBELFBITS) != &shdr_dest[scn->index]) in __elfw2()
441 free (scn->shdr.ELFW(e,LIBELFBITS)); in __elfw2()
442 scn->shdr.ELFW(e,LIBELFBITS) = &shdr_dest[scn->index]; in __elfw2()
511 __elfw2(LIBELFBITS,updatefile) (Elf *elf, int change_bo, size_t shnum) in __elfw2() argument
518 ElfW2(LIBELFBITS,Ehdr) *ehdr = elf->state.ELFW(elf,LIBELFBITS).ehdr; in __elfw2()
521 if ((elf->state.ELFW(elf,LIBELFBITS).ehdr_flags | elf->flags) & ELF_F_DIRTY) in __elfw2()
523 ElfW2(LIBELFBITS,Ehdr) tmp_ehdr; in __elfw2()
524 ElfW2(LIBELFBITS,Ehdr) *out_ehdr = ehdr; in __elfw2()
528 assert (sizeof (ElfW2(LIBELFBITS,Ehdr)) in __elfw2()
529 == elf_typesize (LIBELFBITS, ELF_T_EHDR, 1)); in __elfw2()
536 …fctp = __elf_xfctstom[__libelf_version - 1][EV_CURRENT - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_… in __elfw2()
539 # define fctp __elf_xfctstom[0][EV_CURRENT - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_EHDR] in __elfw2()
543 (*fctp) (&tmp_ehdr, ehdr, sizeof (ElfW2(LIBELFBITS,Ehdr)), 1); in __elfw2()
551 sizeof (ElfW2(LIBELFBITS,Ehdr)), 0) in __elfw2()
552 != sizeof (ElfW2(LIBELFBITS,Ehdr)))) in __elfw2()
558 elf->state.ELFW(elf,LIBELFBITS).ehdr_flags &= ~ELF_F_DIRTY; in __elfw2()
562 previous_scn_changed = elf->state.ELFW(elf,LIBELFBITS).phdr == NULL; in __elfw2()
567 assert (sizeof (ElfW2(LIBELFBITS,Phdr)) in __elfw2()
568 == elf_typesize (LIBELFBITS, ELF_T_PHDR, 1)); in __elfw2()
575 if (elf->state.ELFW(elf,LIBELFBITS).phdr != NULL in __elfw2()
576 && ((elf->state.ELFW(elf,LIBELFBITS).phdr_flags | elf->flags) in __elfw2()
579 ElfW2(LIBELFBITS,Phdr) *tmp_phdr = NULL; in __elfw2()
580 ElfW2(LIBELFBITS,Phdr) *out_phdr = elf->state.ELFW(elf,LIBELFBITS).phdr; in __elfw2()
595 …fctp = __elf_xfctstom[__libelf_version - 1][EV_CURRENT - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_… in __elfw2()
598 # define fctp __elf_xfctstom[0][EV_CURRENT - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_PHDR] in __elfw2()
602 tmp_phdr = (ElfW2(LIBELFBITS,Phdr) *) in __elfw2()
603 malloc (sizeof (ElfW2(LIBELFBITS,Phdr)) * phnum); in __elfw2()
611 (*fctp) (tmp_phdr, elf->state.ELFW(elf,LIBELFBITS).phdr, in __elfw2()
612 sizeof (ElfW2(LIBELFBITS,Phdr)) * phnum, 1); in __elfw2()
619 size_t phdr_size = sizeof (ElfW2(LIBELFBITS,Phdr)) * phnum; in __elfw2()
631 elf->state.ELFW(elf,LIBELFBITS).phdr_flags &= ~ELF_F_DIRTY; in __elfw2()
641 if (elf->state.ELFW(elf,LIBELFBITS).phdr == NULL) in __elfw2()
642 last_offset = elf_typesize (LIBELFBITS, ELF_T_EHDR, 1); in __elfw2()
644 last_offset = (ehdr->e_phoff + sizeof (ElfW2(LIBELFBITS,Phdr)) * phnum); in __elfw2()
650 + sizeof (ElfW2(LIBELFBITS,Shdr))))) in __elfw2()
655 … = __elf_xfctstom[__libelf_version - 1][EV_CURRENT - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_SHDR… in __elfw2()
658 # define shdr_fctp __elf_xfctstom[0][EV_CURRENT - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_SHDR] in __elfw2()
661 ElfW2(LIBELFBITS,Shdr) *shdr_data; in __elfw2()
662 ElfW2(LIBELFBITS,Shdr) *shdr_data_mem = NULL; in __elfw2()
663 if (change_bo || elf->state.ELFW(elf,LIBELFBITS).shdr == NULL in __elfw2()
666 shdr_data_mem = (ElfW2(LIBELFBITS,Shdr) *) in __elfw2()
667 malloc (shnum * sizeof (ElfW2(LIBELFBITS,Shdr))); in __elfw2()
676 shdr_data = elf->state.ELFW(elf,LIBELFBITS).shdr; in __elfw2()
680 Elf_ScnList *list = &elf->state.ELFW(elf,LIBELFBITS).scns; in __elfw2()
701 ElfW2(LIBELFBITS,Shdr) *shdr = scn->shdr.ELFW(e,LIBELFBITS); in __elfw2()
746 …fctp = __elf_xfctstom[__libelf_version - 1][dl->data.d.d_version - 1][ELFW(ELFCLASS, LIBELFBITS) -… in __elfw2()
749 # define fctp __elf_xfctstom[0][EV_CURRENT - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][dl->data.d.d_type] in __elfw2()
812 scn->shdr.ELFW(e,LIBELFBITS), in __elfw2()
813 sizeof (ElfW2(LIBELFBITS,Shdr)), 1); in __elfw2()
814 else if (elf->state.ELFW(elf,LIBELFBITS).shdr == NULL in __elfw2()
816 memcpy (&shdr_data[scn->index], scn->shdr.ELFW(e,LIBELFBITS), in __elfw2()
817 sizeof (ElfW2(LIBELFBITS,Shdr))); in __elfw2()
834 sizeof (ElfW2(LIBELFBITS,Shdr)) in __elfw2()
836 != sizeof (ElfW2(LIBELFBITS,Shdr)) * shnum)) in __elfw2()