Lines Matching refs:elf

44 elf_getshdrstrndx (Elf *elf, size_t *dst)
48 if (elf == NULL)
51 if (unlikely (elf->kind != ELF_K_ELF))
57 rwlock_rdlock (elf->lock);
59 /* We rely here on the fact that the `elf' element is a common prefix
61 assert (offsetof (struct Elf, state.elf.ehdr)
63 assert (sizeof (elf->state.elf.ehdr)
64 == sizeof (elf->state.elf32.ehdr));
65 assert (offsetof (struct Elf, state.elf.ehdr)
67 assert (sizeof (elf->state.elf.ehdr)
68 == sizeof (elf->state.elf64.ehdr));
70 if (unlikely (elf->state.elf.ehdr == NULL))
79 num = (elf->class == ELFCLASS32
80 ? elf->state.elf32.ehdr->e_shstrndx
81 : elf->state.elf64.ehdr->e_shstrndx);
88 if (elf->class == ELFCLASS32)
91 if (unlikely (elf->state.elf32.scns.cnt == 0))
99 if (elf->state.elf32.scns.data[0].shdr.e32 != NULL)
101 num = elf->state.elf32.scns.data[0].shdr.e32->sh_link;
105 offset = elf->state.elf32.ehdr->e_shoff;
107 if (elf->map_address != NULL
108 && elf->state.elf32.ehdr->e_ident[EI_DATA] == MY_ELFDATA
110 || (((size_t) ((char *) elf->map_address
111 + elf->start_offset + offset))
116 if (unlikely (elf->maximum_size - offset
126 num = ((Elf32_Shdr *) (elf->map_address + elf->start_offset
136 if (unlikely ((r = pread_retry (elf->fildes, &shdr_mem,
149 if (elf->state.elf32.ehdr->e_ident[EI_DATA] != MY_ELFDATA)
156 if (unlikely (elf->state.elf64.scns.cnt == 0))
164 if (elf->state.elf64.scns.data[0].shdr.e64 != NULL)
166 num = elf->state.elf64.scns.data[0].shdr.e64->sh_link;
170 size_t offset = elf->state.elf64.ehdr->e_shoff;
172 if (elf->map_address != NULL
173 && elf->state.elf64.ehdr->e_ident[EI_DATA] == MY_ELFDATA
175 || (((size_t) ((char *) elf->map_address
176 + elf->start_offset + offset))
181 if (unlikely (elf->maximum_size - offset
191 num = ((Elf64_Shdr *) (elf->map_address + elf->start_offset
201 if (unlikely ((r = pread_retry (elf->fildes, &shdr_mem,
214 if (elf->state.elf64.ehdr->e_ident[EI_DATA] != MY_ELFDATA)
227 rwlock_unlock (elf->lock);