Home
last modified time | relevance | path

Searched refs:scn (Results 1 – 25 of 275) sorted by relevance

1234567891011

/external/elfutils/libelf/
Delf_getdata.c136 convert_data (Elf_Scn *scn, int eclass, in convert_data() argument
144 if (((((size_t) (char *) scn->rawdata_base)) & (align - 1)) == 0) in convert_data()
146 scn->data_base = scn->rawdata_base; in convert_data()
149 scn->data_base = (char *) malloc (size); in convert_data()
150 if (scn->data_base == NULL) in convert_data()
157 memcpy (scn->data_base, scn->rawdata_base, size); in convert_data()
164 scn->data_base = (char *) malloc (size); in convert_data()
165 if (scn->data_base == NULL) in convert_data()
174 if (((((size_t) (char *) scn->rawdata_base)) & (align - 1)) == 0) in convert_data()
175 rawdata_source = scn->rawdata_base; in convert_data()
[all …]
Delf_newdata.c41 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->data_list_rear == NULL) in elf_newdata()
[all …]
Delf_compress.c68 __libelf_compress (Elf_Scn *scn, size_t hsize, int ei_data, in __libelf_compress() argument
78 Elf_Data *data = elf_getdata (scn, NULL); in __libelf_compress()
86 Elf_Data *next_data = elf_getdata (scn, data); in __libelf_compress()
140 if (gelf_xlatetof (scn->elf, &cdata, data, ei_data) == NULL) in __libelf_compress()
153 next_data = elf_getdata (scn, data); in __libelf_compress()
267 __libelf_decompress_elf (Elf_Scn *scn, size_t *size_out, size_t *addralign) in __libelf_decompress_elf() argument
270 if (gelf_getchdr (scn, &chdr) == NULL) in __libelf_decompress_elf()
291 Elf_Data *data = elf_getdata (scn, NULL); in __libelf_decompress_elf()
295 int elfclass = scn->elf->class; in __libelf_decompress_elf()
309 __libelf_reset_rawdata (Elf_Scn *scn, void *buf, size_t size, size_t align, in __libelf_reset_rawdata() argument
[all …]
Delf_compress_gnu.c38 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->zdata_base = NULL; in elf_compress_gnu()
[all …]
Delf32_getshdr.c49 load_shdr_wrlock (Elf_Scn *scn) in ElfW2()
54 Elf *elf = scn->elf; in ElfW2()
58 result = scn->shdr.ELFW(e,LIBELFBITS); in ElfW2()
220 result = scn->shdr.ELFW(e,LIBELFBITS); in ElfW2()
228 scn_valid (Elf_Scn *scn) in scn_valid() argument
230 if (scn == NULL) in scn_valid()
233 if (unlikely (scn->elf->state.elf.ehdr == NULL)) in scn_valid()
239 if (unlikely (scn->elf->class != ELFW(ELFCLASS,LIBELFBITS))) in scn_valid()
250 __elfw2(LIBELFBITS,getshdr_rdlock) (Elf_Scn *scn) in ElfW2()
254 if (!scn_valid (scn)) in ElfW2()
[all …]
Delf_rawdata.c40 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()
Delf32_updatefile.c242 Elf_Scn *scn = scns[cnt]; in __elfw2() local
245 && (scn->shdr_flags & ELF_F_MALLOCED) == 0 in __elfw2()
246 && scn->shdr.ELFW(e,LIBELFBITS) != &shdr_dest[scn->index]) in __elfw2()
249 < (char *) scn->shdr.ELFW(e,LIBELFBITS)); in __elfw2()
250 assert ((char *) scn->shdr.ELFW(e,LIBELFBITS) in __elfw2()
261 scn->shdr.ELFW(e,LIBELFBITS) in __elfw2()
262 = memcpy (p, scn->shdr.ELFW(e,LIBELFBITS), in __elfw2()
273 <= (char *) scn->data_list.data.d.d_buf) in __elfw2()
274 && ((char *) scn->data_list.data.d.d_buf in __elfw2()
278 + scn->shdr.ELFW(e,LIBELFBITS)->sh_offset) in __elfw2()
[all …]
Dgelf_getshdr.c41 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()
Delf_end.c146 Elf_Scn *scn = &list->data[cnt]; in elf_end() local
149 if ((scn->shdr_flags & ELF_F_MALLOCED) != 0) in elf_end()
151 free (scn->shdr.e32); in elf_end()
156 if (scn->zdata_base != scn->rawdata_base) in elf_end()
157 free (scn->zdata_base); in elf_end()
163 if (scn->data_base != scn->rawdata_base) in elf_end()
164 free (scn->data_base); in elf_end()
169 || scn->rawdata_base == scn->zdata_base in elf_end()
170 || (scn->flags & ELF_F_MALLOCED) != 0) in elf_end()
171 free (scn->rawdata_base); in elf_end()
[all …]
Dgelf_update_shdr.c41 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()
Delf_nextscn.c42 elf_nextscn (Elf *elf, Elf_Scn *scn) in elf_nextscn() argument
52 if (scn == NULL) 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()
/external/elfutils/libasm/
Dasm_end.c89 Elf_Scn *scn = elf_getscn (ctx->out.elf, asmscn->data.main.scnndx); in binary_end()
91 Elf_Scn *scn = asmscn->data.main.scn; in binary_end() local
112 Elf_Data *newdata = elf_newdata (scn); in binary_end()
199 syment.st_value = sym->scn->offset + sym->offset; in binary_end()
208 Elf_Scn *scn = (sym->scn->subsection_id == 0 in binary_end() local
209 ? sym->scn->data.main.scn in binary_end()
210 : sym->scn->data.up->data.main.scn); in binary_end()
213 if (unlikely (scn == ASM_ABS_SCN)) in binary_end()
215 else if (unlikely (scn == ASM_COM_SCN)) in binary_end()
217 else if (unlikely ((ndx = elf_ndxscn (scn)) >= SHN_LORESERVE)) in binary_end()
[all …]
/external/elfutils/tests/
Delfputzdata.c73 Elf_Scn *scn = NULL; in main() local
74 while ((scn = elf_nextscn (elf, scn)) != NULL) in main()
76 size_t idx = elf_ndxscn (scn); in main()
78 GElf_Shdr *shdr = gelf_getshdr (scn, &mem); in main()
95 Elf_Data *d = elf_getdata (scn, NULL); in main()
123 int res = elf_compress_gnu (scn, 1, 0); in main()
127 res = elf_compress_gnu (scn, 1, ELF_CHF_FORCE); in main()
139 int res = elf_compress (scn, ELFCOMPRESS_ZLIB, 0); in main()
143 res = elf_compress (scn, ELFCOMPRESS_ZLIB, ELF_CHF_FORCE); in main()
154 GElf_Shdr *newshdr = gelf_getshdr (scn, &newmem); in main()
[all …]
Dfillfile.c69 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 == NULL) in add_data_section()
[all …]
Delfstrtab.c108 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_str2); in check_elf()
[all …]
Dupdate4.c43 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 = elf_newscn (elf); in main()
[all …]
Delfgetzdata.c68 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()
Dnext_cfi.c37 Elf_Scn *scn, const bool is_eh) in handle_section() argument
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, true); in main()
141 handle_section (name, ident, scn, false); in main()
Dzstrptr.c34 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()
Demptyfile.c41 add_string (Elf_Scn *scn, char *str) in add_string() argument
46 Elf_Data *data = elf_newdata (scn); in add_string()
151 Elf_Scn *scn = elf_newscn (elf); in check_elf() local
152 if (scn == NULL) in check_elf()
159 add_string (scn, ""); in check_elf()
162 GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); in check_elf()
176 shdr->sh_name = add_string (scn, ".strtab"); in check_elf()
180 int ndx = elf_ndxscn (scn); in check_elf()
190 if (gelf_update_shdr (scn, shdr) == 0) in check_elf()
227 scn = elf_nextscn (elf, NULL); in check_elf()
[all …]
Dasm-tst6.c63 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()
Dnewdata.c43 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, &shdr_mem); in check_section_size()
[all …]
Delfgetchdr.c65 Elf_Scn *scn = NULL; in main() local
66 while ((scn = elf_nextscn (elf, scn)) != NULL) in main()
68 int idx = elf_ndxscn (scn); in main()
70 if (gelf_getshdr (scn, &shdr) == NULL) in main()
80 if (gelf_getchdr (scn, &chdr) == NULL) in main()
105 if ((size = dwelf_scn_gnu_compressed_size (scn)) == -1) in main()
/external/elfutils/libdwfl/
Dderelocate.c40 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, &shdr_mem); in cache_sections()
135 newref->scn = scn; in cache_sections()
150 if (shdr->sh_info < elf_ndxscn (scn)) in cache_sections()
[all …]
/external/elfutils/src/
Delfcompress.c197 compress_section (Elf_Scn *scn, size_t orig_size, const char *name, in compress_section() argument
204 res = elf_compress_gnu (scn, compress ? 1 : 0, flags); in compress_section()
206 res = elf_compress (scn, compress ? ELFCOMPRESS_ZLIB : 0, flags); in compress_section()
229 GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); in compress_section()
451 Elf_Scn *scn = NULL; in process_file() local
452 while ((scn = elf_nextscn (elf, scn)) != NULL) in process_file()
454 size_t ndx = elf_ndxscn (scn); in process_file()
463 GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); in process_file()
681 scn = NULL; in process_file()
682 while ((scn = elf_nextscn (elf, scn)) != NULL) in process_file()
[all …]

1234567891011