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