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