/external/elfutils/libelf/ |
D | elf_update.c | 64 write_file (Elf *elf, off_t size, int change_bo, size_t shnum) in write_file() argument 66 int class = elf->class; in write_file() 70 if (unlikely (fstat (elf->fildes, &st) != 0)) in write_file() 81 if (elf->parent == NULL in write_file() 82 && (elf->maximum_size == ~((size_t) 0) in write_file() 83 || (size_t) size > elf->maximum_size) in write_file() 84 && unlikely (ftruncate (elf->fildes, size) != 0)) in write_file() 91 if (elf->map_address == NULL && elf->cmd == ELF_C_WRITE_MMAP) in write_file() 96 elf->map_address = mmap (NULL, size, PROT_READ | PROT_WRITE, in write_file() 97 MAP_SHARED, elf->fildes, 0); in write_file() [all …]
|
D | elf32_newphdr.c | 67 elfw2(LIBELFBITS,newphdr) (elf, count) 68 Elf *elf; 73 if (elf == NULL) 76 if (unlikely (elf->kind != ELF_K_ELF)) 82 rwlock_wrlock (elf->lock); 84 if (elf->class == 0) 85 elf->class = ELFW(ELFCLASS,LIBELFBITS); 86 else if (unlikely (elf->class != ELFW(ELFCLASS,LIBELFBITS))) 93 if (unlikely (elf->state.ELFW(elf,LIBELFBITS).ehdr == NULL)) 104 if (elf->state.ELFW(elf,LIBELFBITS).phdr != NULL) [all …]
|
D | elf_newscn.c | 65 elf_newscn (elf) in elf_newscn() argument 66 Elf *elf; in elf_newscn() 71 if (elf == NULL) 76 assert (offsetof (Elf, state.elf.scns_last) 78 assert (offsetof (Elf, state.elf.scns_last) 83 rwlock_wrlock (elf->lock); 86 if (elf->state.elf.scns_last->cnt < elf->state.elf.scns_last->max) 88 result = &elf->state.elf.scns_last->data[elf->state.elf.scns_last->cnt]; 90 if (++elf->state.elf.scns_last->cnt == 1 91 && (elf->state.elf.scns_last [all …]
|
D | elf_end.c | 64 elf_end (elf) in elf_end() argument 65 Elf *elf; in elf_end() 69 if (elf == NULL) 74 rwlock_wrlock (elf->lock); 76 if (elf->ref_count != 0 && --elf->ref_count != 0) 79 int result = elf->ref_count; 80 rwlock_unlock (elf->lock); 84 if (elf->kind == ELF_K_AR) 92 if (elf->state.ar.ar_sym != (Elf_Arsym *) -1l) 93 free (elf->state.ar.ar_sym); [all …]
|
D | elf_readall.c | 64 set_address (Elf *elf, size_t offset) in set_address() argument 66 if (elf->kind == ELF_K_AR) in set_address() 68 Elf *child = elf->state.ar.children; in set_address() 74 child->map_address = elf->map_address; in set_address() 89 __libelf_readall (elf) in __libelf_readall() argument 90 Elf *elf; in __libelf_readall() 93 rwlock_wrlock (elf->lock); 95 if (elf->map_address == NULL && unlikely (elf->fildes == -1)) 98 rwlock_unlock (elf->lock); 103 if (elf->map_address == NULL) [all …]
|
D | elf_getshstrndx.c | 67 elf_getshstrndx (elf, dst) in elf_getshstrndx() argument 68 Elf *elf; in elf_getshstrndx() 73 if (elf == NULL) 76 if (unlikely (elf->kind != ELF_K_ELF)) 82 rwlock_rdlock (elf->lock); 86 assert (offsetof (struct Elf, state.elf.ehdr) 88 assert (sizeof (elf->state.elf.ehdr) 89 == sizeof (elf->state.elf32.ehdr)); 90 assert (offsetof (struct Elf, state.elf.ehdr) 92 assert (sizeof (elf->state.elf.ehdr) [all …]
|
D | elf_getarsym.c | 70 elf_getarsym (elf, ptr) in elf_getarsym() argument 71 Elf *elf; in elf_getarsym() 74 if (elf->kind != ELF_K_AR) 84 *ptr = elf->state.ar.ar_sym_num; 86 if (elf->state.ar.ar_sym == (Elf_Arsym *) -1l) 93 Elf_Arsym *result = elf->state.ar.ar_sym; 97 rwlock_wrlock (elf->lock); 100 elf->state.ar.ar_sym = (Elf_Arsym *) -1l; 103 if (elf->map_address == NULL) 106 assert (elf->fildes != -1); [all …]
|
D | elf32_getphdr.c | 70 __elfw2(LIBELFBITS,getphdr_wrlock) (elf) 71 Elf *elf; 78 result = elf->state.ELFW(elf,LIBELFBITS).phdr; 82 if (elf->class == 0) 83 elf->class = ELFW(ELFCLASS,LIBELFBITS); 84 else if (elf->class != ELFW(ELFCLASS,LIBELFBITS)) 94 ElfW2(LIBELFBITS,Ehdr) *ehdr = elf->state.ELFW(elf,LIBELFBITS).ehdr; 106 if (elf->map_address != NULL) 109 void *file_phdr = ((char *) elf->map_address 110 + elf->start_offset + ehdr->e_phoff); [all …]
|
D | elf_begin.c | 76 Elf *elf; in file_read_ar() local 79 elf = allocate_elf (fildes, map_address, offset, maxsize, cmd, parent, in file_read_ar() 81 if (elf != NULL) in file_read_ar() 85 elf->state.ar.offset = offset + SARMAG; in file_read_ar() 87 elf->state.ar.elf_ar_hdr.ar_rawname = elf->state.ar.raw_name; in file_read_ar() 90 return elf; in file_read_ar() 288 Elf *elf = allocate_elf (fildes, map_address, offset, maxsize, cmd, parent, in file_read_elf() local 290 if (elf == NULL) in file_read_elf() 295 elf->state.elf.scnincr = 10; in file_read_elf() 298 elf->class = e_ident[EI_CLASS]; in file_read_elf() [all …]
|
D | elf32_newehdr.c | 66 elfw2(LIBELFBITS,newehdr) (elf) 67 Elf *elf; 71 if (elf == NULL) 74 if (unlikely (elf->kind != ELF_K_ELF)) 80 rwlock_wrlock (elf->lock); 82 if (elf->class == 0) 83 elf->class = ELFW(ELFCLASS,LIBELFBITS); 84 else if (unlikely (elf->class != ELFW(ELFCLASS,LIBELFBITS))) 92 if (elf->state.ELFW(elf,LIBELFBITS).ehdr == NULL) 95 elf->state.ELFW(elf,LIBELFBITS).ehdr = [all …]
|
D | elf32_getehdr.c | 66 getehdr_impl (elf, wrlock) 67 Elf *elf; 70 if (elf == NULL) 73 if (unlikely (elf->kind != ELF_K_ELF)) 80 if (elf->class == 0) 84 rwlock_unlock (elf->lock); 85 rwlock_wrlock (elf->lock); 89 elf->class = ELFW(ELFCLASS,LIBELFBITS); 91 else if (unlikely (elf->class != ELFW(ELFCLASS,LIBELFBITS))) 97 return elf->state.ELFW(elf,LIBELFBITS).ehdr; [all …]
|
D | elf32_updatefile.c | 127 __elfw2(LIBELFBITS,updatemmap) (Elf *elf, int change_bo, size_t shnum) in __elfw2() 133 ehdr = elf->state.ELFW(elf,LIBELFBITS).ehdr; in __elfw2() 136 if ((elf->state.ELFW(elf,LIBELFBITS).ehdr_flags | elf->flags) & ELF_F_DIRTY) in __elfw2() 155 (*fctp) ((char *) elf->map_address + elf->start_offset, ehdr, in __elfw2() 159 memcpy (elf->map_address + elf->start_offset, ehdr, in __elfw2() 162 elf->state.ELFW(elf,LIBELFBITS).ehdr_flags &= ~ELF_F_DIRTY; in __elfw2() 166 if (elf->state.ELFW(elf,LIBELFBITS).phdr != NULL in __elfw2() 167 && ((elf->state.ELFW(elf,LIBELFBITS).phdr_flags | elf->flags) in __elfw2() 178 memset (elf->map_address + elf->start_offset + ehdr->e_ehsize, in __elfw2() 193 (*fctp) (elf->map_address + elf->start_offset + ehdr->e_phoff, in __elfw2() [all …]
|
D | elf_getshnum.c | 63 __elf_getshnum_rdlock (elf, dst) in __elf_getshnum_rdlock() argument 64 Elf *elf; in __elf_getshnum_rdlock() 70 if (elf == NULL) 73 if (unlikely (elf->kind != ELF_K_ELF)) 79 idx = elf->state.elf.scns_last->cnt; 81 || (elf->state.elf.scns_last 82 != (elf->class == ELFCLASS32 85 ? &elf->state.elf32.scns : &elf->state.elf64.scns))) 87 *dst = 1 + elf->state.elf.scns_last->data[idx - 1].index; 95 elf_getshnum (elf, dst) in elf_getshnum() argument [all …]
|
D | elf32_getshdr.c | 75 Elf *elf = scn->elf; in ElfW2() local 76 ElfW2(LIBELFBITS,Ehdr) *ehdr = elf->state.ELFW(elf,LIBELFBITS).ehdr; in ElfW2() 84 if (__elf_getshnum_rdlock (elf, &shnum) != 0) in ElfW2() 90 ElfW2(LIBELFBITS,Shdr) *shdr = elf->state.ELFW(elf,LIBELFBITS).shdr = in ElfW2() 92 if (elf->state.ELFW(elf,LIBELFBITS).shdr == NULL) in ElfW2() 97 elf->state.ELFW(elf,LIBELFBITS).shdr_malloced = 1; in ElfW2() 99 if (elf->map_address != NULL) in ElfW2() 105 void *file_shdr = ((char *) elf->map_address in ElfW2() 106 + elf->start_offset + ehdr->e_shoff); in ElfW2() 125 ((char *) elf->map_address in ElfW2() [all …]
|
D | elf_getdata_rawchunk.c | 65 elf_getdata_rawchunk (elf, offset, size, type) in elf_getdata_rawchunk() argument 66 Elf *elf; in elf_getdata_rawchunk() 77 if (unlikely (elf == NULL)) 80 if (unlikely (elf->kind != ELF_K_ELF)) 89 if (unlikely (size > elf->maximum_size 90 || (off64_t) (elf->maximum_size - size) < offset)) 92 if (unlikely (size > elf->maximum_size 93 || (off_t) (elf->maximum_size - size) < offset)) 113 rwlock_rdlock (elf->lock); 116 if (elf->map_address != NULL) [all …]
|
D | elf_clone.c | 62 elf_clone (Elf *elf, Elf_Cmd cmd) in elf_clone() argument 66 if (elf == NULL) in elf_clone() 71 rwlock_rdlock (elf->lock); in elf_clone() 77 retval = allocate_elf (elf->fildes, elf->map_address, elf->start_offset, in elf_clone() 78 elf->maximum_size, elf->cmd, elf->parent, elf->kind, in elf_clone() 79 elf->state.elf32.scns.max * sizeof (Elf_Scn)); in elf_clone() 86 retval->state.elf.scnincr = 10; in elf_clone() 91 retval->state.elf.scns_last = &retval->state.elf32.scns; in elf_clone() 92 retval->state.elf32.scns.max = elf->state.elf32.scns.max; in elf_clone() 94 retval->class = elf->class; in elf_clone() [all …]
|
D | gelf_getphdr.c | 63 gelf_getphdr (elf, ndx, dst) in gelf_getphdr() argument 64 Elf *elf; in gelf_getphdr() 70 if (elf == NULL) 73 if (unlikely (elf->kind != ELF_K_ELF)) 85 rwlock_rdlock (elf->lock); 87 if (elf->class == ELFCLASS32) 90 Elf32_Phdr *phdr = elf->state.elf32.phdr; 94 rwlock_unlock (elf->lock); 95 phdr = INTUSE(elf32_getphdr) (elf); 99 rwlock_rdlock (elf->lock); [all …]
|
D | elf32_updatenull.c | 72 ELFW(default_ehdr,LIBELFBITS) (Elf *elf, ElfW2(LIBELFBITS,Ehdr) *ehdr, in ELFW() 79 elf->state.ELFW(elf,LIBELFBITS).ehdr_flags |= ELF_F_DIRTY; in ELFW() 84 elf->state.ELFW(elf,LIBELFBITS).ehdr_flags); in ELFW() 91 elf->state.ELFW(elf,LIBELFBITS).ehdr_flags |= ELF_F_DIRTY; in ELFW() 106 elf->state.ELFW(elf,LIBELFBITS).ehdr_flags); in ELFW() 118 elf->state.ELFW(elf,LIBELFBITS).ehdr_flags); in ELFW() 122 elf->state.ELFW(elf,LIBELFBITS).ehdr_flags); in ELFW() 127 elf->state.ELFW(elf,LIBELFBITS).ehdr_flags |= ELF_F_DIRTY; in ELFW() 136 __elfw2(LIBELFBITS,updatenull_wrlock) (Elf *elf, int *change_bop, size_t shnum) in __elfw2() 142 ehdr = __elfw2(LIBELFBITS,getehdr_wrlock) (elf); in __elfw2() [all …]
|
D | gelf_getehdr.c | 64 __gelf_getehdr_rdlock (elf, dest) in __gelf_getehdr_rdlock() argument 65 Elf *elf; in __gelf_getehdr_rdlock() 70 if (elf == NULL) 73 if (unlikely (elf->kind != ELF_K_ELF)) 85 if (unlikely (elf->state.elf64.ehdr == NULL)) 88 else if (elf->class == ELFCLASS32) 90 Elf32_Ehdr *ehdr = elf->state.elf32.ehdr; 113 result = memcpy (dest, elf->state.elf64.ehdr, sizeof (*dest)); 119 gelf_getehdr (elf, dest) in gelf_getehdr() argument 120 Elf *elf; in gelf_getehdr() [all …]
|
D | elf_rand.c | 62 elf_rand (elf, offset) in elf_rand() argument 63 Elf *elf; in elf_rand() 67 if (elf == NULL || elf->kind != ELF_K_AR) 70 rwlock_wrlock (elf->lock); 73 elf->state.ar.offset = elf->start_offset + offset; 76 if (__libelf_next_arhdr_wrlock (elf) != 0) 79 elf->state.ar.elf_ar_hdr.ar_name = NULL; 83 rwlock_unlock (elf->lock);
|
D | elf_rawfile.c | 62 elf_rawfile (elf, ptr) in elf_rawfile() argument 63 Elf *elf; in elf_rawfile() 68 if (elf == NULL) 79 if (elf->map_address == NULL && __libelf_readall (elf) == NULL) 82 rwlock_rdlock (elf->lock); 84 *ptr = elf->maximum_size; 86 result = (char *) elf->map_address + elf->start_offset; 87 rwlock_unlock (elf->lock);
|
/external/libvpx/libvpx/build/make/ |
D | obj_int_extract.c | 224 if(!elf->le_data) {log_msg("Big Endian data not supported yet!\n");goto bail;}\ 243 int parse_elf_header(elf_obj_t *elf) in parse_elf_header() argument 247 COPY_STRUCT(&elf->e_ident, elf->buf, 0, elf->sz); in parse_elf_header() 248 res = elf->e_ident[EI_MAG0] == ELFMAG0; in parse_elf_header() 249 res &= elf->e_ident[EI_MAG1] == ELFMAG1; in parse_elf_header() 250 res &= elf->e_ident[EI_MAG2] == ELFMAG2; in parse_elf_header() 251 res &= elf->e_ident[EI_MAG3] == ELFMAG3; in parse_elf_header() 252 res &= elf->e_ident[EI_CLASS] == ELFCLASS32 in parse_elf_header() 253 || elf->e_ident[EI_CLASS] == ELFCLASS64; in parse_elf_header() 254 res &= elf->e_ident[EI_DATA] == ELFDATA2LSB; in parse_elf_header() [all …]
|
/external/elfutils/tests/ |
D | showptable.c | 38 Elf *elf; in main() local 58 elf = elf_begin (fd, ELF_C_READ, NULL); in main() 59 if (elf == NULL) in main() 65 if (elf_kind (elf) != ELF_K_ELF) in main() 71 if (gelf_getehdr (elf, &ehdr) == NULL) in main() 78 gelf_getclass (elf) == ELFCLASS32 ? 9 : 17, "offset", in main() 79 gelf_getclass (elf) == ELFCLASS32 ? 10 : 18, "vaddr", in main() 80 gelf_getclass (elf) == ELFCLASS32 ? 10 : 18, "paddr", in main() 81 gelf_getclass (elf) == ELFCLASS32 ? 9 : 12, "filesz", in main() 82 gelf_getclass (elf) == ELFCLASS32 ? 9 : 12, "memsz"); in main() [all …]
|
/external/elfutils/src/ |
D | xelf.h | 52 # define xelf_getehdr(elf, name) name = elf32_getehdr (elf) argument 53 # define xelf_getehdr_copy(elf, name, copy) \ argument 54 (copy) = *(name = elf32_getehdr (elf)) 55 # define xelf_newehdr(elf, klass) elf32_newehdr (elf) argument 56 # define xelf_update_ehdr(elf, ehdr) \ argument 57 /* nothing */ ((void) (elf), (void) (ehdr), 1) 59 # define xelf_getclass(elf) ELFCLASS32 argument 62 # define xelf_newphdr(elf, n) elf32_newphdr (elf, n) argument 63 # define xelf_getphdr(elf, idx, name) name = elf32_getphdr (elf) + idx argument 64 # define xelf_getphdr_ptr(elf, idx, name) name = elf32_getphdr (elf) + idx argument [all …]
|
D | size.c | 108 static int handle_ar (int fd, Elf *elf, const char *prefix, const char *fname); 111 static void handle_elf (Elf *elf, const char *fullname, const char *fname); 306 Elf *elf = elf_begin (fd, ELF_C_READ_MMAP, NULL); in process_file() local 307 if (likely (elf != NULL)) in process_file() 309 if (elf_kind (elf) == ELF_K_ELF) in process_file() 311 handle_elf (elf, NULL, fname); in process_file() 313 if (unlikely (elf_end (elf) != 0)) in process_file() 321 else if (likely (elf_kind (elf) == ELF_K_AR)) in process_file() 322 return handle_ar (fd, elf, NULL, fname); in process_file() 325 if (unlikely (elf_end (elf) != 0)) in process_file() [all …]
|