1 2025-01-19 Nick Clifton <nickc@redhat.com>
5 2024-07-20 Nick Clifton <nickc@redhat.com>
9 2024-01-15 Nick Clifton <nickc@redhat.com>
13 2023-11-15 Arsen Arsenović <arsen@aarsen.me>
15 * Makefile.am (SUBDIRS): Define to empty to suppress a check in
17 * Makefile.in: Regenerate.
18 * configure.ac (CTF_LIBADD): Use LTLIBINTL rather than LIBINTL.
19 * aclocal.m4: Regenerate.
20 * configure: Regenerate.
22 2023-07-03 Nick Clifton <nickc@redhat.com>
26 2022-12-31 Nick Clifton <nickc@redhat.com>
28 * 2.40 branch created.
30 2022-07-08 Nick Clifton <nickc@redhat.com>
32 * 2.39 branch created.
34 2022-01-22 Nick Clifton <nickc@redhat.com>
36 * 2.38 release branch created.
38 2021-11-08 Nick Alcock <nick.alcock@oracle.com>
40 * doc/ctf-spec.texi: New file.
41 * configure.ac (MAKEINFO): Add.
42 (BUILD_INFO): Likewise.
43 (AC_CONFIG_FILES) [doc/Makefile]: Add.
44 * Makefile.am [BUILD_INFO] (SUBDIRS): Add doc/.
45 * doc/Makefile.am: New file.
46 * doc/Makefile.in: Likewise.
47 * configure: Regenerated.
48 * Makefile.in: Likewise.
50 2021-10-25 Nick Alcock <nick.alcock@oracle.com>
52 * ctf-types.c (ctf_type_rvisit): Handle nonrepresentable types.
54 2021-10-25 Nick Alcock <nick.alcock@oracle.com>
56 * ctf-dump.c (ctf_dump_type): Do not abort on error.
58 2021-09-27 Nick Alcock <nick.alcock@oracle.com>
60 * ctf-lookup.c (ctf_lookup_by_name_internal): Fix pptrtab bounds.
61 * testsuite/libctf-writable/pptrtab-writable-page-deep-lookup.*:
64 2021-09-27 Nick Alcock <nick.alcock@oracle.com>
66 * testsuite/libctf-lookup/enum-symbol.c: Remove unused label.
67 * testsuite/libctf-lookup/conflicting-type-syms.c: Remove unused
69 * testsuite/libctf-regression/pptrtab.c: Likewise.
70 * testsuite/libctf-regression/type-add-unnamed-struct.c: Likewise.
71 * testsuite/libctf-writable/pptrtab.c: Likewise.
72 * testsuite/libctf-writable/reserialize-strtab-corruption.c:
74 * testsuite/libctf-regression/nonstatic-var-section-ld-r.c: Fix
76 * testsuite/libctf-regression/nonstatic-var-section-ld.c:
78 * testsuite/libctf-regression/nonstatic-var-section-ld.lk: Adjust.
79 * testsuite/libctf-writable/symtypetab-nonlinker-writeout.c: Fix
82 2021-09-27 Nick Alcock <nick.alcock@oracle.com>
84 * ctf-open.c (ctf_bufopen_internal): Don't complain about corrupt
85 function index symtypetab sections if this is an old-format
86 function symtypetab section (which should be ignored in any case).
89 2021-09-27 Nick Alcock <nick.alcock@oracle.com>
91 * configure: Regenerate.
92 * Makefile.in: Regenerate.
94 2021-09-27 Nick Alcock <nick.alcock@oracle.com>
97 * configure.ac (VERSION_FLAGS): Replace with...
98 (ac_cv_libctf_version_script): ... this multiple test.
99 (VERSION_FLAGS_NOBFD): Substitute this too.
100 * Makefile.am (libctf_nobfd_la_LDFLAGS): Use it. Split out...
101 (libctf_ldflags_nover): ... non-versioning flags here.
102 (libctf_la_LDFLAGS): Use it.
103 * libctf.ver: Give every symbol not in libctf-nobfd a comment on
104 the same line noting as much.
106 2021-09-27 Nick Alcock <nick.alcock@oracle.com>
109 * Makefile.am (libctf_la_LIBADD): Link against libiberty
110 before pulling in libbfd.la or pulling in libctf-nobfd.la.
111 * Makefile.in: Regenerate.
113 2021-07-03 Nick Clifton <nickc@redhat.com>
115 * 2.37 release branch created.
117 2021-05-09 Alan Modra <amodra@gmail.com>
119 * ctf-impl.h (ctf_dynset_eq_string): Don't declare.
120 * ctf-hash.c (ctf_dynset_eq_string): Delete function.
121 * ctf-dedup.c (make_set_element): Use htab_eq_string.
122 (ctf_dedup_atoms_init, ADD_CITER, ctf_dedup_init): Likewise.
123 (ctf_dedup_conflictify_unshared): Likewise.
124 (ctf_dedup_walk_output_mapping): Likewise.
126 2021-05-06 Nick Alcock <nick.alcock@oracle.com>
128 * testsuite/lib/ctf-lib.exp: Use -gctf, not -gt.
129 * testsuite/libctf-regression/nonstatic-var-section-ld-r.lk:
130 Hidden symbols now get into the symtypetab anyway.
132 2021-05-06 Nick Alcock <nick.alcock@oracle.com>
134 * ctf-open.c (init_types): Unknown types may have names.
135 * ctf-types.c (ctf_type_resolve): CTF_K_UNKNOWN is as
136 non-representable as type ID 0.
137 (ctf_type_aname): Print unknown types.
138 * ctf-dedup.c (ctf_dedup_hash_type): Do not early-exit for
139 CTF_K_UNKNOWN types: they have real hash values now.
140 (ctf_dedup_rwalk_one_output_mapping): Treat CTF_K_UNKNOWN types
141 like other types with no referents: call the callback and do not
143 (ctf_dedup_emit_type): Emit via...
144 * ctf-create.c (ctf_add_unknown): ... this new function.
145 * libctf.ver (LIBCTF_1.2): Add it.
147 2021-03-25 Nick Alcock <nick.alcock@oracle.com>
149 * configure.ac: Check for dlsym, not dlopen.
150 * configure: Regenerate.
152 2021-03-25 Nick Alcock <nick.alcock@oracle.com>
154 * testsuite/libctf-writable/symtypetab-nonlinker-writeout.c: Don't
157 2021-03-25 Nick Alcock <nick.alcock@oracle.com>
160 * ctf-lookup.c (isqualifier): Don't dereference out-of-bounds
163 2021-03-25 Nick Alcock <nick.alcock@oracle.com>
165 * ctf-open-bfd.c (ctf_bfdopen_ctfsect): Initialize debugging.
167 2021-03-25 Nick Alcock <nick.alcock@oracle.com>
170 * ctf-serialize.c (ctf_emit_type_sect): Allow for a NULL vlen in
171 CTF_K_FUNCTION types.
173 2021-03-25 Nick Alcock <nick.alcock@oracle.com>
175 * ctf-dump.c (ctf_dump_format_type): Don't emit size or alignment
178 2021-03-21 Alan Modra <amodra@gmail.com>
180 * ctf-impl.h: Include string.h.
182 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
184 * ctf-types.c (ctf_type_encoding): Support, after a fashion, for enums.
185 * ctf-dump.c (ctf_dump_format_type): Do not report enums' degenerate
188 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
190 * ctf-dedup.c (ctf_dedup_rhash_type): Report errors on the input
192 * ctf-open.c (ctf_bufopen_internal): Report errors initializing
195 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
197 * ctf-impl.h (ctf_next_t) <ctn_tp>: New.
201 * ctf-types.c (ctf_struct_member): New.
202 (ctf_member_next): Use it, dropping separate large/small code paths.
203 (ctf_type_align): Likewise.
204 (ctf_member_info): Likewise.
205 (ctf_type_rvisit): Likewise.
207 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
209 * ctf-impl.h (ctf_dtdef_t) <dtu_members>: Remove.
211 (ctf_dmdef_t): Remove.
212 (struct ctf_next) <u.ctn_dmd>: Remove.
213 * ctf-create.c (INITIAL_VLEN): New, more-or-less arbitrary initial
215 (ctf_add_enum): Use it.
216 (ctf_dtd_delete): Do not free the (removed) dmd; remove string
217 refs from the vlen on struct deletion.
218 (ctf_add_struct_sized): Populate the vlen: do it by hand if
219 promoting forwards. Always populate the full-size
220 lsizehi/lsizelo members.
221 (ctf_add_union_sized): Likewise.
222 (ctf_add_member_offset): Set up the vlen rather than the dmd.
223 Expand it as needed, repointing string refs via
224 ctf_str_move_pending. Add the member names as pending strings.
225 Always populate the full-size lsizehi/lsizelo members.
226 (membadd): Remove, folding back into...
227 (ctf_add_type_internal): ... here, adding via an ordinary
228 ctf_add_struct_sized and _next iteration rather than doing
230 * ctf-serialize.c (ctf_copy_smembers): Remove this...
231 (ctf_copy_lmembers): ... and this...
232 (ctf_emit_type_sect): ... folding into here. Figure out if a
233 ctf_stype_t is needed here, not in ctf_add_*_sized.
234 (ctf_type_sect_size): Figure out the ctf_stype_t stuff the same
236 * ctf-types.c (ctf_member_next): Remove the dmd path and always
237 use the vlen. Force large-structure usage for dynamic types.
238 (ctf_type_align): Likewise.
239 (ctf_member_info): Likewise.
240 (ctf_type_rvisit): Likewise.
241 * testsuite/libctf-regression/type-add-unnamed-struct-ctf.c: Add a
242 self-referential type to this test.
243 * testsuite/libctf-regression/type-add-unnamed-struct.c: Adjusted
245 * testsuite/libctf-regression/type-add-unnamed-struct.lk: Likewise.
247 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
249 * ctf-impl.h (ctf_dtdef_t) <dtd_vlen_alloc>: New.
250 (ctf_str_move_pending): Declare.
251 * ctf-string.c (ctf_str_add_ref_internal): Fix error return.
252 (ctf_str_move_pending): New.
253 * ctf-create.c (ctf_grow_vlen): New.
254 (ctf_dtd_delete): Zero out the vlen_alloc after free. Free the
255 vlen later: iterate over it and free enum name refs first.
256 (ctf_add_generic): Populate dtd_vlen_alloc from vlen.
257 (ctf_add_enum): populate the vlen; do it by hand if promoting
259 (ctf_add_enumerator): Set up the vlen rather than the dmd. Expand
260 it as needed, repointing string refs via ctf_str_move_pending. Add
261 the enumerand names as pending strings.
262 * ctf-serialize.c (ctf_copy_emembers): Remove.
263 (ctf_emit_type_sect): Copy the vlen into place and ref the
265 * ctf-types.c (ctf_enum_next): The dynamic portion now uses
266 the same code as the non-dynamic.
267 (ctf_enum_name): Likewise.
268 (ctf_enum_value): Likewise.
269 * testsuite/libctf-lookup/enum-many-ctf.c: New test.
270 * testsuite/libctf-lookup/enum-many.lk: New test.
272 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
274 * ctf-hash.c (ctf_dynset_elements): New.
275 * ctf-impl.h (ctf_dynset_elements): Declare it.
276 (ctf_str_add_pending): Likewise.
277 (ctf_dict_t) <ctf_str_pending_ref>: New, set of refs that must be
278 added during serialization.
279 * ctf-string.c (ctf_str_create_atoms): Initialize it.
280 (CTF_STR_ADD_REF): New flag.
281 (CTF_STR_MAKE_PROVISIONAL): Likewise.
282 (CTF_STR_PENDING_REF): Likewise.
283 (ctf_str_add_ref_internal): Take a flags word rather than int
284 params. Populate, and clear out, ctf_str_pending_ref.
285 (ctf_str_add): Adjust accordingly.
286 (ctf_str_add_external): Likewise.
287 (ctf_str_add_pending): New.
288 (ctf_str_remove_ref): Also remove the potential ref if it is a
290 * ctf-serialize.c (ctf_serialize): Prohibit addition of strings
291 with ctf_str_add_ref before serialization. Ensure that the
292 ctf_str_pending_ref set is empty before strtab finalization.
293 (ctf_emit_type_sect): Add a ref to the ctt_name.
294 * ctf-create.c (ctf_add_generic): Add the ctt_name as a pending
296 * testsuite/libctf-writable/reserialize-strtab-corruption.*: New test.
298 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
300 * ctf-serialize.c (ctf_serialize): Preserve ctf_typemax across
303 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
305 * ctf-impl.h (ctf_dtdef_t) <dtd_u.dtu_argv>: Remove.
306 * ctf-create.c (ctf_dtd_delete): No longer free it.
307 (ctf_add_function): Use the dtd_vlen, not dtu_argv. Properly align.
308 * ctf-serialize.c (ctf_emit_type_sect): Just copy the dtd_vlen.
309 * ctf-types.c (ctf_func_type_info): Just use the vlen.
310 (ctf_func_type_args): Likewise.
312 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
314 * ctf-impl.h (ctf_dtdef_t) <dtd_u.dtu_arr>: Remove.
315 * ctf-create.c (ctf_add_array): Use the dtd_vlen, not dtu_arr.
316 (ctf_set_array): Likewise.
317 * ctf-serialize.c (ctf_emit_type_sect): Just copy the dtd_vlen.
318 * ctf-types.c (ctf_array_info): Just use the vlen.
320 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
322 * ctf-impl.h (ctf_dtdef_t) <dtd_u.dtu_enc>: Remove.
323 <dtd_u.dtu_slice>: Likewise.
325 * ctf-create.c (ctf_add_generic): Perhaps allocate it. All
327 (ctf_dtd_delete): Free it.
328 (ctf_add_slice): Use the dtd_vlen, not dtu_enc.
329 (ctf_add_encoded): Likewise. Assert that this must be an int or
331 * ctf-serialize.c (ctf_emit_type_sect): Just copy the dtd_vlen.
332 * ctf-dedup.c (ctf_dedup_rhash_type): Use the dtd_vlen, not
334 * ctf-types.c (ctf_type_reference): Likewise.
335 (ctf_type_encoding): Remove most dynamic-type-specific code: just
336 get the vlen from the right place. Report failure to look up the
337 underlying type's encoding.
339 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
341 * ctf-archive.c (ctf_archive_next): GNU style fix for do {} while.
342 * ctf-dedup.c (ctf_dedup_rhash_type): Likewise.
343 (ctf_dedup_rwalk_one_output_mapping): Likewise.
344 * ctf-dump.c (ctf_dump_format_type): Likewise.
345 * ctf-lookup.c (ctf_symbol_next): Likewise.
346 * swap.h (swap_thing): Likewise.
348 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
350 * ctf-serialize.c: General reshuffling, and...
351 (emit_symtypetab_state_t): New, migrated from
352 local variables in ctf_serialize.
353 (ctf_serialize): Split out most section sizing and
355 (ctf_symtypetab_sect_sizes): New (split out).
356 (ctf_emit_symtypetab_sects): Likewise.
357 (ctf_type_sect_size): Likewise.
358 (ctf_emit_type_sect): Likewise.
360 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
362 * ctf-impl.h (ctf_dict_t): Fix comment.
364 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
366 * ctf-create.c (symtypetab_delete_nonstatic_vars): Move
367 into ctf-serialize.c.
368 (ctf_symtab_skippable): Likewise.
369 (CTF_SYMTYPETAB_EMIT_FUNCTION): Likewise.
370 (CTF_SYMTYPETAB_EMIT_PAD): Likewise.
371 (CTF_SYMTYPETAB_FORCE_INDEXED): Likewise.
372 (symtypetab_density): Likewise.
373 (emit_symtypetab): Likewise.
374 (emit_symtypetab_index): Likewise.
375 (ctf_copy_smembers): Likewise.
376 (ctf_copy_lmembers): Likewise.
377 (ctf_copy_emembers): Likewise.
378 (ctf_sort_var): Likewise.
379 (ctf_serialize): Likewise.
380 (ctf_gzwrite): Likewise.
381 (ctf_compress_write): Likewise.
382 (ctf_write_mem): Likewise.
383 (ctf_write): Likewise.
384 * ctf-serialize.c: New file.
385 * Makefile.am (libctf_nobfd_la_SOURCES): Add it.
386 * Makefile.in: Regenerate.
388 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
390 * ctf-link.c (ctf_link_lazy_open): Move up in the file, to near
392 * ctf-lookup.c (ctf_lookup_symbol_idx): Repair tabdamage.
393 (ctf_lookup_by_sym_or_name): Likewise.
394 * testsuite/libctf-lookup/struct-iteration.c: Likewise.
395 * testsuite/libctf-regression/type-add-unnamed-struct.c: Likewise.
397 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
399 * ctf-create.c (symtypetab_density): Report the symbol name as
400 well as index in the name != object error; note the likely
402 * ctf-link.c (ctf_link_shuffle_syms): Report the symbol index
405 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
407 * ctf-link.c (ctf_link_shuffle_syms): Free ctf_dynsyms properly.
409 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
411 * ctf-dump.c (ctf_dump_format_type): Fix signed/unsigned confusion.
413 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
415 * ctf-dedup.c (ctf_dedup): Pass on errors from ctf_dedup_hash_type.
416 Call ctf_dedup_fini properly on other errors.
417 (ctf_dedup_emit_type): Set the errno on dynhash insertion failure.
418 * ctf-link.c (ctf_link_deduplicating_per_cu): Close outputs beyond
419 output 0 when asserting because >1 output is found.
420 (ctf_link_deduplicating): Likewise, when asserting because the
421 shared output is not the same as the passed-in fp.
423 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
425 * ctf-impl.h (ctf_dict_t) <ctf_link_type_mapping>: No longer used
426 by the nondeduplicating linker.
427 (ctf_add_type_mapping): Removed, now static.
428 (ctf_type_mapping): Likewise.
429 (ctf_dedup_type_mapping): New.
430 (ctf_dedup_t) <cd_input_nums>: New.
431 * ctf-dedup.c (ctf_dedup_init): Populate it.
432 (ctf_dedup_fini): Free it again. Emphasise that this has to be
433 the last thing called.
434 (ctf_dedup): Populate it.
435 (ctf_dedup_populate_type_mapping): Removed.
436 (ctf_dedup_populate_type_mappings): Likewise.
437 (ctf_dedup_emit): No longer call it. No longer call
438 ctf_dedup_fini either.
439 (ctf_dedup_type_mapping): New.
440 * ctf-link.c (ctf_unnamed_cuname): New.
441 (ctf_create_per_cu): Arguments must be non-null now.
442 (ctf_in_member_cb_arg): Removed.
443 (ctf_link): No longer populate it. No longer discard the
445 (ctf_link_deduplicating_one_symtypetab): Use
446 ctf_dedup_type_mapping, not ctf_type_mapping. Use
448 (ctf_link_one_variable): Likewise. Pass in args individually: no
449 longer a ctf_variable_iter callback.
450 (empty_link_type_mapping): Removed.
451 (ctf_link_deduplicating_variables): Use ctf_variable_next, not
452 ctf_variable_iter. No longer pack arguments to
453 ctf_link_one_variable into a struct.
454 (ctf_link_deduplicating_per_cu): Call ctf_dedup_fini once
455 all link phases are done.
456 (ctf_link_deduplicating): Likewise.
457 (ctf_link_intern_extern_string): Improve comment.
458 (ctf_add_type_mapping): Migrate...
459 (ctf_type_mapping): ... these functions...
460 * ctf-create.c (ctf_add_type_mapping): ... here...
461 (ctf_type_mapping): ... and make static, for the sole use of
464 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
466 * ctf-link.c (ctf_link_one_variable): Remove reference to
467 "unconflicted link mode".
469 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
471 * ctf-link.c (ctf_create_per_cu): Drop FILENAME now that it is
472 always identical to CUNAME.
473 (ctf_link_deduplicating_one_symtypetab): Adjust.
474 (ctf_link_one_type): Remove.
475 (ctf_link_one_input_archive_member): Likewise.
476 (ctf_link_close_one_input_archive): Likewise.
477 (ctf_link_one_input_archive): Likewise.
478 (ctf_link): No longer call it. Drop CTF_LINK_NONDEDUP path.
479 Improve header comment a bit (dicts, not files). Adjust
480 ctf_create_per_cu call.
481 (ctf_link_deduplicating_variables): Simplify.
482 (ctf_link_in_member_cb_arg_t) <cu_name>: Remove.
483 <in_input_cu_file>: Likewise.
484 <in_fp_parent>: Likewise.
485 <done_parent>: Likewise.
486 (ctf_link_one_variable): Turn uses of in_file_name to in_cuname.
488 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
490 * ctf-types.c (ctf_member_iter): Move 'rc' to an inner scope.
491 (ctf_enum_iter): Reimplement in terms of ctf_enum_next.
492 (ctf_type_iter): Reimplement in terms of ctf_type_next.
493 (ctf_type_iter_all): Likewise.
494 (ctf_variable_iter): Reimplement in terms of ctf_variable_next.
495 * ctf-archive.c (ctf_archive_iter_internal): Remove.
496 (ctf_archive_iter): Reimplement in terms of ctf_archive_next.
498 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
500 * ctf-archive.c (ctf_archive_next): Set the name of parents in
501 single-member archives.
503 2021-02-26 Alan Modra <amodra@gmail.com>
505 * Makefile.in: Regenerate.
507 2021-02-21 Alan Modra <amodra@gmail.com>
509 * configure.ac: Invoke AC_CANONICAL_TARGET, AC_CANONICAL_HOST
510 and AC_CANONICAL_BUILD.
511 * configure: Regenerate.
512 * Makefile.in: Regenerate.
514 2021-02-20 Nick Alcock <nick.alcock@oracle.com>
516 * ctf-impl.h (ctf_dict_t) <ctf_symhash>: New.
517 <ctf_symhash_latest>: Likewise.
518 (struct ctf_archive_internal) <ctfi_crossdict_cache>: New.
519 <ctfi_symnamedicts>: New.
521 (ctf_lookup_symbol_name): Remove.
522 * ctf-lookup.c (ctf_lookup_symbol_name): Propagate errors from
523 parent properly. Make static.
524 (ctf_lookup_symbol_idx): New, linear search for the symbol name,
525 cached in the crossdict cache's ctf_symhash (if available), or
526 this dict's (otherwise).
527 (ctf_try_lookup_indexed): Allow the symname to be passed in.
528 (ctf_lookup_by_symbol): Turn into a wrapper around...
529 (ctf_lookup_by_sym_or_name): ... this, supporting name lookup too,
530 using ctf_lookup_symbol_idx in non-writable dicts. Special-case
531 name lookup in dynamic dicts without reported symbols, which have
532 no symtab or dynsymidx but where name lookup should still work.
533 (ctf_lookup_by_symbol_name): New, another wrapper.
534 * ctf-archive.c (enosym): Note that this is present in
535 ctfi_symnamedicts too.
536 (ctf_arc_close): Adjust for removal of ctfi_syms. Free the
538 (ctf_arc_flush_caches): Likewise.
539 (ctf_dict_open_cached): Memoize the first cached dict in the
541 (ctf_arc_lookup_symbol): Turn into a wrapper around...
542 (ctf_arc_lookup_sym_or_name): ... this. No longer cache
543 ctf_id_t lookups: just call ctf_lookup_by_symbol as needed (but
544 still cache the dicts those lookups succeed in). Add
545 lookup-by-name support, with dicts of successful lookups cached in
546 ctfi_symnamedicts. Refactor the caching code a bit.
547 (ctf_arc_lookup_symbol_name): New, another wrapper.
548 * ctf-open.c (ctf_dict_close): Free the ctf_symhash.
549 * libctf.ver (LIBCTF_1.2): New version. Add
550 ctf_lookup_by_symbol_name, ctf_arc_lookup_symbol_name.
551 * testsuite/libctf-lookup/enum-symbol.c (main): Use
552 ctf_arc_lookup_symbol rather than looking up the name ourselves.
553 Fish it out repeatedly, to make sure that symbol caching isn't
557 * testsuite/libctf-lookup/enum-symbol-obj.lk: Test symbol lookup
558 in an unlinked object file (indexed symtypetab sections only).
559 * testsuite/libctf-writable/symtypetab-nonlinker-writeout.c
560 (try_maybe_reporting): Check symbol types via
561 ctf_lookup_by_symbol_name as well as ctf_symbol_next.
562 * testsuite/libctf-lookup/conflicting-type-syms.*: New test of
563 lookups in a multi-dict archive.
565 2021-02-20 Alan Modra <amodra@gmail.com>
567 * testsuite/config/default.exp (ld_L_opt): Define.
568 * testsuite/lib/ctf-lib.exp (load_common_lib): Delete. Instead load
570 (run_host_cmd, run_host_cmd_yesno, check_compiler_available): Delete.
571 (compile_one_cc, check_ctf_available): Delete.
573 2021-02-03 Nick Alcock <nick.alcock@oracle.com>
575 * configure.ac (ac_cv_libctf_bfd_elf): Include string.h.
576 * configure: Regenerated.
578 2021-02-03 Nick Alcock <nick.alcock@oracle.com>
580 * configure.ac (EXPECT): Check for, in order to define...
581 (TCL_TRY): ... this, if Tcl supports try/catch.
582 * Makefile.am (TCL_TRY): Run the testsuite only if set.
583 * configure: Regenerated.
584 * Makefile.in: Likewise.
586 2021-02-02 Nick Alcock <nick.alcock@oracle.com>
588 * configure.ac (CTF_LIBADD): Remove explicit -lintl population in
590 * Makefile.am (libctf_nobfd_la_LIBADD): No longer explicitly
592 (check-DEJAGNU): Pass down to tests as well.
593 * configure: Regenerated.
594 * Makefile.in: Likewise.
596 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
598 * ctf-string.c (ctf_str_add): Treat adding a NULL as adding "".
599 (ctf_str_add_ref): Likewise.
600 (ctf_str_add_external): Likewise.
601 * ctf-types.c (ctf_type_name_raw): Always return "" for offset 0.
602 * ctf-dedup.c (ctf_dedup_multiple_input_dicts): Don't armour
604 (ctf_dedup_maybe_synthesize_forward): Likewise.
606 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
608 * ctf-create.c (ctf_serialize): Fix shadowing.
610 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
612 * ctf-create.c (ctf_add_encoded): Add check for non-empty name.
613 (ctf_add_forward): Likewise.
614 (ctf_add_typedef): Likewise.
616 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
618 * ctf-open.c (init_types): Rip out code to check anonymous typedef
620 * ctf-create.c (ctf_add_reftype): Likewise.
621 * ctf-lookup.c (refresh_pptrtab): Likewise.
623 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
625 * ctf-impl.c (_libctf_nonnull_): Add parameters.
626 (LCTF_LINKING): New flag.
627 (ctf_dict_t) <ctf_link_flags>: Mention it.
628 * ctf-link.c (ctf_link): Keep LCTF_LINKING set across call.
629 (ctf_write): Likewise, including in child dictionaries.
630 (ctf_link_shuffle_syms): Make sure ctf_dynsyms is NULL if there
631 are no reported symbols.
632 * ctf-create.c (symtypetab_delete_nonstatic_vars): Make sure
633 the variable has been reported as a symbol by the linker.
634 (symtypetab_skippable): Mention relationship between SYMFP and the
636 (symtypetab_density): Adjust nonnullity. Exit early if no symbols
637 were reported and force-indexing is off (i.e., we are doing a
639 (ctf_serialize): Handle the !LCTF_LINKING case by writing out an
640 indexed, sorted symtypetab (and allow SYMFP to be NULL in this
641 case). Turn sorting off if this is a non-final link. Only delete
642 nonstatic vars if we are filtering symbols and the linker has
644 * testsuite/libctf-regression/nonstatic-var-section-ld-r*:
645 New test of variable and symtypetab section population when
647 * testsuite/libctf-regression/nonstatic-var-section-ld-executable.lk:
648 Likewise, when ld of an executable is used.
649 * testsuite/libctf-regression/nonstatic-var-section-ld.lk:
650 Likewise, when ld -shared alone is used.
651 * testsuite/libctf-regression/nonstatic-var-section-ld*.c:
652 Lookup programs for the above.
653 * testsuite/libctf-writable/symtypetab-nonlinker-writeout.*: New
654 test, testing survival of symbols across ctf_write paths.
655 * testsuite/lib/ctf-lib.exp (run_lookup_test): New option,
656 nonshared, suppressing linking of the SOURCE with -shared.
658 2021-01-19 Nick Alcock <nick.alcock@oracle.com>
660 * ctf-create.c (membadd): Transform ""-named members into
662 * testsuite/libctf-regression/type-add-unnamed-struct*: New test.
664 2021-01-19 Nick Alcock <nick.alcock@oracle.com>
666 * ctf-lookup.c (ctf_lookup_by_name_internal): Do not return the
667 base type if looking up a nonexistent pointer type.
668 * testsuite/libctf-regression/pptrtab*: Test it.
670 2021-01-13 Alan Modra <amodra@gmail.com>
672 * Makefile.in: Regenerate.
674 2021-01-12 H.J. Lu <hongjiu.lu@intel.com>
677 * configure.ac: Use GNU_MAKE_JOBSERVER.
678 * aclocal.m4: Regenerated.
679 * configure: Likewise.
681 2021-01-11 H.J. Lu <hongjiu.lu@intel.com>
684 * configure: Regenerated.
686 2021-01-09 H.J. Lu <hongjiu.lu@intel.com>
688 * configure: Regenerated.
690 2021-01-09 Nick Clifton <nickc@redhat.com>
692 * 2.36 release branch crated.
694 2021-01-09 Alan Modra <amodra@gmail.com>
696 * configure: Regenerate.
698 2021-01-07 Samuel Thibault <samuel.thibault@gnu.org>
700 * configure: Regenerate.
702 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
704 * testsuite/libctf-lookup/struct-iteration.c (main):
705 ctf_member_count returns an int.
707 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
709 * Makefile.am (BASEDIR): New.
711 (check-DEJAGNU): Add development.exp to prerequisites.
712 (development.exp): New.
713 (CONFIG_STATUS_DEPENDENCIES): New.
714 (EXTRA_DEJAGNU_SITE_CONFIG): Likewise.
715 (DISTCLEANFILES): Likewise.
716 * Makefile.in: Regenerated.
717 * testsuite/lib/ctf-lib.exp (check_ctf_available): Return boolean.
718 * testsuite/libctf-lookup/lookup.exp: Call check_ctf_available.
719 * testsuite/libctf-regression/regression.exp: Likewise.
721 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
723 * ctf-types.c (ctf_type_aname): Print forwards to unions and enums
726 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
728 * ctf-impl.h (ctf_dict_t) <ctf_pptrtab>: New.
729 <ctf_pptrtab_len>: New.
730 <ctf_pptrtab_typemax>: New.
731 * ctf-create.c (ctf_serialize): Update accordingly.
732 (ctf_add_reftype): Note that we don't need to update pptrtab here,
733 despite updating ptrtab.
734 * ctf-open.c (ctf_dict_close): Destroy the pptrtab.
735 (ctf_import): Likewise.
736 (ctf_import_unref): Likewise.
737 * ctf-lookup.c (grow_pptrtab): New.
738 (refresh_pptrtab): New, update a pptrtab.
739 (ctf_lookup_by_name): Turn into a wrapper around (and rename to)...
740 (ctf_lookup_by_name_internal): ... this: construct the pptrtab, and
741 use it in addition to the parent's ptrtab when parent dicts are
743 * testsuite/libctf-regression/regression.exp: New testsuite for
745 * testsuite/libctf-regression/pptrtab*: New test.
746 * testsuite/libctf-writable/writable.exp: New testsuite for tests of
748 * testsuite/libctf-writable/pptrtab*: New test.
750 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
752 * ctf-archive.c (ctf_archive_iter): Remove outdated comment.
754 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
756 * ctf-impl.h (struct ctf_next) <u.ctn_next>: Move to...
757 <ctn_next>: ... here.
758 * ctf-util.c (ctf_next_destroy): Unconditionally destroy it.
759 * ctf-lookup.c (ctf_symbol_next): Adjust accordingly.
760 * ctf-types.c (ctf_member_iter): Reimplement in terms of...
761 (ctf_member_next): ... this. Support recursive unnamed member
762 iteration (off by default).
763 (ctf_member_info): Look up members in unnamed sub-structs.
764 * ctf-dedup.c (ctf_dedup_rhash_type): Adjust ctf_member_next call.
765 (ctf_dedup_emit_struct_members): Likewise.
766 * testsuite/libctf-lookup/struct-iteration-ctf.c: Test empty unnamed
767 members, and a normal member after the end.
768 * testsuite/libctf-lookup/struct-iteration.c: Verify that
769 ctf_member_count is consistent with the number of successful returns
770 from a non-recursive ctf_member_next.
771 * testsuite/libctf-lookup/struct-iteration-*: New, test iteration
773 * testsuite/libctf-lookup/struct-lookup.c: New test.
774 * testsuite/libctf-lookup/struct-lookup.lk: New test.
776 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
778 * ctf-link.c (ctf_link_warn_outdated_inputs): New.
779 (ctf_link_write): Call it.
781 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
783 * testsuite/libctf-lookup/enum-symbol.lk: New symbol-lookup test.
784 * testsuite/libctf-lookup/enum-symbol-ctf.c: New CTF input.
785 * testsuite/libctf-lookup/enum-symbol.c: New lookup test.
787 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
789 * Makefile.am (EXPECT): New.
791 (RUNTESTFLAGS): Likewise.
792 (CC_FOR_TARGET): Likewise.
793 (check-DEJAGNU): Likewise.
794 (AUTOMAKE_OPTIONS): Add dejagnu.
795 * Makefile.in: Regenerated.
796 * testsuite/config/default.exp: New.
797 * testsuite/lib/ctf-lib.exp: Likewise.
798 * testsuite/libctf-lookup/enum.lk: New test.
799 * testsuite/libctf-lookup/enum-ctf.c: New CTF input.
800 * testsuite/libctf-lookup/enum.c: New lookup test.
801 * testsuite/libctf-lookup/ambiguous-struct*.c: New test.
802 * testsuite/libctf-lookup/lookup.exp: New.
804 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
806 * configure.ac (BFD_LIBADD): Remove.
807 (BFD_DEPENDENCIES): Likewise. Remove associated cases.
808 (SHARED_LIBADD): Rename to...
809 (CTF_LIBADD): ... this. Stick in a suitable libiberty even when
811 * Makefile.am (libctf_nobfd_la_LIBADD): Adjust accordingly.
813 (libctf_la_LIBADD): Reference libbfd.la directly, not via
815 (libctf_la_DEPENDENCIES): Remove.
816 * Makefile.in: Regenerate.
817 * configure: Likewise.
819 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
821 * ctf-decl.c (ctf_decl_push): Exclude slices from the decl stack.
822 * ctf-types.c (ctf_type_aname): No longer deal with slices here.
823 * ctf-dump.c (ctf_dump_membstate_t) <cdm_toplevel_indent>: Constify.
825 (CTF_FT_BITFIELD): Likewise.
826 (CTF_FT_ID): Likewise.
827 (ctf_dump_member): Do not do indentation here. Migrate the
828 type-printing parts of this into...
829 (ctf_dump_format_type): ... here, to be shared by all type printers.
830 Get the errno value for non-representable types right. Do not print
831 bitfield info for non-bitfields. Improve the format and indentation
832 of other type output. Shuffle spacing around to make all indentation
833 either 'width of column' or 4 chars.
834 (ctf_dump_label): Pass CTF_FT_REFS to ctf_dump_format_type.
835 (ctf_dump_objts): Likewise. Spacing shuffle.
836 (ctf_dump_var): Likewise.
837 (type_hex_digits): Migrate down in the file, to above its new user.
838 (ctf_dump_type): Indent here instead. Pass CTF_FT_REFS to
839 ctf_dump_format_type. Don't trim off excess linefeeds now we no
840 longer generate them. Dump enumerated types.
842 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
844 * ctf-types.c (ctf_type_resolve): Improve comment.
845 (ctf_type_size): Yield ECTF_INCOMPLETE when applied to forwards.
846 Emit errors into the right dict.
847 (ctf_type_align): Likewise.
848 * ctf-create.c (ctf_add_member_offset): Yield ECTF_INCOMPLETE
849 when adding a member without explicit offset when this member, or
850 the previous member, is incomplete.
851 * ctf-dump.c (ctf_dump_format_type): Do not try to print the size of
853 (ctf_dump_member): Do not try to print their alignment.
855 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
857 * ctf-dump.c (ctf_dump_objts): Dump by calling ctf_dump_format_type.
858 (ctf_dump_format_type): Don't emit the size for function objects.
859 Dump the element type of arrays like we dump the pointed-to type of
862 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
864 * ctf-dump.c (ctf_dump_format_type): Add 0x to hex type IDs.
865 (ctf_dump_header): Add 0x to the hex magic number.
866 (ctf_dump_str): Add 0x to the hex string offsets.
867 (ctf_dump_membstate_t) <cdm_toplevel_indent>: New.
868 (ctf_dump_type): Adjust. Free it when we're done.
869 (type_hex_digits): New.
870 (ctf_dump_member): Align output depending on the width of the type
871 ID being generated. Use printf padding, not a loop, to generate
874 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
876 * ctf-decl.c (ctf_decl_push): Don't print array decls backwards.
878 2021-01-04 Nicolas Boulenguez <nicolas@debian.org>
881 * configure.ac: Make AC_CONFIG_MACRO_DIR consistent with
882 ACLOCAL_AMFLAGS -I dirs.
883 * configure: Regenerate.
885 2021-01-01 Alan Modra <amodra@gmail.com>
887 Update year range in copyright notice of all files.
889 For older changes see ChangeLog-2020
891 Copyright (C) 2021-2025 Free Software Foundation, Inc.
893 Copying and distribution of this file, with or without modification,
894 are permitted in any medium without royalty provided the copyright
895 notice and this notice are preserved.
901 version-control: never