/third_party/elfutils/libelf/ |
H A D | elf_getdata.c | 138 convert_data (Elf_Scn *scn, int eclass, in convert_data() argument 146 if (((((size_t) (char *) scn->rawdata_base)) & (align - 1)) == 0) in convert_data() 148 scn->data_base = scn->rawdata_base; in convert_data() 151 scn->data_base = malloc (size); in convert_data() 152 if (scn->data_base == NULL) in convert_data() 159 memcpy (scn->data_base, scn->rawdata_base, size); in convert_data() 166 scn->data_base = malloc (size); in convert_data() 167 if (scn in convert_data() 214 __libelf_set_rawdata_wrlock(Elf_Scn *scn) __libelf_set_rawdata_wrlock() argument 422 __libelf_set_rawdata(Elf_Scn *scn) __libelf_set_rawdata() argument 438 __libelf_set_data_list_rdlock(Elf_Scn *scn, int wrlocked) __libelf_set_data_list_rdlock() argument 476 __elf_getdata_rdlock(Elf_Scn *scn, Elf_Data *data) __elf_getdata_rdlock() argument 572 elf_getdata(Elf_Scn *scn, Elf_Data *data) elf_getdata() argument [all...] |
H A D | elf_newdata.c | 41 elf_newdata (Elf_Scn *scn) in elf_newdata() argument 45 if (scn == NULL) in elf_newdata() 48 if (unlikely (scn->index == 0)) in elf_newdata() 55 if (scn->elf->class == ELFCLASS32 in elf_newdata() 58 ? scn->elf->state.elf32.ehdr == NULL in elf_newdata() 59 : scn->elf->state.elf64.ehdr == NULL) in elf_newdata() 65 rwlock_wrlock (scn->elf->lock); in elf_newdata() 81 if (scn->data_read in elf_newdata() 82 && scn->rawdata_base != NULL in elf_newdata() 83 && scn in elf_newdata() [all...] |
H A D | elf_compress.c | 66 __libelf_compress (Elf_Scn *scn, size_t hsize, int ei_data, in __libelf_compress() argument 76 Elf_Data *data = elf_getdata (scn, NULL); in __libelf_compress() 84 Elf_Data *next_data = elf_getdata (scn, data); in __libelf_compress() 138 if (gelf_xlatetof (scn->elf, &cdata, data, ei_data) == NULL) in __libelf_compress() 151 next_data = elf_getdata (scn, data); in __libelf_compress() 265 __libelf_decompress_elf (Elf_Scn *scn, size_t *size_out, size_t *addralign) in __libelf_decompress_elf() argument 268 if (gelf_getchdr (scn, &chdr) == NULL) in __libelf_decompress_elf() 289 Elf_Data *data = elf_getdata (scn, NULL); in __libelf_decompress_elf() 293 int elfclass = scn->elf->class; in __libelf_decompress_elf() 307 __libelf_reset_rawdata (Elf_Scn *scn, voi argument 339 elf_compress(Elf_Scn *scn, int type, unsigned int flags) elf_compress() argument [all...] |
H A D | elf_compress_gnu.c | 38 elf_compress_gnu (Elf_Scn *scn, int inflate, unsigned int flags) in elf_compress_gnu() argument 40 if (scn == NULL) in elf_compress_gnu() 51 Elf *elf = scn->elf; in elf_compress_gnu() 64 Elf32_Shdr *shdr = elf32_getshdr (scn); in elf_compress_gnu() 74 Elf64_Shdr *shdr = elf64_getshdr (scn); in elf_compress_gnu() 104 void *out_buf = __libelf_compress (scn, hsize, elfdata, in elf_compress_gnu() 125 Elf32_Shdr *shdr = elf32_getshdr (scn); in elf_compress_gnu() 130 Elf64_Shdr *shdr = elf64_getshdr (scn); in elf_compress_gnu() 134 __libelf_reset_rawdata (scn, out_buf, new_size, 1, ELF_T_BYTE); in elf_compress_gnu() 140 scn in elf_compress_gnu() [all...] |
H A D | elf32_updatefile.c | 239 Elf_Scn *scn = scns[cnt]; in __elfw2() local 242 && (scn->shdr_flags & ELF_F_MALLOCED) == 0 in __elfw2() 243 && scn->shdr.ELFW(e,LIBELFBITS) != &shdr_dest[scn->index]) in __elfw2() 246 < (char *) scn->shdr.ELFW(e,LIBELFBITS)); in __elfw2() 247 assert ((char *) scn->shdr.ELFW(e,LIBELFBITS) in __elfw2() 258 scn->shdr.ELFW(e,LIBELFBITS) in __elfw2() 259 = memcpy (p, scn->shdr.ELFW(e,LIBELFBITS), in __elfw2() 270 <= (char *) scn->data_list.data.d.d_buf) in __elfw2() 271 && ((char *) scn in __elfw2() 295 Elf_Scn *scn = scns[cnt]; __elfw2() local 442 Elf_Scn *scn = scns[cnt]; __elfw2() local 699 Elf_Scn *scn = scns[cnt]; __elfw2() local [all...] |
H A D | elf32_getshdr.c | 47 load_shdr_wrlock (Elf_Scn *scn) in ElfW2() 52 Elf *elf = scn->elf; in ElfW2() 56 result = scn->shdr.ELFW(e,LIBELFBITS); in ElfW2() 213 /* Set the pointers in the `scn's. */ in ElfW2() 218 result = scn->shdr.ELFW(e,LIBELFBITS); in ElfW2() 226 scn_valid (Elf_Scn *scn) in scn_valid() argument 228 if (scn == NULL) in scn_valid() 231 if (unlikely (scn->elf->state.elf.ehdr == NULL)) in scn_valid() 237 if (unlikely (scn->elf->class != ELFW(ELFCLASS,LIBELFBITS))) in scn_valid() 248 __elfw2(LIBELFBITS,getshdr_rdlock) (Elf_Scn *scn) in ElfW2() [all...] |
H A D | elf_rawdata.c | 40 elf_rawdata (Elf_Scn *scn, Elf_Data *data) in elf_rawdata() argument 42 if (scn == NULL || scn->elf->kind != ELF_K_ELF) in elf_rawdata() 54 || (scn->data_read != 0 && (scn->flags & ELF_F_FILEDATA) == 0)) in elf_rawdata() 63 if (scn->data_read == 0) in elf_rawdata() 68 if (__libelf_set_rawdata (scn) != 0) in elf_rawdata() 74 return &scn->rawdata.d; in elf_rawdata()
|
H A D | gelf_getshdr.c | 41 gelf_getshdr (Elf_Scn *scn, GElf_Shdr *dst) in gelf_getshdr() argument 45 if (scn == NULL) in gelf_getshdr() 54 rwlock_rdlock (scn->elf->lock); in gelf_getshdr() 56 if (scn->elf->class == ELFCLASS32) in gelf_getshdr() 60 = scn->shdr.e32 ?: __elf32_getshdr_rdlock (scn); in gelf_getshdr() 86 = scn->shdr.e64 ?: __elf64_getshdr_rdlock (scn); in gelf_getshdr() 99 rwlock_unlock (scn->elf->lock); in gelf_getshdr()
|
H A D | elf_end.c | 145 Elf_Scn *scn = &list->data[cnt]; in elf_end() local 148 if ((scn->shdr_flags & ELF_F_MALLOCED) != 0) in elf_end() 150 free (scn->shdr.e32); in elf_end() 155 if (scn->zdata_base != scn->rawdata_base) in elf_end() 156 free (scn->zdata_base); in elf_end() 162 if (scn->data_base != scn->rawdata_base) in elf_end() 163 free (scn->data_base); in elf_end() 168 || scn in elf_end() [all...] |
H A D | gelf_update_shdr.c | 41 gelf_update_shdr (Elf_Scn *scn, GElf_Shdr *src) in gelf_update_shdr() argument 46 if (scn == NULL || src == NULL) in gelf_update_shdr() 49 elf = scn->elf; in gelf_update_shdr() 55 = scn->shdr.e32 ?: __elf32_getshdr_wrlock (scn); in gelf_update_shdr() 90 = scn->shdr.e64 ?: __elf64_getshdr_wrlock (scn); in gelf_update_shdr() 103 scn->shdr_flags |= ELF_F_DIRTY; in gelf_update_shdr()
|
H A D | elf_nextscn.c | 42 elf_nextscn (Elf *elf, Elf_Scn *scn) in elf_nextscn() argument 52 if (scn == NULL) in elf_nextscn() 55 Set scn to the 0th section and perform nextscn. */ in elf_nextscn() 63 scn = &list->data[0]; in elf_nextscn() 66 list = scn->list; in elf_nextscn() 68 if (scn + 1 < &list->data[list->cnt]) in elf_nextscn() 69 result = scn + 1; in elf_nextscn() 70 else if (scn + 1 == &list->data[list->max] in elf_nextscn()
|
/third_party/elfutils/libasm/ |
H A D | asm_end.c | 86 Elf_Scn *scn = elf_getscn (ctx->out.elf, asmscn->data.main.scnndx); in binary_end() 88 Elf_Scn *scn = asmscn->data.main.scn; in binary_end() local 109 Elf_Data *newdata = elf_newdata (scn); in binary_end() 196 syment.st_value = sym->scn->offset + sym->offset; in binary_end() 205 Elf_Scn *scn = (sym->scn->subsection_id == 0 in binary_end() local 206 ? sym->scn->data.main.scn in binary_end() 207 : sym->scn in binary_end() 318 Elf_Scn *scn; binary_end() local 383 Elf_Scn *scn = elf_getscn (ctx->out.elf, symscnndx); binary_end() local 442 Elf_Scn *scn = elf_getscn (ctx->out.elf, 0); binary_end() local 563 AsmScn_t *scn = ctx->section_list; __libasm_finictx() local [all...] |
/third_party/elfutils/tests/ |
H A D | fillfile.c | 69 Elf_Scn *scn = elf_newscn (elf); in create_strtab() local 70 if (scn == NULL) in create_strtab() 77 add_strtab_entry (scn, ""); in create_strtab() 80 GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); in create_strtab() 95 shdr->sh_name = add_strtab_entry (scn, ".strtab"); in create_strtab() 107 int ndx = elf_ndxscn (scn); in create_strtab() 117 if (gelf_update_shdr (scn, shdr) == 0) in create_strtab() 123 return scn; in create_strtab() 133 Elf_Scn *scn = elf_newscn (elf); in add_data_section() local 134 if (scn in add_data_section() 298 Elf_Scn *scn = elf_nextscn (elf, NULL); check_elf() local [all...] |
H A D | elfputzdata.c | 75 Elf_Scn *scn = NULL; in main() local 76 while ((scn = elf_nextscn (elf, scn)) != NULL) in main() 78 size_t idx = elf_ndxscn (scn); in main() 80 GElf_Shdr *shdr = gelf_getshdr (scn, &mem); in main() 97 Elf_Data *d = elf_getdata (scn, NULL); in main() 125 int res = elf_compress_gnu (scn, 1, 0); in main() 129 res = elf_compress_gnu (scn, 1, ELF_CHF_FORCE); in main() 141 int res = elf_compress (scn, ELFCOMPRESS_ZLIB, 0); in main() 145 res = elf_compress (scn, ELFCOMPRESS_ZLI in main() [all...] |
H A D | elfstrtab.c | 108 add_string (Elf_Scn *scn, char *str) in add_string() argument 113 Elf_Data *data = elf_newdata (scn); in add_string() 175 Elf_Scn *scn = elf_newscn (elf); in check_elf() local 176 if (scn == NULL) in check_elf() 183 add_string (scn, ""); in check_elf() 186 GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); in check_elf() 200 shdr->sh_name = add_string (scn, ".strings"); in check_elf() 204 int ndx = elf_ndxscn (scn); in check_elf() 217 orig_str1_off = add_string (scn, orig_str1); in check_elf() 219 orig_str2_off = add_string (scn, orig_str in check_elf() [all...] |
H A D | update4.c | 43 Elf_Scn *scn; in main() local 117 scn = elf_newscn (elf); in main() 118 if (scn == NULL) in main() 123 shdr = elf32_getshdr (scn); in main() 139 data = elf_newdata (scn); in main() 153 scn = elf_newscn (elf); in main() 154 if (scn == NULL) in main() 159 shdr = elf32_getshdr (scn); in main() 175 data = elf_newdata (scn); in main() 189 scn in main() [all...] |
H A D | next_cfi.c | 37 Elf_Scn *scn, const bool is_eh) in handle_section() 45 GElf_Shdr *shdr = gelf_getshdr (scn, &mem); in handle_section() 51 if (elf_compress (scn, 0, 0) < 0) in handle_section() 57 if (elf_compress_gnu (scn, 0, 0) < 0) in handle_section() 62 Elf_Data *data = elf_getdata (scn, NULL); in handle_section() 128 Elf_Scn *scn = NULL; in main() local 129 while ((scn = elf_nextscn (elf, scn)) != NULL) in main() 132 if (gelf_getshdr (scn, &shdr) != NULL) in main() 138 handle_section (name, ident, scn, tru in main() 36 handle_section(char *name, const unsigned char e_ident[], Elf_Scn *scn, const bool is_eh) handle_section() argument [all...] |
H A D | elfgetzdata.c | 68 Elf_Scn *scn = NULL; in main() local 69 while ((scn = elf_nextscn (elf, scn)) != NULL) in main() 71 size_t idx = elf_ndxscn (scn); in main() 73 GElf_Shdr *shdr = gelf_getshdr (scn, &mem); in main() 78 if (elf_compress (scn, 0, 0) < 0) in main() 84 Elf_Data *d = elf_getdata (scn, NULL); in main() 93 if (elf_compress_gnu (scn, 0, 0) < 0) in main() 99 Elf_Data *d = elf_getdata (scn, NULL); in main()
|
H A D | asm-tst6.c | 63 AsmScn_t *scn; in main() local 75 scn = asm_newscn_ingrp (ctx, ".data", SHT_PROGBITS, in main() 77 if (scn == NULL) in main() 87 sym = asm_newsym (scn, buf, sizeof (uint32_t), STT_OBJECT, in main() 97 if (asm_adduint32 (scn, cnt) != 0) in main() 115 scn = asm_newscn_ingrp (ctx, ".stab", SHT_PROGBITS, 0, grp); in main() 116 if (scn == NULL) in main() 125 if (asm_adduint32 (scn, cnt) != 0) in main()
|
H A D | zstrptr.c | 34 print_strings (Elf_Scn *scn, Elf *elf, size_t ndx) in print_strings() argument 37 GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); in print_strings() 95 Elf_Scn *scn = elf_getscn (elf, ndx); in main() local 96 if (scn == NULL) in main() 102 if (elf_compress (scn, ELFCOMPRESS_ZLIB, 0) < 0) in main() 107 print_strings (scn, elf, ndx); in main() 109 if (elf_compress (scn, 0, 0) < 0) in main() 114 print_strings (scn, elf, ndx); in main()
|
H A D | newdata.c | 43 Elf_Scn *scn = elf_getscn (elf, 1); in add_section_data() local 44 if (scn == NULL) in add_section_data() 50 Elf_Data *data = elf_newdata (scn); in add_section_data() 112 Elf_Scn *scn = elf_newscn (elf); in create_elf() local 113 if (scn == NULL) in create_elf() 120 GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); in create_elf() 137 if (gelf_update_shdr (scn, shdr) == 0) in create_elf() 173 Elf_Scn *scn = elf_getscn (elf, 1); in check_section_size() local 174 if (scn == NULL) in check_section_size() 181 GElf_Shdr *shdr = gelf_getshdr (scn, in check_section_size() 201 Elf_Scn *scn = elf_getscn (elf, 1); check_section_data() local 314 Elf_Scn *scn = elf_getscn (elf, 1); check_elf() local [all...] |
/third_party/elfutils/libdwfl/ |
H A D | derelocate.c | 40 Elf_Scn *scn; member 51 Elf_Scn *scn; member 76 return elf_ndxscn ((*p1)->scn) - elf_ndxscn ((*p2)->scn); in compare_secrefs() 98 Elf_Scn *scn = NULL; in cache_sections() local 99 while ((scn = elf_nextscn (mod->main.elf, scn)) != NULL) in cache_sections() 102 GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); in cache_sections() 111 elf_ndxscn (scn), in cache_sections() 114 shdr = gelf_getshdr (scn, in cache_sections() [all...] |
H A D | relocate.c | 128 Elf_Scn *scn = NULL; in relocate_getsym() local 129 while ((scn = elf_nextscn (relocated, scn)) != NULL) in relocate_getsym() 131 GElf_Shdr shdr_mem, *shdr = gelf_getshdr (scn, &shdr_mem); in relocate_getsym() 138 if (elf_compress (scn, 0, 0) < 0) in relocate_getsym() 147 cache->symdata = elf_getdata (scn, NULL); in relocate_getsym() 153 cache->symxndxdata = elf_getdata (scn, NULL); in relocate_getsym() 223 Elf_Scn *scn = elf_getscn (symtab->symelf, symtab->strtabndx); in resolve_symbol() local 224 if (scn == NULL) in resolve_symbol() 228 GElf_Shdr *shdr = gelf_getshdr (scn, in resolve_symbol() 502 relocate_section(Dwfl_Module *mod, Elf *relocated, const GElf_Ehdr *ehdr, size_t shstrndx, struct reloc_symtab_cache *reloc_symtab, Elf_Scn *scn, GElf_Shdr *shdr, Elf_Scn *tscn, bool debugscn, bool partial) relocate_section() argument 769 Elf_Scn *scn = NULL; __libdwfl_relocate() local [all...] |
/third_party/elfutils/src/ |
H A D | elfcompress.c | 199 compress_section (Elf_Scn *scn, size_t orig_size, const char *name, in compress_section() argument 206 res = elf_compress_gnu (scn, compress ? 1 : 0, flags); in compress_section() 208 res = elf_compress (scn, compress ? ELFCOMPRESS_ZLIB : 0, flags); in compress_section() 231 GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); in compress_section() 421 Elf_Scn *scn = NULL; in process_file() local 422 while ((scn = elf_nextscn (elf, scn)) != NULL) in process_file() 424 size_t ndx = elf_ndxscn (scn); in process_file() 433 GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); in process_file() 649 scn in process_file() [all...] |
/third_party/elfutils/libdw/ |
H A D | dwarf_begin_elf.c | 74 scn_dwarf_type (Dwarf *result, size_t shstrndx, Elf_Scn *scn) in scn_dwarf_type() argument 77 GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); in scn_dwarf_type() 99 check_section (Dwarf *result, size_t shstrndx, Elf_Scn *scn, bool inscngrp) in check_section() argument 105 shdr = gelf_getshdr (scn, &shdr_mem); in check_section() 208 elf_compress_gnu (scn, 0, 0); in check_section() 212 if (elf_compress (scn, 0, 0) < 0) in check_section() 222 Elf_Data *data = elf_getdata (scn, NULL); in check_section() 394 Elf_Scn *scn = NULL; in global_read() local 398 while ((scn = elf_nextscn (elf, scn)) ! in global_read() 455 Elf_Scn *scn = elf_getscn (elf, scnidx[cnt]); scngrp_read() local 473 Elf_Scn *scn = elf_getscn (elf, scnidx[cnt]); scngrp_read() local [all...] |