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