1 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
3 * ctf-hash.c (ctf_helem_t) <key_free>: Remove.
4 <value_free>: Likewise.
6 (ctf_dynhash_item_free): Indirect through the owner.
7 (ctf_dynhash_create): Only pass in ctf_dynhash_item_free and
8 allocate space for the key_free and value_free fields fields
10 (ctf_hashtab_insert): Likewise. Fix OOM errno value.
11 (ctf_dynhash_insert): Only access ctf_hashtab's key_free and
12 value_free if they will exist. Set the slot's owner, but only
14 (ctf_dynhash_remove): Adjust.
16 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
18 * ctf-hash.c (ctf_hashtab_insert): Free the key passed in if
19 there is a key-freeing function and the key already exists.
21 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
23 * ctf-inlines.h: New file.
24 * ctf-impl.h: Include it.
25 (ctf_hash_iter_find_f): New typedef.
26 (ctf_dynhash_elements): New.
27 (ctf_dynhash_lookup_kv): New.
28 (ctf_dynhash_iter_find): New.
29 * ctf-hash.c (ctf_dynhash_lookup_kv): New.
30 (ctf_traverse_find_cb_arg_t): New.
31 (ctf_hashtab_traverse_find): New.
32 (ctf_dynhash_iter_find): New.
33 (ctf_dynhash_elements): New.
35 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
37 * ctf-impl.h [!__GNUC__] (__extension__): Define to nothing.
39 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
41 * ctf-archive.c (ctf_archive_count): New.
42 * libctf.ver: New public function.
44 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
46 * ctf-types.c (ctf_member_count): New.
47 * libctf.ver: New public function.
49 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
51 * ctf-types.c (ctf_type_kind_forwarded): New.
53 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
55 * ctf-types.c (ctf_type_name_raw): New.
56 (ctf_type_aname_raw): Reimplement accordingly.
58 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
60 * ctf-subr.c (ctf_dprintf): _libctf_debug is unlikely to be set.
62 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
64 * ctf-impl.h (struct ctf_archive_internal)
65 <ctfi_unmap_on_close>: New.
66 (ctf_new_archive_internal): Adjust.
67 * ctf-archive.c (ctf_new_archive_internal): Likewise.
68 Initialize ctfi_unmap_on_close. Adjust error path.
69 (ctf_arc_bufopen): Adjust ctf_new_archive_internal call
70 (unmap_on_close is 0).
71 (ctf_arc_close): Only unmap if ctfi_unmap_on_close.
72 * ctf-open-bfd.c (ctf_fdopen): Adjust.
74 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
76 * ctf-types.c (ctf_type_aname): Return ECTF_CORRUPT if
77 ints, floats or typedefs have no name. Fix comment typo.
79 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
81 * ctf-create.c (ctf_add_slice): Support slices of any kind that
82 resolves to an integral type.
83 * ctf-types.c (ctf_type_encoding): Resolve the type before
84 fishing its encoding out.
86 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
88 * ctf-create.c (ctf_create): Mark dirty.
90 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
92 * ctf-create.c (membcmp) Skip nameless members.
94 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
96 * ctf-create.c (ctf_add_member_offset): Support names of ""
97 as if they were the null pointer.
99 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
101 * ctf-open.c (init_types): Remove typeless CTF_K_FORWARD
104 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
106 * ctf-types.c (ctf_type_reference): Add support for dynamic slices.
108 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
110 * ctf-create.c (ctf_serialize): Add cast.
111 (ctf_add_slice): Likewise.
113 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
115 * ctf-impl.h (ctf_dtdef_t) <dtu_argv>: Fix type.
116 * ctf-create.c (ctf_add_function): Check for unimplemented type
117 and populate at the same time. Populate one-by-one, not via
119 (ctf_serialize): Remove unnecessary cast.
120 * ctf-types.c (ctf_func_type_info): Likewise.
121 (ctf_func_type_args): Likewise. Fix comment typo.
123 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
125 * ctf-create.c (ctf_add_reftype): Support refs to type zero.
126 (ctf_add_array): Support array contents of type zero.
127 (ctf_add_function): Support arguments and return types of
129 (ctf_add_typedef): Support typedefs to type zero.
130 (ctf_add_member_offset): Support members of type zero,
131 unless added at unspecified (naturally-aligned) offset.
133 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
135 * ctf-error.c: Include <stddef.h>, for offsetof.
136 (_ctf_errlist): Migrate to...
137 (_ctf_errlist_t): ... this.
138 (_ctf_erridx): New, indexes into _ctf_errlist_t.
140 (ctf_errmsg): Adjust accordingly.
141 * Makefile.am (BUILT_SOURCES): Note...
142 (ctf-error.h): ... this new rule.
143 * Makefile.in: Regenerate.
144 * mkerrors.sed: New, process ctf-api.h to generate ctf-error.h.
145 * .gitignore: New, ignore ctf-error.h.
147 2020-07-22 Nick Alcock <nick.alcock@oracle.com>
149 * ctf-impl.h: Fix typos in comments.
151 2020-07-22 Nick Clifton <nickc@redhat.com>
153 * ctf-archive.c (ctf_arc_write): Avoid calling close twice on the
154 same file descriptor.
156 2020-07-04 Nick Clifton <nickc@redhat.com>
158 Binutils 2.35 branch created.
160 2020-06-26 Nick Alcock <nick.alcock@oracle.com>
162 * aclocal.m4: Add config/gettext-sister.m4: Shuffle into
164 * configure.ac: Add ZW_GNU_GETTEXT_SISTER_DIR.
165 * config.h.in: Regenerated.
166 * Makefile.in: Likewise.
167 * configure: Likewise.
169 2020-06-26 Nick Alcock <nick.alcock@oracle.com>
171 * ctf-create.c: Include <unistd.h>.
172 * ctf-open-bfd.c: Likewise.
174 2020-06-26 Nick Alcock <nick.alcock@oracle.com>
177 * configure.ac: Check for bswap_16, bswap_32, and bswap_64 decls.
178 * swap.h (bswap_16): Do not assume that presence of <byteswap.h>
179 means this is declared.
180 (bswap_32): Likewise.
181 (bswap_64): Likewise.
182 (bswap_identity_64): Remove, unused.
183 * configure: Regenerated.
184 * config.h.in: Likewise.
186 2020-06-26 Nick Alcock <nick.alcock@oracle.com>
189 * ctf-impl.h (_libctf_printflike_): Add non-GNU-C fallback.
190 (_libctf_unlikely_): Likewise.
191 (_libctf_unused): Likewise.
192 (_libctf_malloc_): Likewise.
194 2020-06-26 Nick Alcock <nick.alcock@oracle.com>
197 * ctf-archive.c (search_nametbl): No longer global: declare...
198 (ctf_arc_open_by_name_internal): ... here. Use bsearch_r.
199 (search_modent_by_name): Take and use ARG for the nametbl.
201 2020-06-26 Nick Alcock <nick.alcock@oracle.com>
203 * ctf-impl.h (ctf_new_archive_internal): Declare.
204 (ctf_arc_bufopen): Remove.
205 (ctf_archive_internal) <ctfi_free_symsect>: New.
206 * ctf-archive.c (ctf_arc_close): Use it.
207 (ctf_arc_bufopen): Fuse into...
208 (ctf_new_archive_internal): ... this, moved across from...
209 * ctf-open-bfd.c: ... here.
210 (ctf_bfdopen_ctfsect): Use ctf_arc_bufopen.
211 * libctf.ver: Add it.
213 2020-06-26 Nick Alcock <nick.alcock@oracle.com>
215 * ctf-create.c (ctf_add_forward): Intern in the right namespace.
216 (ctf_dtd_delete): Remove correspondingly.
217 (ctf_rollback): Likewise.
219 2020-06-26 Nick Alcock <nick.alcock@oracle.com>
221 * ctf-create.c (ctf_add_type_internal): Hand back existing types
224 2020-06-26 Nick Alcock <nick.alcock@oracle.com>
226 * ctf-create.c (ctf_add_forward): Don't add forwards to
227 types that already exist.
229 2020-06-26 Nick Alcock <nick.alcock@oracle.com>
231 * ctf-open.c (init_types): Only intern root-visible types.
232 * ctf-create.c (ctf_dtd_insert): Likewise.
233 (ctf_dtd_delete): Only remove root-visible types.
234 (ctf_rollback): Likewise.
235 (ctf_add_generic): Adjust.
236 (ctf_add_struct_sized): Adjust comment.
237 (ctf_add_union_sized): Likewise.
238 (ctf_add_enum): Likewise.
239 * ctf-impl.h (ctf_dtd_insert): Adjust prototype.
241 2020-03-11 John Baldwin <jhb@FreeBSD.org>
243 * swap.h (bswap_identity_64): Make static.
245 2020-01-18 Nick Clifton <nickc@redhat.com>
247 Binutils 2.34 branch created.
249 2020-01-05 Joel Brobecker <brobecker@adacore.com>
252 * configure.ac: Add AC_CHECK_DECLS([asprintf]).
253 * configure, config.h.in: Regenerate.
255 2020-01-01 Alan Modra <amodra@gmail.com>
257 Update year range in copyright notice of all files.
259 2019-10-16 Simon Marchi <simon.marchi@polymtl.ca>
261 * swap.h (bswap_16, bswap_32, bswap_64): Make static.
263 2019-09-30 Nick Alcock <nick.alcock@oracle.com>
265 * ctf-open.c (ctf_bufopen_internal): Fix tabdamage.
266 * ctf-types.c (ctf_type_lname): Likewise.
268 2019-09-23 Nick Alcock <nick.alcock@oracle.com>
270 * ctf-open.c (ctf_import): Do not leak a ctf_file_t ref on every
271 ctf_import after the first for a given file.
273 2019-09-23 Nick Alcock <nick.alcock@oracle.com>
275 * ctf-impl.h (ctf_str_append_noerr): Declare.
276 * ctf-util.c (ctf_str_append_noerr): Define in terms of
278 * ctf-dump.c (str_append): New, call it.
279 (ctf_dump_format_type): Use str_append, not ctf_str_append.
280 (ctf_dump_label): Likewise.
281 (ctf_dump_objts): Likewise.
282 (ctf_dump_funcs): Likewise.
283 (ctf_dump_var): Likewise.
284 (ctf_dump_member): Likewise.
285 (ctf_dump_type): Likewise.
286 (ctf_dump): Likewise.
288 2019-09-23 Nick Alcock <nick.alcock@oracle.com>
290 * ctf-impl.h (ctf_alloc): Remove.
291 (ctf_free): Likewise.
292 (ctf_strdup): Likewise.
293 * ctf-subr.c (ctf_alloc): Remove.
294 (ctf_free): Likewise.
295 * ctf-util.c (ctf_strdup): Remove.
297 * ctf-create.c (ctf_serialize): Use malloc, not ctf_alloc; free, not
298 ctf_free; strdup, not ctf_strdup.
299 (ctf_dtd_delete): Likewise.
300 (ctf_dvd_delete): Likewise.
301 (ctf_add_generic): Likewise.
302 (ctf_add_function): Likewise.
303 (ctf_add_enumerator): Likewise.
304 (ctf_add_member_offset): Likewise.
305 (ctf_add_variable): Likewise.
307 (ctf_compress_write): Likewise.
308 (ctf_write_mem): Likewise.
309 * ctf-decl.c (ctf_decl_push): Likewise.
310 (ctf_decl_fini): Likewise.
311 (ctf_decl_sprintf): Likewise. Check for OOM.
312 * ctf-dump.c (ctf_dump_append): Use malloc, not ctf_alloc; free, not
313 ctf_free; strdup, not ctf_strdup.
314 (ctf_dump_free): Likewise.
315 (ctf_dump): Likewise.
316 * ctf-open.c (upgrade_types_v1): Likewise.
317 (init_types): Likewise.
318 (ctf_file_close): Likewise.
319 (ctf_bufopen_internal): Likewise. Check for OOM.
320 (ctf_parent_name_set): Likewise: report the OOM to the caller.
321 (ctf_cuname_set): Likewise.
322 (ctf_import): Likewise.
323 * ctf-string.c (ctf_str_purge_atom_refs): Use malloc, not ctf_alloc;
324 free, not ctf_free; strdup, not ctf_strdup.
325 (ctf_str_free_atom): Likewise.
326 (ctf_str_create_atoms): Likewise.
327 (ctf_str_add_ref_internal): Likewise.
328 (ctf_str_remove_ref): Likewise.
329 (ctf_str_write_strtab): Likewise.
331 2019-08-09 Nick Alcock <nick.alcock@oracle.com>
333 * ctf-types.c (ctf_type_encoding): Fix the dynamic case to
334 work right for non-int/fps.
336 2019-08-08 Nick Alcock <nick.alcock@oracle.com>
338 * ctf-types.c (ctf_type_name): Don't strlen a potentially-
341 2019-08-07 Nick Alcock <nick.alcock@oracle.com>
343 * ctf-impl.h (ctf_file_t) <ctf_add_processing>: New.
344 * ctf-open.c (ctf_file_close): Free it.
345 * ctf-create.c (ctf_serialize): Adjust.
346 (membcmp): When reporting a conflict due to an error, report the
348 (ctf_add_type): Turn into a ctf_add_processing wrapper. Rename to...
349 (ctf_add_type_internal): ... this. Hand back types we are already
350 in the middle of adding immediately. Hand back structs/unions with
351 the same number of members immediately. Do not walk the dynamic
352 list. Call ctf_add_type_internal, not ctf_add_type. Handle
353 forwards promoted to other types and the inverse case identically.
354 Add structs to the mapping as soon as we intern them, before they
357 2019-08-09 Nick Alcock <nick.alcock@oracle.com>
359 * ctf-impl.h (ctf_names_t): New.
360 (ctf_lookup_t) <ctf_hash>: Now a ctf_names_t, not a ctf_hash_t.
361 (ctf_file_t) <ctf_structs>: Likewise.
362 <ctf_unions>: Likewise.
363 <ctf_enums>: Likewise.
364 <ctf_names>: Likewise.
365 <ctf_lookups>: Improve comment.
366 <ctf_ptrtab_len>: New.
367 <ctf_prov_strtab>: New.
368 <ctf_str_prov_offset>: New.
369 <ctf_dtbyname>: Remove, redundant to the names hashes.
370 <ctf_dtnextid>: Remove, redundant to ctf_typemax.
371 (ctf_dtdef_t) <dtd_name>: Remove.
372 <dtd_data>: Note that the ctt_name is now populated.
373 (ctf_str_atom_t) <csa_offset>: This is now the strtab
374 offset for internal strings too.
375 <csa_external_offset>: New, the external strtab offset.
376 (CTF_INDEX_TO_TYPEPTR): Handle the LCTF_RDWR case.
377 (ctf_name_table): New declaration.
378 (ctf_lookup_by_rawname): Likewise.
379 (ctf_lookup_by_rawhash): Likewise.
380 (ctf_set_ctl_hashes): Likewise.
381 (ctf_serialize): Likewise.
382 (ctf_dtd_insert): Adjust.
383 (ctf_simple_open_internal): Likewise.
384 (ctf_bufopen_internal): Likewise.
385 (ctf_list_empty_p): Likewise.
386 (ctf_str_remove_ref): Likewise.
387 (ctf_str_add): Returns uint32_t now.
388 (ctf_str_add_ref): Likewise.
389 (ctf_str_add_external): Now returns a boolean (int).
390 * ctf-string.c (ctf_strraw_explicit): Check the ctf_prov_strtab
391 for strings in the appropriate range.
392 (ctf_str_create_atoms): Create the ctf_prov_strtab. Detect OOM
393 when adding the null string to the new strtab.
394 (ctf_str_free_atoms): Destroy the ctf_prov_strtab.
395 (ctf_str_add_ref_internal): Add make_provisional argument. If
396 make_provisional, populate the offset and fill in the
397 ctf_prov_strtab accordingly.
398 (ctf_str_add): Return the offset, not the string.
399 (ctf_str_add_ref): Likewise.
400 (ctf_str_add_external): Return a success integer.
401 (ctf_str_remove_ref): New, remove a single ref.
402 (ctf_str_count_strtab): Do not count the initial null string's
403 length or the existence or length of any unreferenced internal
405 (ctf_str_populate_sorttab): Skip atoms with no refs.
406 (ctf_str_write_strtab): Populate the nullstr earlier. Add one
407 to the cts_len for the null string, since it is no longer done
408 in ctf_str_count_strtab. Adjust for csa_external_offset rename.
409 Populate the csa_offset for both internal and external cases.
410 Flush the ctf_prov_strtab afterwards, and reset the
412 * ctf-create.c (ctf_grow_ptrtab): New.
413 (ctf_create): Call it. Initialize new fields rather than old
414 ones. Tell ctf_bufopen_internal that this is a writable dictionary.
415 Set the ctl hashes and data model.
416 (ctf_update): Rename to...
417 (ctf_serialize): ... this. Leave a compatibility function behind.
418 Tell ctf_simple_open_internal that this is a writable dictionary.
419 Pass the new fields along from the old dictionary. Drop
420 ctf_dtnextid and ctf_dtbyname. Use ctf_strraw, not dtd_name.
421 Do not zero out the DTD's ctt_name.
422 (ctf_prefixed_name): Rename to...
423 (ctf_name_table): ... this. No longer return a prefixed name: return
424 the applicable name table instead.
425 (ctf_dtd_insert): Use it, and use the right name table. Pass in the
426 kind we're adding. Migrate away from dtd_name.
427 (ctf_dtd_delete): Adjust similarly. Remove the ref to the
429 (ctf_dtd_lookup_type_by_name): Remove.
430 (ctf_dynamic_type): Always return NULL on read-only dictionaries.
431 No longer check ctf_dtnextid: check ctf_typemax instead.
432 (ctf_snapshot): No longer use ctf_dtnextid: use ctf_typemax instead.
433 (ctf_rollback): Likewise. No longer fail with ECTF_OVERROLLBACK. Use
434 ctf_name_table and the right name table, and migrate away from
435 dtd_name as in ctf_dtd_delete.
436 (ctf_add_generic): Pass in the kind explicitly and pass it to
437 ctf_dtd_insert. Use ctf_typemax, not ctf_dtnextid. Migrate away
438 from dtd_name to using ctf_str_add_ref to populate the ctt_name.
439 Grow the ptrtab if needed.
440 (ctf_add_encoded): Pass in the kind.
441 (ctf_add_slice): Likewise.
442 (ctf_add_array): Likewise.
443 (ctf_add_function): Likewise.
444 (ctf_add_typedef): Likewise.
445 (ctf_add_reftype): Likewise. Initialize the ctf_ptrtab, checking
446 ctt_name rather than dtd_name.
447 (ctf_add_struct_sized): Pass in the kind. Use
448 ctf_lookup_by_rawname, not ctf_hash_lookup_type /
449 ctf_dtd_lookup_type_by_name.
450 (ctf_add_union_sized): Likewise.
451 (ctf_add_enum): Likewise.
452 (ctf_add_enum_encoded): Likewise.
453 (ctf_add_forward): Likewise.
454 (ctf_add_type): Likewise.
455 (ctf_compress_write): Call ctf_serialize: adjust for ctf_size not
456 being initialized until after the call.
457 (ctf_write_mem): Likewise.
458 (ctf_write): Likewise.
459 * ctf-archive.c (arc_write_one_ctf): Likewise.
460 * ctf-lookup.c (ctf_lookup_by_name): Use ctf_lookuup_by_rawhash, not
461 ctf_hash_lookup_type.
462 (ctf_lookup_by_id): No longer check the readonly types if the
463 dictionary is writable.
464 * ctf-open.c (init_types): Assert that this dictionary is not
465 writable. Adjust to use the new name hashes, ctf_name_table,
466 and ctf_ptrtab_len. GNU style fix for the final ptrtab scan.
467 (ctf_bufopen_internal): New 'writable' parameter. Flip on LCTF_RDWR
468 if set. Drop out early when dictionary is writable. Split the
469 ctf_lookups initialization into...
470 (ctf_set_cth_hashes): ... this new function.
471 (ctf_simple_open_internal): Adjust. New 'writable' parameter.
472 (ctf_simple_open): Adjust accordingly.
473 (ctf_bufopen): Likewise.
474 (ctf_file_close): Destroy the appropriate name hashes. No longer
475 destroy ctf_dtbyname, which is gone.
476 (ctf_getdatasect): Remove spurious "extern".
477 * ctf-types.c (ctf_lookup_by_rawname): New, look up types in the
478 specified name table, given a kind.
479 (ctf_lookup_by_rawhash): Likewise, given a ctf_names_t *.
480 (ctf_member_iter): Add support for iterating over the
482 (ctf_enum_iter): Likewise.
483 (ctf_variable_iter): Likewise.
484 (ctf_type_rvisit): Likewise.
485 (ctf_member_info): Add support for types in the dynamic type list.
486 (ctf_enum_name): Likewise.
487 (ctf_enum_value): Likewise.
488 (ctf_func_type_info): Likewise.
489 (ctf_func_type_args): Likewise.
490 * ctf-link.c (ctf_accumulate_archive_names): No longer call
492 (ctf_link_write): Likewise.
493 (ctf_link_intern_extern_string): Adjust for new
494 ctf_str_add_external return value.
495 (ctf_link_add_strtab): Likewise.
496 * ctf-util.c (ctf_list_empty_p): New.
498 2019-08-05 Nick Alcock <nick.alcock@oracle.com>
500 * ctf-types.c (ctf_type_resolve): Return ECTF_NONREPRESENTABLE on
502 * ctf-create.c (ctf_add_type): Detect and skip nonrepresentable
504 (ctf_add_variable): Likewise for variables pointing to them.
505 * ctf-link.c (ctf_link_one_type): Do not warn for nonrepresentable
506 type link failure, but do warn for others.
507 * ctf-dump.c (ctf_dump_format_type): Likewise. Do not assume all
509 (ctf_dump_member): Likewise.
510 (ctf_dump_type): Likewise.
511 (ctf_dump_header_strfield): Do not assume all errors to be ENOMEM.
512 (ctf_dump_header_sectfield): Do not assume all errors to be ENOMEM.
513 (ctf_dump_header): Likewise.
514 (ctf_dump_label): likewise.
515 (ctf_dump_objts): likewise.
516 (ctf_dump_funcs): likewise.
517 (ctf_dump_var): likewise.
518 (ctf_dump_str): Likewise.
520 2019-09-30 Nick Alcock <nick.alcock@oracle.com>
522 * configure.ac (AC_DISABLE_SHARED): New, like opcodes/.
524 (AM_INSTALL_LIBBFD): Likewise.
525 (dlopen): Note why this is necessary in a comment.
526 (SHARED_LIBADD): Initialize for possibly-PIC libiberty: derived from
528 (SHARED_LDFLAGS): Likewise.
529 (BFD_LIBADD): Likewise, for libbfd.
530 (BFD_DEPENDENCIES): Likewise.
531 (VERSION_FLAGS): Initialize, using a version script if ld supports
532 one, or libtool -export-symbols-regex otherwise.
533 (AC_CONFIG_MACRO_DIR): Add ../BFD.
534 * Makefile.am (ACLOCAL_AMFLAGS): Likewise.
536 (AM_CPPFLAGS): Use $(srcdir), not $(top_srcdir).
537 (noinst_LIBRARIES): Replace with...
538 [INSTALL_LIBBFD] (lib_LTLIBRARIES): This, or...
539 [!INSTALL_LIBBFD] (noinst_LTLIBRARIES): ... this, mentioning new
540 libctf-nobfd.la as well.
541 [INSTALL_LIBCTF] (include_HEADERS): Add the CTF headers.
542 [!INSTALL_LIBCTF] (include_HEADERS): New, empty.
543 (libctf_a_SOURCES): Rename to...
544 (libctf_nobfd_la_SOURCES): ... this, all of libctf other than
546 (libctf_la_SOURCES): Now derived from libctf_nobfd_la_SOURCES,
547 with ctf-open-bfd.c added.
548 (libctf_nobfd_la_LIBADD): New, using @SHARED_LIBADD@.
549 (libctf_la_LIBADD): New, using @BFD_LIBADD@ as well.
550 (libctf_la_DEPENDENCIES): New, using @BFD_DEPENDENCIES@.
551 * Makefile.am [INSTALL_LIBCTF]: Use it.
552 * aclocal.m4: Add ../bfd/acinclude.m4, ../config/acx.m4, and the
554 * libctf.ver: New, everything is version LIBCTF_1.0 currently (even
555 the unstable components).
556 * Makefile.in: Regenerated.
557 * config.h.in: Likewise.
558 * configure: Likewise.
560 2019-07-30 Nick Alcock <nick.alcock@oracle.com>
562 * configure.ac (INSTALL_LIBCTF): New, controlled by
563 --enable-install-libctf.
564 [INSTALL_LIBCTF] (lib_LIBRARIES): Add libctf.a.
565 * Makefile.in: Regenerated.
566 * configure: Regenerated.
568 2019-07-30 Nick Alcock <nick.alcock@oracle.com>
570 * ctf-archive.c (ctf_arc_close): Call ctfi_bfd_close if set.
571 * ctf-open-bfd.c (ctf_bfdclose): Fix comment.
573 2019-07-30 Nick Alcock <nick.alcock@oracle.com>
575 * ctf-open-bfd.c (ctf_fdopen): Call bfd_set_cacheable.
577 2019-07-13 Nick Alcock <nick.alcock@oracle.com>
579 * ctf-impl.h (includes): Include <sys/param.h> here.
581 2019-07-30 Nick Alcock <nick.alcock@oracle.com>
583 * ctf-open.c (flip_lbls): Eschew for-loop initial declarations.
584 (flip_objts): Likewise.
585 (flip_vars): Likewise.
586 (flip_types): Likewise.
588 2019-07-30 Nick Alcock <nick.alcock@oracle.com>
590 * ctf-hash.c (ctf_hashtab_insert): Pass in the key and value
591 freeing functions: if set, free the key and value if the slot
592 already exists. Always reassign the key.
593 (ctf_dynhash_insert): Adjust call appropriately.
594 (ctf_hash_insert_type): Likewise.
596 2019-08-03 Nick Alcock <nick.alcock@oracle.com>
598 * ctf-create.c (ctf_add_type): Look up and use the forwarded-to
599 type kind. Allow forwards to unify with pre-existing structs/
602 2019-07-30 Nick Alcock <nick.alcock@oracle.com>
604 * ctf-impl.h (ctf_file_t) <ctf_link_cu_mappping>: New.
605 <ctf_link_memb_name_changer>: Likewise.
606 <ctf_link_memb_name_changer_arg>: Likewise.
607 * ctf-create.c (ctf_update): Update accordingly.
608 * ctf-open.c (ctf_file_close): Likewise.
609 * ctf-link.c (ctf_create_per_cu): Apply the cu mapping.
610 (ctf_link_add_cu_mapping): New.
611 (ctf_link_set_memb_name_changer): Likewise.
612 (ctf_change_parent_name): New.
613 (ctf_name_list_accum_cb_arg_t) <dynames>: New, storage for names
614 allocated by the caller's ctf_link_memb_name_changer.
615 <ndynames>: Likewise.
616 (ctf_accumulate_archive_names): Call the ctf_link_memb_name_changer.
617 (ctf_link_write): Likewise (for _CTF_SECTION only): also call
618 ctf_change_parent_name. Free any resulting names.
620 2019-07-13 Nick Alcock <nick.alcock@oracle.com>
622 * ctf-link.c (ctf_create_per_cu): New, refactored out of...
623 (ctf_link_one_type): ... here, with parent-name setting added.
624 (check_variable): New.
625 (ctf_link_one_variable): Likewise.
626 (ctf_link_one_input_archive_member): Call it.
627 * ctf-error.c (_ctf_errlist): Updated with new errors.
629 2019-07-13 Nick Alcock <nick.alcock@oracle.com>
631 * ctf-impl.h (ctf_file_t): New field ctf_link_type_mapping.
632 (struct ctf_link_type_mapping_key): New.
633 (ctf_hash_type_mapping_key): Likewise.
634 (ctf_hash_eq_type_mapping_key): Likewise.
635 (ctf_add_type_mapping): Likewise.
636 (ctf_type_mapping): Likewise.
637 (ctf_dynhash_empty): Likewise.
638 * ctf-open.c (ctf_file_close): Update accordingly.
639 * ctf-create.c (ctf_update): Likewise.
640 (ctf_add_type): Populate the mapping.
641 * ctf-hash.c (ctf_hash_type_mapping_key): Hash a type mapping key.
642 (ctf_hash_eq_type_mapping_key): Check the key for equality.
643 (ctf_dynhash_insert): Fix comment typo.
644 (ctf_dynhash_empty): New.
645 * ctf-link.c (ctf_add_type_mapping): New.
646 (ctf_type_mapping): Likewise.
647 (empty_link_type_mapping): New.
648 (ctf_link_one_input_archive): Call it.
650 2019-07-13 Nick Alcock <nick.alcock@oracle.com>
652 * ctf-link.c: New file, linking of the string and type sections.
653 * Makefile.am (libctf_a_SOURCES): Add it.
654 * Makefile.in: Regenerate.
656 * ctf-impl.h (ctf_file_t): New fields ctf_link_inputs,
658 * ctf-create.c (ctf_update): Update accordingly.
659 * ctf-open.c (ctf_file_close): Likewise.
660 * ctf-error.c (_ctf_errlist): Updated with new errors.
662 2019-07-13 Nick Alcock <nick.alcock@oracle.com>
664 * ctf-dump.c (ctf_dump_funcs): Check the right error value.
666 2019-07-13 Nick Alcock <nick.alcock@oracle.com>
668 * ctf-dump.c (ctf_dump): Use ctf_type_iter_all to dump types, not
670 (ctf_dump_type): Pass down the flag from ctf_type_iter_all.
671 (ctf_dump_format_type): Add non-root-type { } notation.
672 Add root flag to prototype.
673 (ctf_dump_label): Adjust accordingly.
674 (ctf_dump_objts): Likewise.
675 (ctf_dump_var): Likewise.
677 2019-07-13 Nick Alcock <nick.alcock@oracle.com>
679 * ctf-create.c (ctf_compress_write): Fix double-free.
681 2019-07-13 Nick Alcock <nick.alcock@oracle.com>
683 * ctf-archive.c (ctf_arc_write): Split off, and reimplement in terms
685 (ctf_arc_write_fd): ... this new function.
686 * ctf-create.c (ctf_write_mem): New.
688 2019-07-13 Nick Alcock <nick.alcock@oracle.com>
690 * ctf-impl.h (ctf_str_atom_t) <csa_offset>: New field.
691 (ctf_file_t) <ctf_syn_ext_strtab>: Likewise.
692 (ctf_str_add_ref): Name the last arg.
693 (ctf_str_add_external) New.
694 (ctf_str_add_strraw_explicit): Likewise.
695 (ctf_simple_open_internal): Likewise.
696 (ctf_bufopen_internal): Likewise.
698 * ctf-string.c (ctf_strraw_explicit): Split from...
699 (ctf_strraw): ... here, with new support for ctf_syn_ext_strtab.
700 (ctf_str_add_ref_internal): Return the atom, not the
702 (ctf_str_add): Adjust accordingly.
703 (ctf_str_add_ref): Likewise. Move up in the file.
704 (ctf_str_add_external): New: update the csa_offset.
705 (ctf_str_count_strtab): Only account for strings with no csa_offset
706 in the internal strtab length.
707 (ctf_str_write_strtab): If the csa_offset is set, update the
708 string's refs without writing the string out, and update the
709 ctf_syn_ext_strtab. Make OOM handling less ugly.
710 * ctf-create.c (struct ctf_sort_var_arg_cb): New.
711 (ctf_update): Handle failure to populate the strtab. Pass in the
712 new ctf_sort_var arg. Adjust for ctf_syn_ext_strtab addition.
713 Call ctf_simple_open_internal, not ctf_simple_open.
714 (ctf_sort_var): Call ctf_strraw_explicit rather than looking up
716 * ctf-hash.c (ctf_hash_insert_type): Likewise (but using
717 ctf_strraw). Adjust to diagnose ECTF_STRTAB nonetheless.
718 * ctf-open.c (init_types): No longer filter out ECTF_STRTAB.
719 (ctf_file_close): Destroy the ctf_syn_ext_strtab.
720 (ctf_simple_open): Rename to, and reimplement as a wrapper around...
721 (ctf_simple_open_internal): ... this new function, which calls
722 ctf_bufopen_internal.
723 (ctf_bufopen): Rename to, and reimplement as a wrapper around...
724 (ctf_bufopen_internal): ... this new function, which sets
727 2019-07-13 Nick Alcock <nick.alcock@oracle.com>
729 * ctf_types.c (ctf_type_iter_all): New.
731 2019-07-13 Nick Alcock <nick.alcock@oracle.com>
733 * ctf-open.c (init_symtab): Check for overflow against the right
735 (upgrade_header): Set cth_objtidxoff, cth_funcidxoff to zero-length.
736 (upgrade_types_v1): Note that these sections are not checked.
737 (flip_header): Endian-swap the header fields.
738 (flip_ctf): Endian-swap the sections.
739 (flip_objts): Update comment.
740 (ctf_bufopen): Check header offsets and alignment for validity.
742 2019-07-13 Nick Alcock <nick.alcock@oracle.com>
744 * ctf-open-bfd.c: Add <assert.h>.
745 (ctf_bfdopen_ctfsect): Open string and symbol tables using
746 techniques borrowed from bfd_elf_sym_name.
747 (ctf_new_archive_internal): Improve comment.
748 * ctf-archive.c (ctf_arc_close): Do not free the ctfi_strsect.
749 * ctf-open.c (ctf_bufopen): Allow opening with a string section but
750 no symbol section, but not vice versa.
752 2019-07-08 Nick Alcock <nick.alcock@oracle.com>
754 * ctf-impl.h (ctf_file_t): New field ctf_openflags.
755 * ctf-open.c (ctf_bufopen): Set it. No longer dump header offsets.
756 * ctf-dump.c (dump_header): New function, dump the CTF header.
758 (ctf_dump_header_strfield): New function.
759 (ctf_dump_header_sectfield): Likewise.
761 2019-07-06 Nick Alcock <nick.alcock@oracle.com>
763 * ctf-impl.h (ctf_file_t): New fields ctf_header, ctf_dynbase,
764 ctf_cuname, ctf_dyncuname: ctf_base and ctf_buf are no longer const.
765 * ctf-open.c (ctf_set_base): Preserve the gap between ctf_buf and
766 ctf_base: do not assume that it is always sizeof (ctf_header_t).
767 Print out ctf_cuname: only print out ctf_parname if set.
768 (ctf_free_base): Removed, ctf_base is no longer freed: free
770 (ctf_set_version): Fix spacing.
771 (upgrade_header): New, in-place header upgrading.
772 (upgrade_types): Rename to...
773 (upgrade_types_v1): ... this. Free ctf_dynbase, not ctf_base. No
774 longer track old and new headers separately. No longer allow for
775 header sizes explicitly: squeeze the headers out on upgrade (they
776 are preserved in fp->ctf_header). Set ctf_dynbase, ctf_base and
777 ctf_buf explicitly. Use ctf_free, not ctf_free_base.
778 (upgrade_types): New, also handle ctf_parmax updating.
779 (flip_header): Flip ctf_cuname.
780 (flip_types): Flip BUF explicitly rather than deriving BUF from
782 (ctf_bufopen): Store the header in fp->ctf_header. Correct minimum
783 required alignment of objtoff and funcoff. No longer store it in
784 the ctf_buf unless that buf is derived unmodified from the input.
785 Set ctf_dynbase where ctf_base is dynamically allocated. Drop locals
786 that duplicate fields in ctf_file: move allocation of ctf_file
787 further up instead. Call upgrade_header as needed. Move
788 version-specific ctf_parmax initialization into upgrade_types. More
789 concise error handling.
790 (ctf_file_close): No longer test for null pointers before freeing.
791 Free ctf_dyncuname, ctf_dynbase, and ctf_header. Do not call
794 (ctf_cuname_set): New.
795 * ctf-create.c (ctf_update): Populate ctf_cuname.
796 (ctf_gzwrite): Write out the header explicitly. Remove obsolescent
798 (ctf_write): Likewise.
799 (ctf_compress_write): Get the header from ctf_header, not ctf_base.
800 Fix the compression length: fp->ctf_size never counted the CTF
801 header. Simplify the compress call accordingly.
803 2019-07-11 Hans-Peter Nilsson <hp@bitrange.com>
805 * ctf-endian.h: Don't assume htole64 and le64toh are always
806 present if HAVE_ENDIAN_H; also check if htole64 is defined.
807 [!WORDS_BIGENDIAN] (htole64, le64toh): Define as identity,
808 not bswap_identity_64.
810 2019-09-18 Alan Modra <amodra@gmail.com>
812 * ctf-open-bfd.c: Update throughout for bfd section macro changes.
814 2019-09-09 Phil Blundell <pb@pbcl.net>
816 binutils 2.33 branch created.
818 2019-07-18 Nick Alcock <nick.alcock@oracle.com>
820 * ctf-types.c (ctf_type_aname_raw): New.
821 (ctf_func_type_info): Likewise.
822 (ctf_func_type_args): Likewise.
823 * ctf-error.c (_ctf_errlist): Fix description.
824 * ctf-lookup.c: Fix file description.
826 2019-06-28 Nick Alcock <nick.alcock@oracle.com>
828 * ctf-create.c (ctf_create): Fix off-by-one error.
830 2019-06-28 Nick Alcock <nick.alcock@oracle.com>
832 * ctf-impl.h: (struct ctf_strs_writable): New, non-const version of
834 (struct ctf_dtdef): Note that dtd_data.ctt_name is unpopulated.
835 (struct ctf_str_atom): New, disambiguated single string.
836 (struct ctf_str_atom_ref): New, points to some other location that
837 references this string's offset.
838 (struct ctf_file): New members ctf_str_atoms and ctf_str_num_refs.
839 Remove member ctf_dtvstrlen: we no longer track the total strlen
841 (ctf_str_create_atoms): Declare new function in ctf-string.c.
842 (ctf_str_free_atoms): Likewise.
843 (ctf_str_add): Likewise.
844 (ctf_str_add_ref): Likewise.
845 (ctf_str_rollback): Likewise.
846 (ctf_str_purge_refs): Likewise.
847 (ctf_str_write_strtab): Likewise.
848 (ctf_realloc): Declare new function in ctf-util.c.
850 * ctf-open.c (ctf_bufopen): Create the atoms table.
851 (ctf_file_close): Destroy it.
852 * ctf-create.c (ctf_update): Copy-and-free it on update. No longer
853 special-case the position of the parname string. Construct the
854 strtab by calling ctf_str_add_ref and ctf_str_write_strtab after the
855 rest of each buffer element is constructed, not via open-coding:
856 realloc the CTF buffer and append the strtab to it. No longer
857 maintain ctf_dtvstrlen. Sort the variable entry table later, after
859 (ctf_copy_membnames): Remove: integrated into ctf_copy_{s,l,e}members.
860 (ctf_copy_smembers): Drop the string offset: call ctf_str_add_ref
861 after buffer element construction instead.
862 (ctf_copy_lmembers): Likewise.
863 (ctf_copy_emembers): Likewise.
864 (ctf_create): No longer maintain the ctf_dtvstrlen.
865 (ctf_dtd_delete): Likewise.
866 (ctf_dvd_delete): Likewise.
867 (ctf_add_generic): Likewise.
868 (ctf_add_enumerator): Likewise.
869 (ctf_add_member_offset): Likewise.
870 (ctf_add_variable): Likewise.
872 * ctf-util.c (ctf_realloc): New, wrapper around realloc that aborts
873 if there are active ctf_str_num_refs.
874 (ctf_strraw): Move to ctf-string.c.
875 (ctf_strptr): Likewise.
876 * ctf-string.c: New file, strtab manipulation.
878 * Makefile.am (libctf_a_SOURCES): Add it.
879 * Makefile.in: Regenerate.
881 2019-06-28 Nick Alcock <nick.alcock@oracle.com>
883 * ctf-impl.h (ctf_hash_iter_f): New.
884 (ctf_dynhash_iter): New declaration.
885 (ctf_dynhash_iter_remove): New declaration.
886 * ctf-hash.c (ctf_dynhash_iter): Define.
887 (ctf_dynhash_iter_remove): Likewise.
888 (ctf_hashtab_traverse): New.
889 (ctf_hashtab_traverse_remove): Likewise.
890 (struct ctf_traverse_cb_arg): Likewise.
891 (struct ctf_traverse_remove_cb_arg): Likewise.
893 2019-06-28 Nick Alcock <nick.alcock@oracle.com>
895 * ctf-hash.c (ctf_dynhash_remove): Call with a mocked-up element.
897 2019-06-28 Nick Alcock <nick.alcock@oracle.com>
899 * ctf-dump.c (ctf_dump_format_type): Prefix hex strings with 0x.
900 (ctf_dump_funcs): Likewise.
902 2019-06-19 Nick Alcock <nick.alcock@oracle.com>
904 * ctf-open-bfd.c: Add swap.h and ctf-endian.h.
905 (ctf_fdopen): Check for endian-swapped raw CTF magic, and
906 little-endian CTF archive magic. Do not check the CTF version:
907 ctf_simple_open does that in endian-safe ways. Do not dereference
908 null pointers on open failure.
910 2019-06-19 Nick Alcock <nick.alcock@oracle.com>
912 * ctf-open.c (get_vbytes_common): Return the new slice size.
913 (ctf_bufopen): Flip the endianness of the CTF-section header copy.
914 Remember to copy in the CTF data when opening an uncompressed
915 foreign-endian CTF file. Prune useless variable manipulation.
917 2019-06-19 Nick Alcock <nick.alcock@oracle.com>
919 * ctf-open.c (ctf_types): Fail when unidentified type kinds are
922 2019-06-19 Nick Alcock <nick.alcock@oracle.com>
924 * ctf-open.c (ctf_bufopen): Dump header offsets into the debugging
927 2019-06-19 Nick Alcock <nick.alcock@oracle.com>
929 * ctf-subr.c (_PAGESIZE): Remove.
930 (ctf_data_alloc): Likewise.
931 (ctf_data_free): Likewise.
932 (ctf_data_protect): Likewise.
933 * ctf-impl.h: Remove declarations.
934 * ctf-create.c (ctf_update): No longer call ctf_data_protect: use
935 ctf_free, not ctf_data_free.
936 (ctf_compress_write): Use ctf_data_alloc, not ctf_alloc. Free
937 the buffer again on compression error.
938 * ctf-open.c (ctf_set_base): No longer track the size: call
939 ctf_free, not ctf_data_free.
940 (upgrade_types): Likewise. Call ctf_alloc, not ctf_data_alloc.
941 (ctf_bufopen): Likewise. No longer call ctf_data_protect.
943 2019-06-19 Nick Alcock <nick.alcock@oracle.com>
945 * ctf-create.c (ctf_dtd_insert): Pass on error returns from
947 (ctf_dvd_insert): Likewise.
948 (ctf_add_generic): Likewise.
949 (ctf_add_variable): Likewise.
950 * ctf-impl.h: Adjust declarations.
952 2019-06-14 Alan Modra <amodra@gmail.com>
954 * configure: Regenerate.
956 2019-06-06 Nick Alcock <nick.alcock@oracle.com>
958 * ctf-decls.h: Include <libiberty.h>.
959 * ctf-lookup.c (ctf_lookup_by_name): Call xstrndup(), not strndup().
961 2019-06-06 Nick Alcock <nick.alcock@oracle.com>
963 * ctf-dump.c (ctf_dump_format_type): Cast size_t's used in printf()s.
964 (ctf_dump_objts): Likewise.
965 (ctf_dump_funcs): Likewise.
966 (ctf_dump_member): Likewise.
967 (ctf_dump_str): Likewise.
969 2019-06-06 Nick Alcock <nick.alcock@oracle.com>
971 * ctf-archive.c (arc_mmap_header): Mark fd as potentially unused.
972 * ctf-subr.c (ctf_data_protect): Mark both args as potentially unused.
974 2019-06-05 Nick Alcock <nick.alcock@oracle.com>
976 * ctf-archive.c (ctf_arc_write): Eschew %zi format specifier.
977 (ctf_arc_open_by_offset): Likewise.
978 * ctf-create.c (ctf_add_type): Likewise.
980 2019-06-04 Tom Tromey <tromey@adacore.com>
982 * ctf-create.c (ctf_add_encoded, ctf_add_slice)
983 (ctf_add_member_offset): Use CHAR_BIT, not NBBY.
985 2019-06-04 Nick Alcock <nick.alcock@oracle.com>
987 * configure.ac: Check for O_CLOEXEC.
988 * ctf-decls.h (O_CLOEXEC): Define (to 0), if need be.
989 * config.h.in: Regenerate.
990 * configure: Likewise.
992 2019-06-04 Nick Alcock <nick.alcock@oracle.com>
994 * qsort_r.c: Rename to...
995 * ctf-qsort_r.c: ... this.
996 (_quicksort): Define to ctf_qsort_r.
997 * ctf-decls.h (qsort_r): Remove.
999 (struct ctf_qsort_arg): New, transport the real ARG and COMPAR.
1000 (ctf_qsort_compar_thunk): Rearrange the arguments to COMPAR.
1001 * Makefile.am (libctf_a_LIBADD): Remove.
1002 (libctf_a_SOURCES): New, add ctf-qsort_r.c.
1003 * ctf-archive.c (ctf_arc_write): Call ctf_qsort_r, not qsort_r.
1004 * ctf-create.c (ctf_update): Likewise.
1005 * configure.ac: Check for BSD versus GNU qsort_r signature.
1006 * Makefile.in: Regenerate.
1007 * config.h.in: Likewise.
1008 * configure: Likewise.
1010 2019-06-03 Nick Alcock <nick.alcock@oracle.com>
1012 * ctf-dump.c (ctf_dump_funcs): Free in the right place.
1014 2019-05-29 Nick Alcock <nick.alcock@oracle.com>
1016 * Makefile.am (ZLIB): New.
1017 (ZLIBINC): Likewise.
1018 (AM_CFLAGS): Use them.
1019 (libctf_a_LIBADD): New, for LIBOBJS.
1020 * configure.ac: Check for zlib, endian.h, and qsort_r.
1021 * ctf-endian.h: New, providing htole64 and le64toh.
1022 * swap.h: Code style fixes.
1023 (bswap_identity_64): New.
1024 * qsort_r.c: New, from gnulib (with one added #include).
1025 * ctf-decls.h: New, providing a conditional qsort_r declaration,
1026 and unconditional definitions of MIN and MAX.
1027 * ctf-impl.h: Use it. Do not use <sys/errno.h>.
1028 (ctf_set_errno): Now returns unsigned long.
1029 * ctf-util.c (ctf_set_errno): Adjust here too.
1030 * ctf-archive.c: Use ctf-endian.h.
1031 (ctf_arc_open_by_offset): Use memset, not bzero. Drop cts_type,
1032 cts_flags and cts_offset.
1033 (ctf_arc_write): Drop debugging dependent on the size of off_t.
1034 * ctf-create.c: Provide a definition of roundup if not defined.
1035 (ctf_create): Drop cts_type, cts_flags and cts_offset.
1036 (ctf_add_reftype): Do not check if type IDs are below zero.
1037 (ctf_add_slice): Likewise.
1038 (ctf_add_typedef): Likewise.
1039 (ctf_add_member_offset): Cast error-returning ssize_t's to size_t
1040 when known error-free. Drop CTF_ERR usage for functions returning
1042 (ctf_add_member_encoded): Drop CTF_ERR usage for functions returning
1044 (ctf_add_variable): Likewise.
1045 (enumcmp): Likewise.
1046 (enumadd): Likewise.
1047 (membcmp): Likewise.
1048 (ctf_add_type): Likewise. Cast error-returning ssize_t's to size_t
1049 when known error-free.
1050 * ctf-dump.c (ctf_is_slice): Drop CTF_ERR usage for functions
1051 returning int: use CTF_ERR for functions returning ctf_type_id.
1052 (ctf_dump_label): Likewise.
1053 (ctf_dump_objts): Likewise.
1054 * ctf-labels.c (ctf_label_topmost): Likewise.
1055 (ctf_label_iter): Likewise.
1056 (ctf_label_info): Likewise.
1057 * ctf-lookup.c (ctf_func_args): Likewise.
1058 * ctf-open.c (upgrade_types): Cast to size_t where appropriate.
1059 (ctf_bufopen): Likewise. Use zlib types as needed.
1060 * ctf-types.c (ctf_member_iter): Drop CTF_ERR usage for functions
1062 (ctf_enum_iter): Likewise.
1063 (ctf_type_size): Likewise.
1064 (ctf_type_align): Likewise. Cast to size_t where appropriate.
1065 (ctf_type_kind_unsliced): Likewise.
1066 (ctf_type_kind): Likewise.
1067 (ctf_type_encoding): Likewise.
1068 (ctf_member_info): Likewise.
1069 (ctf_array_info): Likewise.
1070 (ctf_enum_value): Likewise.
1071 (ctf_type_rvisit): Likewise.
1072 * ctf-open-bfd.c (ctf_bfdopen): Drop cts_type, cts_flags and
1074 (ctf_simple_open): Likewise.
1075 (ctf_bfdopen_ctfsect): Likewise. Set cts_size properly.
1076 * Makefile.in: Regenerate.
1077 * aclocal.m4: Likewise.
1078 * config.h: Likewise.
1079 * configure: Likewise.
1081 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
1083 * configure.in: Check for bfd_section_from_elf_index.
1084 * configure: Regenerate.
1085 * config.h.in [HAVE_BFD_ELF]: Likewise.
1086 * libctf/ctf_open_bfd (ctf_bfdopen_ctfsect): Use it.
1087 abfd is potentially unused now.
1089 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
1092 * Makefile.in: Regenerated.
1093 * config.h.in: Likewise.
1094 * aclocal.m4: Likewise.
1095 * configure: Likewise.
1097 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
1101 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
1103 * ctf-labels.c: New.
1105 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
1107 * ctf-impl.h (_libctf_version): New declaration.
1108 * ctf-subr.c (_libctf_version): Define it.
1111 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
1113 * ctf-create.c (enumcmp): New.
1114 (enumadd): Likewise.
1115 (membcmp): Likewise.
1116 (membadd): Likewise.
1117 (ctf_add_type): Likewise.
1119 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
1121 * ctf-lookup.c (isqualifier): New.
1122 (ctf_lookup_by_name): Likewise.
1123 (struct ctf_lookup_var_key): Likewise.
1124 (ctf_lookup_var): Likewise.
1125 (ctf_lookup_variable): Likewise.
1126 (ctf_lookup_symbol_name): Likewise.
1127 (ctf_lookup_by_symbol): Likewise.
1128 (ctf_func_info): Likewise.
1129 (ctf_func_args): Likewise.
1131 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
1133 * ctf-decl.c: New file.
1134 * ctf-types.c: Likewise.
1135 * ctf-impl.h: New declarations.
1137 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
1139 * ctf-open-bfd.c: New file.
1140 * ctf-open.c (ctf_close): New.
1141 * ctf-impl.h: Include bfd.h.
1142 (ctf_file): New members ctf_data_mmapped, ctf_data_mmapped_len.
1143 (ctf_archive_internal): New members ctfi_abfd, ctfi_data,
1145 (ctf_bfdopen_ctfsect): New declaration.
1146 (_CTF_SECTION): likewise.
1148 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
1150 * ctf-archive.c: New.
1151 * ctf-impl.h (ctf_archive_internal): New type.
1152 (ctf_arc_open_internal): New declaration.
1153 (ctf_arc_bufopen): Likewise.
1154 (ctf_arc_close_internal): Likewise.
1156 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
1158 * ctf-open.c: New file.
1161 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
1163 * ctf-create.c: New file.
1164 * ctf-lookup.c: New file.
1166 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
1168 * ctf-impl.h: New definitions and declarations for type creation
1171 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
1173 * ctf-hash.c: New file.
1174 * ctf-impl.h: New declarations.
1176 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
1178 * ctf-error.c: New file.
1180 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
1182 * ctf-util.c: New file.
1184 * ctf-impl.h: Include it, and add declarations.
1186 2019-05-28 Nick Alcock <nick.alcock@oracle.com>
1188 * ctf-impl.h: New file.
1189 * ctf-subr.c: New file.
1196 version-control: never