Home
last modified time | relevance | path

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

1234567891011

/external/elfutils/libelf/
Delf_getdata.c138 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 = (char *) 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 = (char *) malloc (size); in convert_data()
167 if (scn->data_base == NULL) in convert_data()
176 if (((((size_t) (char *) scn->rawdata_base)) & (align - 1)) == 0) in convert_data()
177 rawdata_source = scn->rawdata_base; in convert_data()
[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()
141 if (gelf_xlatetof (scn->elf, &cdata, data, ei_data) == NULL) in __libelf_compress()
154 next_data = elf_getdata (scn, data); in __libelf_compress()
269 __libelf_decompress_elf (Elf_Scn *scn, size_t *size_out, size_t *addralign) in __libelf_decompress_elf() argument
272 if (gelf_getchdr (scn, &chdr) == NULL) in __libelf_decompress_elf()
293 Elf_Data *data = elf_getdata (scn, NULL); in __libelf_decompress_elf()
297 int elfclass = scn->elf->class; in __libelf_decompress_elf()
311 __libelf_reset_rawdata (Elf_Scn *scn, void *buf, size_t size, size_t align, in __libelf_reset_rawdata() argument
[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_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 …]
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 …]
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()
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()
Delf32_checksum.c57 Elf_Scn *scn; in elfw2() local
90 scn = NULL; in elfw2()
91 while ((scn = INTUSE(elf_nextscn) (elf, scn)) != NULL) in elfw2()
98 shdr = INTUSE(gelf_getshdr) (scn, &shdr_mem); in elfw2()
123 data = INTUSE(elf_rawdata) (scn, NULL); in elfw2()
135 while ((data = INTUSE(elf_getdata) (scn, data)) != NULL) in elfw2()
/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/
Dfillfile.c68 Elf_Scn *scn = elf_newscn (elf); in create_strtab() local
69 if (scn == NULL) in create_strtab()
76 add_strtab_entry (scn, ""); in create_strtab()
79 GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); in create_strtab()
94 shdr->sh_name = add_strtab_entry (scn, ".strtab"); in create_strtab()
106 int ndx = elf_ndxscn (scn); in create_strtab()
116 if (gelf_update_shdr (scn, shdr) == 0) in create_strtab()
122 return scn; in create_strtab()
132 Elf_Scn *scn = elf_newscn (elf); in add_data_section() local
133 if (scn == NULL) in add_data_section()
[all …]
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()
120 int res = elf_compress_gnu (scn, 1, 0); in main()
124 res = elf_compress_gnu (scn, 1, ELF_CHF_FORCE); in main()
136 int res = elf_compress (scn, ELFCOMPRESS_ZLIB, 0); in main()
140 res = elf_compress (scn, ELFCOMPRESS_ZLIB, ELF_CHF_FORCE); in main()
151 GElf_Shdr *newshdr = gelf_getshdr (scn, &newmem); in main()
[all …]
Delfstrtab.c107 add_string (Elf_Scn *scn, char *str) in add_string() argument
112 Elf_Data *data = elf_newdata (scn); in add_string()
174 Elf_Scn *scn = elf_newscn (elf); in check_elf() local
175 if (scn == NULL) in check_elf()
182 add_string (scn, ""); in check_elf()
185 GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); in check_elf()
199 shdr->sh_name = add_string (scn, ".strings"); in check_elf()
203 int ndx = elf_ndxscn (scn); in check_elf()
216 orig_str1_off = add_string (scn, orig_str1); in check_elf()
218 orig_str2_off = add_string (scn, orig_str2); in check_elf()
[all …]
Dupdate4.c42 Elf_Scn *scn; in main() local
116 scn = elf_newscn (elf); in main()
117 if (scn == NULL) in main()
122 shdr = elf32_getshdr (scn); in main()
138 data = elf_newdata (scn); in main()
152 scn = elf_newscn (elf); in main()
153 if (scn == NULL) in main()
158 shdr = elf32_getshdr (scn); in main()
174 data = elf_newdata (scn); in main()
188 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()
Demptyfile.c40 add_string (Elf_Scn *scn, char *str) in add_string() argument
45 Elf_Data *data = elf_newdata (scn); in add_string()
150 Elf_Scn *scn = elf_newscn (elf); in check_elf() local
151 if (scn == NULL) in check_elf()
158 add_string (scn, ""); in check_elf()
161 GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); in check_elf()
175 shdr->sh_name = add_string (scn, ".strtab"); in check_elf()
179 int ndx = elf_ndxscn (scn); in check_elf()
189 if (gelf_update_shdr (scn, shdr) == 0) in check_elf()
226 scn = elf_nextscn (elf, NULL); in check_elf()
[all …]
Dnewdata.c42 Elf_Scn *scn = elf_getscn (elf, 1); in add_section_data() local
43 if (scn == NULL) in add_section_data()
49 Elf_Data *data = elf_newdata (scn); in add_section_data()
111 Elf_Scn *scn = elf_newscn (elf); in create_elf() local
112 if (scn == NULL) in create_elf()
119 GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); in create_elf()
136 if (gelf_update_shdr (scn, shdr) == 0) in create_elf()
172 Elf_Scn *scn = elf_getscn (elf, 1); in check_section_size() local
173 if (scn == NULL) in check_section_size()
180 GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); in check_section_size()
[all …]
Dasm-tst6.c62 AsmScn_t *scn; in main() local
74 scn = asm_newscn_ingrp (ctx, ".data", SHT_PROGBITS, in main()
76 if (scn == NULL) in main()
86 sym = asm_newsym (scn, buf, sizeof (uint32_t), STT_OBJECT, in main()
96 if (asm_adduint32 (scn, cnt) != 0) in main()
114 scn = asm_newscn_ingrp (ctx, ".stab", SHT_PROGBITS, 0, grp); in main()
115 if (scn == NULL) in main()
124 if (asm_adduint32 (scn, cnt) != 0) in main()
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