libctf: add the object index and function index sections
[deliverable/binutils-gdb.git] / libctf / ChangeLog
CommitLineData
2db912ba
NA
12019-07-13 Nick Alcock <nick.alcock@oracle.com>
2
3 * ctf-open.c (init_symtab): Check for overflow against the right
4 section.
5 (upgrade_header): Set cth_objtidxoff, cth_funcidxoff to zero-length.
6 (upgrade_types_v1): Note that these sections are not checked.
7 (flip_header): Endian-swap the header fields.
8 (flip_ctf): Endian-swap the sections.
9 (flip_objts): Update comment.
10 (ctf_bufopen): Check header offsets and alignment for validity.
11
6d5944fc
NA
122019-07-13 Nick Alcock <nick.alcock@oracle.com>
13
14 * ctf-open-bfd.c: Add <assert.h>.
15 (ctf_bfdopen_ctfsect): Open string and symbol tables using
16 techniques borrowed from bfd_elf_sym_name.
17 (ctf_new_archive_internal): Improve comment.
18 * ctf-archive.c (ctf_arc_close): Do not free the ctfi_strsect.
19 * ctf-open.c (ctf_bufopen): Allow opening with a string section but
20 no symbol section, but not vice versa.
21
9b32cba4
NA
222019-07-08 Nick Alcock <nick.alcock@oracle.com>
23
24 * ctf-impl.h (ctf_file_t): New field ctf_openflags.
25 * ctf-open.c (ctf_bufopen): Set it. No longer dump header offsets.
26 * ctf-dump.c (dump_header): New function, dump the CTF header.
27 (ctf_dump): Call it.
28 (ctf_dump_header_strfield): New function.
29 (ctf_dump_header_sectfield): Likewise.
30
fd55eae8
NA
312019-07-06 Nick Alcock <nick.alcock@oracle.com>
32
33 * ctf-impl.h (ctf_file_t): New fields ctf_header, ctf_dynbase,
34 ctf_cuname, ctf_dyncuname: ctf_base and ctf_buf are no longer const.
35 * ctf-open.c (ctf_set_base): Preserve the gap between ctf_buf and
36 ctf_base: do not assume that it is always sizeof (ctf_header_t).
37 Print out ctf_cuname: only print out ctf_parname if set.
38 (ctf_free_base): Removed, ctf_base is no longer freed: free
39 ctf_dynbase instead.
40 (ctf_set_version): Fix spacing.
41 (upgrade_header): New, in-place header upgrading.
42 (upgrade_types): Rename to...
43 (upgrade_types_v1): ... this. Free ctf_dynbase, not ctf_base. No
44 longer track old and new headers separately. No longer allow for
45 header sizes explicitly: squeeze the headers out on upgrade (they
46 are preserved in fp->ctf_header). Set ctf_dynbase, ctf_base and
47 ctf_buf explicitly. Use ctf_free, not ctf_free_base.
48 (upgrade_types): New, also handle ctf_parmax updating.
49 (flip_header): Flip ctf_cuname.
50 (flip_types): Flip BUF explicitly rather than deriving BUF from
51 BASE.
52 (ctf_bufopen): Store the header in fp->ctf_header. Correct minimum
53 required alignment of objtoff and funcoff. No longer store it in
54 the ctf_buf unless that buf is derived unmodified from the input.
55 Set ctf_dynbase where ctf_base is dynamically allocated. Drop locals
56 that duplicate fields in ctf_file: move allocation of ctf_file
57 further up instead. Call upgrade_header as needed. Move
58 version-specific ctf_parmax initialization into upgrade_types. More
59 concise error handling.
60 (ctf_file_close): No longer test for null pointers before freeing.
61 Free ctf_dyncuname, ctf_dynbase, and ctf_header. Do not call
62 ctf_free_base.
63 (ctf_cuname): New.
64 (ctf_cuname_set): New.
65 * ctf-create.c (ctf_update): Populate ctf_cuname.
66 (ctf_gzwrite): Write out the header explicitly. Remove obsolescent
67 comment.
68 (ctf_write): Likewise.
69 (ctf_compress_write): Get the header from ctf_header, not ctf_base.
70 Fix the compression length: fp->ctf_size never counted the CTF
71 header. Simplify the compress call accordingly.
72
a2230b5e
HPN
732019-07-11 Hans-Peter Nilsson <hp@bitrange.com>
74
75 * ctf-endian.h: Don't assume htole64 and le64toh are always
76 present if HAVE_ENDIAN_H; also check if htole64 is defined.
77 [!WORDS_BIGENDIAN] (htole64, le64toh): Define as identity,
78 not bswap_identity_64.
79
fd361982
AM
802019-09-18 Alan Modra <amodra@gmail.com>
81
82 * ctf-open-bfd.c: Update throughout for bfd section macro changes.
83
60391a25
PB
842019-09-09 Phil Blundell <pb@pbcl.net>
85
86 binutils 2.33 branch created.
87
12a0b67d
NA
882019-07-18 Nick Alcock <nick.alcock@oracle.com>
89
90 * ctf-types.c (ctf_type_aname_raw): New.
91 (ctf_func_type_info): Likewise.
92 (ctf_func_type_args): Likewise.
93 * ctf-error.c (_ctf_errlist): Fix description.
94 * ctf-lookup.c: Fix file description.
95
083114f8 962019-06-28 Nick Alcock <nick.alcock@oracle.com>
f57cf0e3
NA
97
98 * ctf-create.c (ctf_create): Fix off-by-one error.
99
083114f8 1002019-06-28 Nick Alcock <nick.alcock@oracle.com>
f5e9c9bd
NA
101
102 * ctf-impl.h: (struct ctf_strs_writable): New, non-const version of
103 struct ctf_strs.
104 (struct ctf_dtdef): Note that dtd_data.ctt_name is unpopulated.
105 (struct ctf_str_atom): New, disambiguated single string.
106 (struct ctf_str_atom_ref): New, points to some other location that
107 references this string's offset.
108 (struct ctf_file): New members ctf_str_atoms and ctf_str_num_refs.
109 Remove member ctf_dtvstrlen: we no longer track the total strlen
110 as we add strings.
111 (ctf_str_create_atoms): Declare new function in ctf-string.c.
112 (ctf_str_free_atoms): Likewise.
113 (ctf_str_add): Likewise.
114 (ctf_str_add_ref): Likewise.
115 (ctf_str_rollback): Likewise.
116 (ctf_str_purge_refs): Likewise.
117 (ctf_str_write_strtab): Likewise.
118 (ctf_realloc): Declare new function in ctf-util.c.
119
120 * ctf-open.c (ctf_bufopen): Create the atoms table.
121 (ctf_file_close): Destroy it.
122 * ctf-create.c (ctf_update): Copy-and-free it on update. No longer
123 special-case the position of the parname string. Construct the
124 strtab by calling ctf_str_add_ref and ctf_str_write_strtab after the
125 rest of each buffer element is constructed, not via open-coding:
126 realloc the CTF buffer and append the strtab to it. No longer
127 maintain ctf_dtvstrlen. Sort the variable entry table later, after
128 strtab construction.
129 (ctf_copy_membnames): Remove: integrated into ctf_copy_{s,l,e}members.
130 (ctf_copy_smembers): Drop the string offset: call ctf_str_add_ref
131 after buffer element construction instead.
132 (ctf_copy_lmembers): Likewise.
133 (ctf_copy_emembers): Likewise.
134 (ctf_create): No longer maintain the ctf_dtvstrlen.
135 (ctf_dtd_delete): Likewise.
136 (ctf_dvd_delete): Likewise.
137 (ctf_add_generic): Likewise.
138 (ctf_add_enumerator): Likewise.
139 (ctf_add_member_offset): Likewise.
140 (ctf_add_variable): Likewise.
141 (membadd): Likewise.
142 * ctf-util.c (ctf_realloc): New, wrapper around realloc that aborts
143 if there are active ctf_str_num_refs.
144 (ctf_strraw): Move to ctf-string.c.
145 (ctf_strptr): Likewise.
146 * ctf-string.c: New file, strtab manipulation.
147
148 * Makefile.am (libctf_a_SOURCES): Add it.
149 * Makefile.in: Regenerate.
150
083114f8 1512019-06-28 Nick Alcock <nick.alcock@oracle.com>
9658dc39
NA
152
153 * ctf-impl.h (ctf_hash_iter_f): New.
154 (ctf_dynhash_iter): New declaration.
155 (ctf_dynhash_iter_remove): New declaration.
156 * ctf-hash.c (ctf_dynhash_iter): Define.
157 (ctf_dynhash_iter_remove): Likewise.
158 (ctf_hashtab_traverse): New.
159 (ctf_hashtab_traverse_remove): Likewise.
160 (struct ctf_traverse_cb_arg): Likewise.
161 (struct ctf_traverse_remove_cb_arg): Likewise.
162
083114f8 1632019-06-28 Nick Alcock <nick.alcock@oracle.com>
3e10cffc
NA
164
165 * ctf-hash.c (ctf_dynhash_remove): Call with a mocked-up element.
166
083114f8 1672019-06-28 Nick Alcock <nick.alcock@oracle.com>
c550e7ba
NA
168
169 * ctf-dump.c (ctf_dump_format_type): Prefix hex strings with 0x.
170 (ctf_dump_funcs): Likewise.
171
083114f8 1722019-06-19 Nick Alcock <nick.alcock@oracle.com>
cf02c44d
NA
173
174 * ctf-open-bfd.c: Add swap.h and ctf-endian.h.
175 (ctf_fdopen): Check for endian-swapped raw CTF magic, and
176 little-endian CTF archive magic. Do not check the CTF version:
177 ctf_simple_open does that in endian-safe ways. Do not dereference
178 null pointers on open failure.
179
083114f8 1802019-06-19 Nick Alcock <nick.alcock@oracle.com>
7cee1826
NA
181
182 * ctf-open.c (get_vbytes_common): Return the new slice size.
183 (ctf_bufopen): Flip the endianness of the CTF-section header copy.
184 Remember to copy in the CTF data when opening an uncompressed
185 foreign-endian CTF file. Prune useless variable manipulation.
186
083114f8 1872019-06-19 Nick Alcock <nick.alcock@oracle.com>
0b4fa56e
NA
188
189 * ctf-open.c (ctf_types): Fail when unidentified type kinds are
190 seen.
191
083114f8 1922019-06-19 Nick Alcock <nick.alcock@oracle.com>
364620bf
NA
193
194 * ctf-open.c (ctf_bufopen): Dump header offsets into the debugging
195 output.
196
083114f8 1972019-06-19 Nick Alcock <nick.alcock@oracle.com>
65365aa8
NA
198
199 * ctf-subr.c (_PAGESIZE): Remove.
200 (ctf_data_alloc): Likewise.
201 (ctf_data_free): Likewise.
202 (ctf_data_protect): Likewise.
203 * ctf-impl.h: Remove declarations.
204 * ctf-create.c (ctf_update): No longer call ctf_data_protect: use
205 ctf_free, not ctf_data_free.
206 (ctf_compress_write): Use ctf_data_alloc, not ctf_alloc. Free
207 the buffer again on compression error.
208 * ctf-open.c (ctf_set_base): No longer track the size: call
209 ctf_free, not ctf_data_free.
210 (upgrade_types): Likewise. Call ctf_alloc, not ctf_data_alloc.
211 (ctf_bufopen): Likewise. No longer call ctf_data_protect.
212
083114f8 2132019-06-19 Nick Alcock <nick.alcock@oracle.com>
24865428
NA
214
215 * ctf-create.c (ctf_dtd_insert): Pass on error returns from
216 ctf_dynhash_insert.
217 (ctf_dvd_insert): Likewise.
218 (ctf_add_generic): Likewise.
219 (ctf_add_variable): Likewise.
220 * ctf-impl.h: Adjust declarations.
221
3a3a077c
AM
2222019-06-14 Alan Modra <amodra@gmail.com>
223
224 * configure: Regenerate.
225
942d35f7
NA
2262019-06-06 Nick Alcock <nick.alcock@oracle.com>
227
228 * ctf-decls.h: Include <libiberty.h>.
229 * ctf-lookup.c (ctf_lookup_by_name): Call xstrndup(), not strndup().
230
595a4d43
NA
2312019-06-06 Nick Alcock <nick.alcock@oracle.com>
232
233 * ctf-dump.c (ctf_dump_format_type): Cast size_t's used in printf()s.
234 (ctf_dump_objts): Likewise.
235 (ctf_dump_funcs): Likewise.
236 (ctf_dump_member): Likewise.
237 (ctf_dump_str): Likewise.
238
f5e73be1
NA
2392019-06-06 Nick Alcock <nick.alcock@oracle.com>
240
241 * ctf-archive.c (arc_mmap_header): Mark fd as potentially unused.
242 * ctf-subr.c (ctf_data_protect): Mark both args as potentially unused.
243
62d8e3b7
NA
2442019-06-05 Nick Alcock <nick.alcock@oracle.com>
245
246 * ctf-archive.c (ctf_arc_write): Eschew %zi format specifier.
247 (ctf_arc_open_by_offset): Likewise.
248 * ctf-create.c (ctf_add_type): Likewise.
249
76fad999
TT
2502019-06-04 Tom Tromey <tromey@adacore.com>
251
252 * ctf-create.c (ctf_add_encoded, ctf_add_slice)
253 (ctf_add_member_offset): Use CHAR_BIT, not NBBY.
254
ad118caa
NA
2552019-06-04 Nick Alcock <nick.alcock@oracle.com>
256
257 * configure.ac: Check for O_CLOEXEC.
258 * ctf-decls.h (O_CLOEXEC): Define (to 0), if need be.
259 * config.h.in: Regenerate.
260 * configure: Likewise.
261
6b22174f
NA
2622019-06-04 Nick Alcock <nick.alcock@oracle.com>
263
264 * qsort_r.c: Rename to...
265 * ctf-qsort_r.c: ... this.
266 (_quicksort): Define to ctf_qsort_r.
267 * ctf-decls.h (qsort_r): Remove.
268 (ctf_qsort_r): Add.
269 (struct ctf_qsort_arg): New, transport the real ARG and COMPAR.
270 (ctf_qsort_compar_thunk): Rearrange the arguments to COMPAR.
271 * Makefile.am (libctf_a_LIBADD): Remove.
272 (libctf_a_SOURCES): New, add ctf-qsort_r.c.
273 * ctf-archive.c (ctf_arc_write): Call ctf_qsort_r, not qsort_r.
274 * ctf-create.c (ctf_update): Likewise.
275 * configure.ac: Check for BSD versus GNU qsort_r signature.
276 * Makefile.in: Regenerate.
277 * config.h.in: Likewise.
278 * configure: Likewise.
279
941accce
NA
2802019-06-03 Nick Alcock <nick.alcock@oracle.com>
281
282 * ctf-dump.c (ctf_dump_funcs): Free in the right place.
283
a0486bac
JM
2842019-05-29 Nick Alcock <nick.alcock@oracle.com>
285
286 * Makefile.am (ZLIB): New.
287 (ZLIBINC): Likewise.
288 (AM_CFLAGS): Use them.
289 (libctf_a_LIBADD): New, for LIBOBJS.
290 * configure.ac: Check for zlib, endian.h, and qsort_r.
291 * ctf-endian.h: New, providing htole64 and le64toh.
292 * swap.h: Code style fixes.
293 (bswap_identity_64): New.
294 * qsort_r.c: New, from gnulib (with one added #include).
295 * ctf-decls.h: New, providing a conditional qsort_r declaration,
296 and unconditional definitions of MIN and MAX.
297 * ctf-impl.h: Use it. Do not use <sys/errno.h>.
298 (ctf_set_errno): Now returns unsigned long.
299 * ctf-util.c (ctf_set_errno): Adjust here too.
300 * ctf-archive.c: Use ctf-endian.h.
301 (ctf_arc_open_by_offset): Use memset, not bzero. Drop cts_type,
302 cts_flags and cts_offset.
303 (ctf_arc_write): Drop debugging dependent on the size of off_t.
304 * ctf-create.c: Provide a definition of roundup if not defined.
305 (ctf_create): Drop cts_type, cts_flags and cts_offset.
306 (ctf_add_reftype): Do not check if type IDs are below zero.
307 (ctf_add_slice): Likewise.
308 (ctf_add_typedef): Likewise.
309 (ctf_add_member_offset): Cast error-returning ssize_t's to size_t
310 when known error-free. Drop CTF_ERR usage for functions returning
311 int.
312 (ctf_add_member_encoded): Drop CTF_ERR usage for functions returning
313 int.
314 (ctf_add_variable): Likewise.
315 (enumcmp): Likewise.
316 (enumadd): Likewise.
317 (membcmp): Likewise.
318 (ctf_add_type): Likewise. Cast error-returning ssize_t's to size_t
319 when known error-free.
320 * ctf-dump.c (ctf_is_slice): Drop CTF_ERR usage for functions
321 returning int: use CTF_ERR for functions returning ctf_type_id.
322 (ctf_dump_label): Likewise.
323 (ctf_dump_objts): Likewise.
324 * ctf-labels.c (ctf_label_topmost): Likewise.
325 (ctf_label_iter): Likewise.
326 (ctf_label_info): Likewise.
327 * ctf-lookup.c (ctf_func_args): Likewise.
328 * ctf-open.c (upgrade_types): Cast to size_t where appropriate.
329 (ctf_bufopen): Likewise. Use zlib types as needed.
330 * ctf-types.c (ctf_member_iter): Drop CTF_ERR usage for functions
331 returning int.
332 (ctf_enum_iter): Likewise.
333 (ctf_type_size): Likewise.
334 (ctf_type_align): Likewise. Cast to size_t where appropriate.
335 (ctf_type_kind_unsliced): Likewise.
336 (ctf_type_kind): Likewise.
337 (ctf_type_encoding): Likewise.
338 (ctf_member_info): Likewise.
339 (ctf_array_info): Likewise.
340 (ctf_enum_value): Likewise.
341 (ctf_type_rvisit): Likewise.
342 * ctf-open-bfd.c (ctf_bfdopen): Drop cts_type, cts_flags and
343 cts_offset.
344 (ctf_simple_open): Likewise.
345 (ctf_bfdopen_ctfsect): Likewise. Set cts_size properly.
346 * Makefile.in: Regenerate.
347 * aclocal.m4: Likewise.
348 * config.h: Likewise.
349 * configure: Likewise.
350
9698cf9b
NA
3512019-05-28 Nick Alcock <nick.alcock@oracle.com>
352
353 * configure.in: Check for bfd_section_from_elf_index.
354 * configure: Regenerate.
355 * config.h.in [HAVE_BFD_ELF]: Likewise.
356 * libctf/ctf_open_bfd (ctf_bfdopen_ctfsect): Use it.
357 abfd is potentially unused now.
358
0e65dfba
NA
3592019-05-28 Nick Alcock <nick.alcock@oracle.com>
360
361 * Makefile.am: New.
362 * Makefile.in: Regenerated.
363 * config.h.in: Likewise.
364 * aclocal.m4: Likewise.
365 * configure: Likewise.
366
a30b3e18
NA
3672019-05-28 Nick Alcock <nick.alcock@oracle.com>
368
369 * ctf-dump.c: New.
370
6dbf2b73
NA
3712019-05-28 Nick Alcock <nick.alcock@oracle.com>
372
373 * ctf-labels.c: New.
374
6c33b742
NA
3752019-05-28 Nick Alcock <nick.alcock@oracle.com>
376
377 * ctf-impl.h (_libctf_version): New declaration.
378 * ctf-subr.c (_libctf_version): Define it.
379 (ctf_version): New.
380
c499eb68
NA
3812019-05-28 Nick Alcock <nick.alcock@oracle.com>
382
383 * ctf-create.c (enumcmp): New.
384 (enumadd): Likewise.
385 (membcmp): Likewise.
386 (membadd): Likewise.
387 (ctf_add_type): Likewise.
388
b437bfe0
NA
3892019-05-28 Nick Alcock <nick.alcock@oracle.com>
390
391 * ctf-lookup.c (isqualifier): New.
392 (ctf_lookup_by_name): Likewise.
393 (struct ctf_lookup_var_key): Likewise.
394 (ctf_lookup_var): Likewise.
395 (ctf_lookup_variable): Likewise.
396 (ctf_lookup_symbol_name): Likewise.
397 (ctf_lookup_by_symbol): Likewise.
398 (ctf_func_info): Likewise.
399 (ctf_func_args): Likewise.
400
316afdb1
NA
4012019-05-28 Nick Alcock <nick.alcock@oracle.com>
402
403 * ctf-decl.c: New file.
404 * ctf-types.c: Likewise.
405 * ctf-impl.h: New declarations.
406
143dce84
NA
4072019-05-28 Nick Alcock <nick.alcock@oracle.com>
408
409 * ctf-open-bfd.c: New file.
410 * ctf-open.c (ctf_close): New.
411 * ctf-impl.h: Include bfd.h.
412 (ctf_file): New members ctf_data_mmapped, ctf_data_mmapped_len.
413 (ctf_archive_internal): New members ctfi_abfd, ctfi_data,
414 ctfi_bfd_close.
415 (ctf_bfdopen_ctfsect): New declaration.
416 (_CTF_SECTION): likewise.
417
9402cc59
NA
4182019-05-28 Nick Alcock <nick.alcock@oracle.com>
419
420 * ctf-archive.c: New.
421 * ctf-impl.h (ctf_archive_internal): New type.
422 (ctf_arc_open_internal): New declaration.
423 (ctf_arc_bufopen): Likewise.
424 (ctf_arc_close_internal): Likewise.
425
72f33921
NA
4262019-05-28 Nick Alcock <nick.alcock@oracle.com>
427
428 * ctf-open.c: New file.
429 * swap.h: Likewise.
430
47d546f4
NA
4312019-05-28 Nick Alcock <nick.alcock@oracle.com>
432
433 * ctf-create.c: New file.
434 * ctf-lookup.c: New file.
435
a5be9bbe
NA
4362019-05-28 Nick Alcock <nick.alcock@oracle.com>
437
438 * ctf-impl.h: New definitions and declarations for type creation
439 and lookup.
440
c0754cdd
NA
4412019-05-28 Nick Alcock <nick.alcock@oracle.com>
442
443 * ctf-hash.c: New file.
444 * ctf-impl.h: New declarations.
445
479604f4
NA
4462019-05-28 Nick Alcock <nick.alcock@oracle.com>
447
448 * ctf-error.c: New file.
449
94585e7f
NA
4502019-05-28 Nick Alcock <nick.alcock@oracle.com>
451
452 * ctf-util.c: New file.
453 * elf.h: Likewise.
454 * ctf-impl.h: Include it, and add declarations.
455
60da9d95
NA
4562019-05-28 Nick Alcock <nick.alcock@oracle.com>
457
458 * ctf-impl.h: New file.
459 * ctf-subr.c: New file.
460
461\f
462Local Variables:
463mode: change-log
464left-margin: 8
465fill-column: 76
466version-control: never
467End:
This page took 0.057858 seconds and 4 git commands to generate.