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