1 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
3 * ctf-types.c (ctf_type_encoding): Support, after a fashion, for enums.
4 * ctf-dump.c (ctf_dump_format_type): Do not report enums' degenerate
7 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
9 * ctf-dedup.c (ctf_dedup_rhash_type): Report errors on the input
11 * ctf-open.c (ctf_bufopen_internal): Report errors initializing
14 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
16 * ctf-impl.h (ctf_next_t) <ctn_tp>: New.
20 * ctf-types.c (ctf_struct_member): New.
21 (ctf_member_next): Use it, dropping separate large/small code paths.
22 (ctf_type_align): Likewise.
23 (ctf_member_info): Likewise.
24 (ctf_type_rvisit): Likewise.
26 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
28 * ctf-impl.h (ctf_dtdef_t) <dtu_members>: Remove.
30 (ctf_dmdef_t): Remove.
31 (struct ctf_next) <u.ctn_dmd>: Remove.
32 * ctf-create.c (INITIAL_VLEN): New, more-or-less arbitrary initial
34 (ctf_add_enum): Use it.
35 (ctf_dtd_delete): Do not free the (removed) dmd; remove string
36 refs from the vlen on struct deletion.
37 (ctf_add_struct_sized): Populate the vlen: do it by hand if
38 promoting forwards. Always populate the full-size
39 lsizehi/lsizelo members.
40 (ctf_add_union_sized): Likewise.
41 (ctf_add_member_offset): Set up the vlen rather than the dmd.
42 Expand it as needed, repointing string refs via
43 ctf_str_move_pending. Add the member names as pending strings.
44 Always populate the full-size lsizehi/lsizelo members.
45 (membadd): Remove, folding back into...
46 (ctf_add_type_internal): ... here, adding via an ordinary
47 ctf_add_struct_sized and _next iteration rather than doing
49 * ctf-serialize.c (ctf_copy_smembers): Remove this...
50 (ctf_copy_lmembers): ... and this...
51 (ctf_emit_type_sect): ... folding into here. Figure out if a
52 ctf_stype_t is needed here, not in ctf_add_*_sized.
53 (ctf_type_sect_size): Figure out the ctf_stype_t stuff the same
55 * ctf-types.c (ctf_member_next): Remove the dmd path and always
56 use the vlen. Force large-structure usage for dynamic types.
57 (ctf_type_align): Likewise.
58 (ctf_member_info): Likewise.
59 (ctf_type_rvisit): Likewise.
60 * testsuite/libctf-regression/type-add-unnamed-struct-ctf.c: Add a
61 self-referential type to this test.
62 * testsuite/libctf-regression/type-add-unnamed-struct.c: Adjusted
64 * testsuite/libctf-regression/type-add-unnamed-struct.lk: Likewise.
66 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
68 * ctf-impl.h (ctf_dtdef_t) <dtd_vlen_alloc>: New.
69 (ctf_str_move_pending): Declare.
70 * ctf-string.c (ctf_str_add_ref_internal): Fix error return.
71 (ctf_str_move_pending): New.
72 * ctf-create.c (ctf_grow_vlen): New.
73 (ctf_dtd_delete): Zero out the vlen_alloc after free. Free the
74 vlen later: iterate over it and free enum name refs first.
75 (ctf_add_generic): Populate dtd_vlen_alloc from vlen.
76 (ctf_add_enum): populate the vlen; do it by hand if promoting
78 (ctf_add_enumerator): Set up the vlen rather than the dmd. Expand
79 it as needed, repointing string refs via ctf_str_move_pending. Add
80 the enumerand names as pending strings.
81 * ctf-serialize.c (ctf_copy_emembers): Remove.
82 (ctf_emit_type_sect): Copy the vlen into place and ref the
84 * ctf-types.c (ctf_enum_next): The dynamic portion now uses
85 the same code as the non-dynamic.
86 (ctf_enum_name): Likewise.
87 (ctf_enum_value): Likewise.
88 * testsuite/libctf-lookup/enum-many-ctf.c: New test.
89 * testsuite/libctf-lookup/enum-many.lk: New test.
91 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
93 * ctf-hash.c (ctf_dynset_elements): New.
94 * ctf-impl.h (ctf_dynset_elements): Declare it.
95 (ctf_str_add_pending): Likewise.
96 (ctf_dict_t) <ctf_str_pending_ref>: New, set of refs that must be
97 added during serialization.
98 * ctf-string.c (ctf_str_create_atoms): Initialize it.
99 (CTF_STR_ADD_REF): New flag.
100 (CTF_STR_MAKE_PROVISIONAL): Likewise.
101 (CTF_STR_PENDING_REF): Likewise.
102 (ctf_str_add_ref_internal): Take a flags word rather than int
103 params. Populate, and clear out, ctf_str_pending_ref.
104 (ctf_str_add): Adjust accordingly.
105 (ctf_str_add_external): Likewise.
106 (ctf_str_add_pending): New.
107 (ctf_str_remove_ref): Also remove the potential ref if it is a
109 * ctf-serialize.c (ctf_serialize): Prohibit addition of strings
110 with ctf_str_add_ref before serialization. Ensure that the
111 ctf_str_pending_ref set is empty before strtab finalization.
112 (ctf_emit_type_sect): Add a ref to the ctt_name.
113 * ctf-create.c (ctf_add_generic): Add the ctt_name as a pending
115 * testsuite/libctf-writable/reserialize-strtab-corruption.*: New test.
117 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
119 * ctf-serialize.c (ctf_serialize): Preserve ctf_typemax across
122 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
124 * ctf-impl.h (ctf_dtdef_t) <dtd_u.dtu_argv>: Remove.
125 * ctf-create.c (ctf_dtd_delete): No longer free it.
126 (ctf_add_function): Use the dtd_vlen, not dtu_argv. Properly align.
127 * ctf-serialize.c (ctf_emit_type_sect): Just copy the dtd_vlen.
128 * ctf-types.c (ctf_func_type_info): Just use the vlen.
129 (ctf_func_type_args): Likewise.
131 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
133 * ctf-impl.h (ctf_dtdef_t) <dtd_u.dtu_arr>: Remove.
134 * ctf-create.c (ctf_add_array): Use the dtd_vlen, not dtu_arr.
135 (ctf_set_array): Likewise.
136 * ctf-serialize.c (ctf_emit_type_sect): Just copy the dtd_vlen.
137 * ctf-types.c (ctf_array_info): Just use the vlen.
139 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
141 * ctf-impl.h (ctf_dtdef_t) <dtd_u.dtu_enc>: Remove.
142 <dtd_u.dtu_slice>: Likewise.
144 * ctf-create.c (ctf_add_generic): Perhaps allocate it. All
146 (ctf_dtd_delete): Free it.
147 (ctf_add_slice): Use the dtd_vlen, not dtu_enc.
148 (ctf_add_encoded): Likewise. Assert that this must be an int or
150 * ctf-serialize.c (ctf_emit_type_sect): Just copy the dtd_vlen.
151 * ctf-dedup.c (ctf_dedup_rhash_type): Use the dtd_vlen, not
153 * ctf-types.c (ctf_type_reference): Likewise.
154 (ctf_type_encoding): Remove most dynamic-type-specific code: just
155 get the vlen from the right place. Report failure to look up the
156 underlying type's encoding.
158 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
160 * ctf-archive.c (ctf_archive_next): GNU style fix for do {} while.
161 * ctf-dedup.c (ctf_dedup_rhash_type): Likewise.
162 (ctf_dedup_rwalk_one_output_mapping): Likewise.
163 * ctf-dump.c (ctf_dump_format_type): Likewise.
164 * ctf-lookup.c (ctf_symbol_next): Likewise.
165 * swap.h (swap_thing): Likewise.
167 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
169 * ctf-serialize.c: General reshuffling, and...
170 (emit_symtypetab_state_t): New, migrated from
171 local variables in ctf_serialize.
172 (ctf_serialize): Split out most section sizing and
174 (ctf_symtypetab_sect_sizes): New (split out).
175 (ctf_emit_symtypetab_sects): Likewise.
176 (ctf_type_sect_size): Likewise.
177 (ctf_emit_type_sect): Likewise.
179 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
181 * ctf-impl.h (ctf_dict_t): Fix comment.
183 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
185 * ctf-create.c (symtypetab_delete_nonstatic_vars): Move
186 into ctf-serialize.c.
187 (ctf_symtab_skippable): Likewise.
188 (CTF_SYMTYPETAB_EMIT_FUNCTION): Likewise.
189 (CTF_SYMTYPETAB_EMIT_PAD): Likewise.
190 (CTF_SYMTYPETAB_FORCE_INDEXED): Likewise.
191 (symtypetab_density): Likewise.
192 (emit_symtypetab): Likewise.
193 (emit_symtypetab_index): Likewise.
194 (ctf_copy_smembers): Likewise.
195 (ctf_copy_lmembers): Likewise.
196 (ctf_copy_emembers): Likewise.
197 (ctf_sort_var): Likewise.
198 (ctf_serialize): Likewise.
199 (ctf_gzwrite): Likewise.
200 (ctf_compress_write): Likewise.
201 (ctf_write_mem): Likewise.
202 (ctf_write): Likewise.
203 * ctf-serialize.c: New file.
204 * Makefile.am (libctf_nobfd_la_SOURCES): Add it.
205 * Makefile.in: Regenerate.
207 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
209 * ctf-link.c (ctf_link_lazy_open): Move up in the file, to near
211 * ctf-lookup.c (ctf_lookup_symbol_idx): Repair tabdamage.
212 (ctf_lookup_by_sym_or_name): Likewise.
213 * testsuite/libctf-lookup/struct-iteration.c: Likewise.
214 * testsuite/libctf-regression/type-add-unnamed-struct.c: Likewise.
216 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
218 * ctf-create.c (symtypetab_density): Report the symbol name as
219 well as index in the name != object error; note the likely
221 * ctf-link.c (ctf_link_shuffle_syms): Report the symbol index
224 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
226 * ctf-link.c (ctf_link_shuffle_syms): Free ctf_dynsyms properly.
228 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
230 * ctf-dump.c (ctf_dump_format_type): Fix signed/unsigned confusion.
232 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
234 * ctf-dedup.c (ctf_dedup): Pass on errors from ctf_dedup_hash_type.
235 Call ctf_dedup_fini properly on other errors.
236 (ctf_dedup_emit_type): Set the errno on dynhash insertion failure.
237 * ctf-link.c (ctf_link_deduplicating_per_cu): Close outputs beyond
238 output 0 when asserting because >1 output is found.
239 (ctf_link_deduplicating): Likewise, when asserting because the
240 shared output is not the same as the passed-in fp.
242 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
244 * ctf-impl.h (ctf_dict_t) <ctf_link_type_mapping>: No longer used
245 by the nondeduplicating linker.
246 (ctf_add_type_mapping): Removed, now static.
247 (ctf_type_mapping): Likewise.
248 (ctf_dedup_type_mapping): New.
249 (ctf_dedup_t) <cd_input_nums>: New.
250 * ctf-dedup.c (ctf_dedup_init): Populate it.
251 (ctf_dedup_fini): Free it again. Emphasise that this has to be
252 the last thing called.
253 (ctf_dedup): Populate it.
254 (ctf_dedup_populate_type_mapping): Removed.
255 (ctf_dedup_populate_type_mappings): Likewise.
256 (ctf_dedup_emit): No longer call it. No longer call
257 ctf_dedup_fini either.
258 (ctf_dedup_type_mapping): New.
259 * ctf-link.c (ctf_unnamed_cuname): New.
260 (ctf_create_per_cu): Arguments must be non-null now.
261 (ctf_in_member_cb_arg): Removed.
262 (ctf_link): No longer populate it. No longer discard the
264 (ctf_link_deduplicating_one_symtypetab): Use
265 ctf_dedup_type_mapping, not ctf_type_mapping. Use
267 (ctf_link_one_variable): Likewise. Pass in args individually: no
268 longer a ctf_variable_iter callback.
269 (empty_link_type_mapping): Removed.
270 (ctf_link_deduplicating_variables): Use ctf_variable_next, not
271 ctf_variable_iter. No longer pack arguments to
272 ctf_link_one_variable into a struct.
273 (ctf_link_deduplicating_per_cu): Call ctf_dedup_fini once
274 all link phases are done.
275 (ctf_link_deduplicating): Likewise.
276 (ctf_link_intern_extern_string): Improve comment.
277 (ctf_add_type_mapping): Migrate...
278 (ctf_type_mapping): ... these functions...
279 * ctf-create.c (ctf_add_type_mapping): ... here...
280 (ctf_type_mapping): ... and make static, for the sole use of
283 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
285 * ctf-link.c (ctf_link_one_variable): Remove reference to
286 "unconflicted link mode".
288 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
290 * ctf-link.c (ctf_create_per_cu): Drop FILENAME now that it is
291 always identical to CUNAME.
292 (ctf_link_deduplicating_one_symtypetab): Adjust.
293 (ctf_link_one_type): Remove.
294 (ctf_link_one_input_archive_member): Likewise.
295 (ctf_link_close_one_input_archive): Likewise.
296 (ctf_link_one_input_archive): Likewise.
297 (ctf_link): No longer call it. Drop CTF_LINK_NONDEDUP path.
298 Improve header comment a bit (dicts, not files). Adjust
299 ctf_create_per_cu call.
300 (ctf_link_deduplicating_variables): Simplify.
301 (ctf_link_in_member_cb_arg_t) <cu_name>: Remove.
302 <in_input_cu_file>: Likewise.
303 <in_fp_parent>: Likewise.
304 <done_parent>: Likewise.
305 (ctf_link_one_variable): Turn uses of in_file_name to in_cuname.
307 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
309 * ctf-types.c (ctf_member_iter): Move 'rc' to an inner scope.
310 (ctf_enum_iter): Reimplement in terms of ctf_enum_next.
311 (ctf_type_iter): Reimplement in terms of ctf_type_next.
312 (ctf_type_iter_all): Likewise.
313 (ctf_variable_iter): Reimplement in terms of ctf_variable_next.
314 * ctf-archive.c (ctf_archive_iter_internal): Remove.
315 (ctf_archive_iter): Reimplement in terms of ctf_archive_next.
317 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
319 * ctf-archive.c (ctf_archive_next): Set the name of parents in
320 single-member archives.
322 2021-02-26 Alan Modra <amodra@gmail.com>
324 * Makefile.in: Regenerate.
326 2021-02-21 Alan Modra <amodra@gmail.com>
328 * configure.ac: Invoke AC_CANONICAL_TARGET, AC_CANONICAL_HOST
329 and AC_CANONICAL_BUILD.
330 * configure: Regenerate.
331 * Makefile.in: Regenerate.
333 2021-02-20 Nick Alcock <nick.alcock@oracle.com>
335 * ctf-impl.h (ctf_dict_t) <ctf_symhash>: New.
336 <ctf_symhash_latest>: Likewise.
337 (struct ctf_archive_internal) <ctfi_crossdict_cache>: New.
338 <ctfi_symnamedicts>: New.
340 (ctf_lookup_symbol_name): Remove.
341 * ctf-lookup.c (ctf_lookup_symbol_name): Propagate errors from
342 parent properly. Make static.
343 (ctf_lookup_symbol_idx): New, linear search for the symbol name,
344 cached in the crossdict cache's ctf_symhash (if available), or
345 this dict's (otherwise).
346 (ctf_try_lookup_indexed): Allow the symname to be passed in.
347 (ctf_lookup_by_symbol): Turn into a wrapper around...
348 (ctf_lookup_by_sym_or_name): ... this, supporting name lookup too,
349 using ctf_lookup_symbol_idx in non-writable dicts. Special-case
350 name lookup in dynamic dicts without reported symbols, which have
351 no symtab or dynsymidx but where name lookup should still work.
352 (ctf_lookup_by_symbol_name): New, another wrapper.
353 * ctf-archive.c (enosym): Note that this is present in
354 ctfi_symnamedicts too.
355 (ctf_arc_close): Adjust for removal of ctfi_syms. Free the
357 (ctf_arc_flush_caches): Likewise.
358 (ctf_dict_open_cached): Memoize the first cached dict in the
360 (ctf_arc_lookup_symbol): Turn into a wrapper around...
361 (ctf_arc_lookup_sym_or_name): ... this. No longer cache
362 ctf_id_t lookups: just call ctf_lookup_by_symbol as needed (but
363 still cache the dicts those lookups succeed in). Add
364 lookup-by-name support, with dicts of successful lookups cached in
365 ctfi_symnamedicts. Refactor the caching code a bit.
366 (ctf_arc_lookup_symbol_name): New, another wrapper.
367 * ctf-open.c (ctf_dict_close): Free the ctf_symhash.
368 * libctf.ver (LIBCTF_1.2): New version. Add
369 ctf_lookup_by_symbol_name, ctf_arc_lookup_symbol_name.
370 * testsuite/libctf-lookup/enum-symbol.c (main): Use
371 ctf_arc_lookup_symbol rather than looking up the name ourselves.
372 Fish it out repeatedly, to make sure that symbol caching isn't
376 * testsuite/libctf-lookup/enum-symbol-obj.lk: Test symbol lookup
377 in an unlinked object file (indexed symtypetab sections only).
378 * testsuite/libctf-writable/symtypetab-nonlinker-writeout.c
379 (try_maybe_reporting): Check symbol types via
380 ctf_lookup_by_symbol_name as well as ctf_symbol_next.
381 * testsuite/libctf-lookup/conflicting-type-syms.*: New test of
382 lookups in a multi-dict archive.
384 2021-02-20 Alan Modra <amodra@gmail.com>
386 * testsuite/config/default.exp (ld_L_opt): Define.
387 * testsuite/lib/ctf-lib.exp (load_common_lib): Delete. Instead load
389 (run_host_cmd, run_host_cmd_yesno, check_compiler_available): Delete.
390 (compile_one_cc, check_ctf_available): Delete.
392 2021-02-03 Nick Alcock <nick.alcock@oracle.com>
394 * configure.ac (ac_cv_libctf_bfd_elf): Include string.h.
395 * configure: Regenerated.
397 2021-02-03 Nick Alcock <nick.alcock@oracle.com>
399 * configure.ac (EXPECT): Check for, in order to define...
400 (TCL_TRY): ... this, if Tcl supports try/catch.
401 * Makefile.am (TCL_TRY): Run the testsuite only if set.
402 * configure: Regenerated.
403 * Makefile.in: Likewise.
405 2021-02-02 Nick Alcock <nick.alcock@oracle.com>
407 * configure.ac (CTF_LIBADD): Remove explicit -lintl population in
409 * Makefile.am (libctf_nobfd_la_LIBADD): No longer explicitly
411 (check-DEJAGNU): Pass down to tests as well.
412 * configure: Regenerated.
413 * Makefile.in: Likewise.
415 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
417 * ctf-string.c (ctf_str_add): Treat adding a NULL as adding "".
418 (ctf_str_add_ref): Likewise.
419 (ctf_str_add_external): Likewise.
420 * ctf-types.c (ctf_type_name_raw): Always return "" for offset 0.
421 * ctf-dedup.c (ctf_dedup_multiple_input_dicts): Don't armour
423 (ctf_dedup_maybe_synthesize_forward): Likewise.
425 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
427 * ctf-create.c (ctf_serialize): Fix shadowing.
429 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
431 * ctf-create.c (ctf_add_encoded): Add check for non-empty name.
432 (ctf_add_forward): Likewise.
433 (ctf_add_typedef): Likewise.
435 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
437 * ctf-open.c (init_types): Rip out code to check anonymous typedef
439 * ctf-create.c (ctf_add_reftype): Likewise.
440 * ctf-lookup.c (refresh_pptrtab): Likewise.
442 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
444 * ctf-impl.c (_libctf_nonnull_): Add parameters.
445 (LCTF_LINKING): New flag.
446 (ctf_dict_t) <ctf_link_flags>: Mention it.
447 * ctf-link.c (ctf_link): Keep LCTF_LINKING set across call.
448 (ctf_write): Likewise, including in child dictionaries.
449 (ctf_link_shuffle_syms): Make sure ctf_dynsyms is NULL if there
450 are no reported symbols.
451 * ctf-create.c (symtypetab_delete_nonstatic_vars): Make sure
452 the variable has been reported as a symbol by the linker.
453 (symtypetab_skippable): Mention relationship between SYMFP and the
455 (symtypetab_density): Adjust nonnullity. Exit early if no symbols
456 were reported and force-indexing is off (i.e., we are doing a
458 (ctf_serialize): Handle the !LCTF_LINKING case by writing out an
459 indexed, sorted symtypetab (and allow SYMFP to be NULL in this
460 case). Turn sorting off if this is a non-final link. Only delete
461 nonstatic vars if we are filtering symbols and the linker has
463 * testsuite/libctf-regression/nonstatic-var-section-ld-r*:
464 New test of variable and symtypetab section population when
466 * testsuite/libctf-regression/nonstatic-var-section-ld-executable.lk:
467 Likewise, when ld of an executable is used.
468 * testsuite/libctf-regression/nonstatic-var-section-ld.lk:
469 Likewise, when ld -shared alone is used.
470 * testsuite/libctf-regression/nonstatic-var-section-ld*.c:
471 Lookup programs for the above.
472 * testsuite/libctf-writable/symtypetab-nonlinker-writeout.*: New
473 test, testing survival of symbols across ctf_write paths.
474 * testsuite/lib/ctf-lib.exp (run_lookup_test): New option,
475 nonshared, suppressing linking of the SOURCE with -shared.
477 2021-01-19 Nick Alcock <nick.alcock@oracle.com>
479 * ctf-create.c (membadd): Transform ""-named members into
481 * testsuite/libctf-regression/type-add-unnamed-struct*: New test.
483 2021-01-19 Nick Alcock <nick.alcock@oracle.com>
485 * ctf-lookup.c (ctf_lookup_by_name_internal): Do not return the
486 base type if looking up a nonexistent pointer type.
487 * testsuite/libctf-regression/pptrtab*: Test it.
489 2021-01-13 Alan Modra <amodra@gmail.com>
491 * Makefile.in: Regenerate.
493 2021-01-12 H.J. Lu <hongjiu.lu@intel.com>
496 * configure.ac: Use GNU_MAKE_JOBSERVER.
497 * aclocal.m4: Regenerated.
498 * configure: Likewise.
500 2021-01-11 H.J. Lu <hongjiu.lu@intel.com>
503 * configure: Regenerated.
505 2021-01-09 H.J. Lu <hongjiu.lu@intel.com>
507 * configure: Regenerated.
509 2021-01-09 Nick Clifton <nickc@redhat.com>
511 * 2.36 release branch crated.
513 2021-01-09 Alan Modra <amodra@gmail.com>
515 * configure: Regenerate.
517 2021-01-07 Samuel Thibault <samuel.thibault@gnu.org>
519 * configure: Regenerate.
521 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
523 * testsuite/libctf-lookup/struct-iteration.c (main):
524 ctf_member_count returns an int.
526 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
528 * Makefile.am (BASEDIR): New.
530 (check-DEJAGNU): Add development.exp to prerequisites.
531 (development.exp): New.
532 (CONFIG_STATUS_DEPENDENCIES): New.
533 (EXTRA_DEJAGNU_SITE_CONFIG): Likewise.
534 (DISTCLEANFILES): Likewise.
535 * Makefile.in: Regenerated.
536 * testsuite/lib/ctf-lib.exp (check_ctf_available): Return boolean.
537 * testsuite/libctf-lookup/lookup.exp: Call check_ctf_available.
538 * testsuite/libctf-regression/regression.exp: Likewise.
540 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
542 * ctf-types.c (ctf_type_aname): Print forwards to unions and enums
545 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
547 * ctf-impl.h (ctf_dict_t) <ctf_pptrtab>: New.
548 <ctf_pptrtab_len>: New.
549 <ctf_pptrtab_typemax>: New.
550 * ctf-create.c (ctf_serialize): Update accordingly.
551 (ctf_add_reftype): Note that we don't need to update pptrtab here,
552 despite updating ptrtab.
553 * ctf-open.c (ctf_dict_close): Destroy the pptrtab.
554 (ctf_import): Likewise.
555 (ctf_import_unref): Likewise.
556 * ctf-lookup.c (grow_pptrtab): New.
557 (refresh_pptrtab): New, update a pptrtab.
558 (ctf_lookup_by_name): Turn into a wrapper around (and rename to)...
559 (ctf_lookup_by_name_internal): ... this: construct the pptrtab, and
560 use it in addition to the parent's ptrtab when parent dicts are
562 * testsuite/libctf-regression/regression.exp: New testsuite for
564 * testsuite/libctf-regression/pptrtab*: New test.
565 * testsuite/libctf-writable/writable.exp: New testsuite for tests of
567 * testsuite/libctf-writable/pptrtab*: New test.
569 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
571 * ctf-archive.c (ctf_archive_iter): Remove outdated comment.
573 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
575 * ctf-impl.h (struct ctf_next) <u.ctn_next>: Move to...
576 <ctn_next>: ... here.
577 * ctf-util.c (ctf_next_destroy): Unconditionally destroy it.
578 * ctf-lookup.c (ctf_symbol_next): Adjust accordingly.
579 * ctf-types.c (ctf_member_iter): Reimplement in terms of...
580 (ctf_member_next): ... this. Support recursive unnamed member
581 iteration (off by default).
582 (ctf_member_info): Look up members in unnamed sub-structs.
583 * ctf-dedup.c (ctf_dedup_rhash_type): Adjust ctf_member_next call.
584 (ctf_dedup_emit_struct_members): Likewise.
585 * testsuite/libctf-lookup/struct-iteration-ctf.c: Test empty unnamed
586 members, and a normal member after the end.
587 * testsuite/libctf-lookup/struct-iteration.c: Verify that
588 ctf_member_count is consistent with the number of successful returns
589 from a non-recursive ctf_member_next.
590 * testsuite/libctf-lookup/struct-iteration-*: New, test iteration
592 * testsuite/libctf-lookup/struct-lookup.c: New test.
593 * testsuite/libctf-lookup/struct-lookup.lk: New test.
595 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
597 * ctf-link.c (ctf_link_warn_outdated_inputs): New.
598 (ctf_link_write): Call it.
600 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
602 * testsuite/libctf-lookup/enum-symbol.lk: New symbol-lookup test.
603 * testsuite/libctf-lookup/enum-symbol-ctf.c: New CTF input.
604 * testsuite/libctf-lookup/enum-symbol.c: New lookup test.
606 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
608 * Makefile.am (EXPECT): New.
610 (RUNTESTFLAGS): Likewise.
611 (CC_FOR_TARGET): Likewise.
612 (check-DEJAGNU): Likewise.
613 (AUTOMAKE_OPTIONS): Add dejagnu.
614 * Makefile.in: Regenerated.
615 * testsuite/config/default.exp: New.
616 * testsuite/lib/ctf-lib.exp: Likewise.
617 * testsuite/libctf-lookup/enum.lk: New test.
618 * testsuite/libctf-lookup/enum-ctf.c: New CTF input.
619 * testsuite/libctf-lookup/enum.c: New lookup test.
620 * testsuite/libctf-lookup/ambiguous-struct*.c: New test.
621 * testsuite/libctf-lookup/lookup.exp: New.
623 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
625 * configure.ac (BFD_LIBADD): Remove.
626 (BFD_DEPENDENCIES): Likewise. Remove associated cases.
627 (SHARED_LIBADD): Rename to...
628 (CTF_LIBADD): ... this. Stick in a suitable libiberty even when
630 * Makefile.am (libctf_nobfd_la_LIBADD): Adjust accordingly.
632 (libctf_la_LIBADD): Reference libbfd.la directly, not via
634 (libctf_la_DEPENDENCIES): Remove.
635 * Makefile.in: Regenerate.
636 * configure: Likewise.
638 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
640 * ctf-decl.c (ctf_decl_push): Exclude slices from the decl stack.
641 * ctf-types.c (ctf_type_aname): No longer deal with slices here.
642 * ctf-dump.c (ctf_dump_membstate_t) <cdm_toplevel_indent>: Constify.
644 (CTF_FT_BITFIELD): Likewise.
645 (CTF_FT_ID): Likewise.
646 (ctf_dump_member): Do not do indentation here. Migrate the
647 type-printing parts of this into...
648 (ctf_dump_format_type): ... here, to be shared by all type printers.
649 Get the errno value for non-representable types right. Do not print
650 bitfield info for non-bitfields. Improve the format and indentation
651 of other type output. Shuffle spacing around to make all indentation
652 either 'width of column' or 4 chars.
653 (ctf_dump_label): Pass CTF_FT_REFS to ctf_dump_format_type.
654 (ctf_dump_objts): Likewise. Spacing shuffle.
655 (ctf_dump_var): Likewise.
656 (type_hex_digits): Migrate down in the file, to above its new user.
657 (ctf_dump_type): Indent here instead. Pass CTF_FT_REFS to
658 ctf_dump_format_type. Don't trim off excess linefeeds now we no
659 longer generate them. Dump enumerated types.
661 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
663 * ctf-types.c (ctf_type_resolve): Improve comment.
664 (ctf_type_size): Yield ECTF_INCOMPLETE when applied to forwards.
665 Emit errors into the right dict.
666 (ctf_type_align): Likewise.
667 * ctf-create.c (ctf_add_member_offset): Yield ECTF_INCOMPLETE
668 when adding a member without explicit offset when this member, or
669 the previous member, is incomplete.
670 * ctf-dump.c (ctf_dump_format_type): Do not try to print the size of
672 (ctf_dump_member): Do not try to print their alignment.
674 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
676 * ctf-dump.c (ctf_dump_objts): Dump by calling ctf_dump_format_type.
677 (ctf_dump_format_type): Don't emit the size for function objects.
678 Dump the element type of arrays like we dump the pointed-to type of
681 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
683 * ctf-dump.c (ctf_dump_format_type): Add 0x to hex type IDs.
684 (ctf_dump_header): Add 0x to the hex magic number.
685 (ctf_dump_str): Add 0x to the hex string offsets.
686 (ctf_dump_membstate_t) <cdm_toplevel_indent>: New.
687 (ctf_dump_type): Adjust. Free it when we're done.
688 (type_hex_digits): New.
689 (ctf_dump_member): Align output depending on the width of the type
690 ID being generated. Use printf padding, not a loop, to generate
693 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
695 * ctf-decl.c (ctf_decl_push): Don't print array decls backwards.
697 2021-01-04 Nicolas Boulenguez <nicolas@debian.org>
700 * configure.ac: Make AC_CONFIG_MACRO_DIR consistent with
701 ACLOCAL_AMFLAGS -I dirs.
702 * configure: Regenerate.
704 2021-01-01 Alan Modra <amodra@gmail.com>
706 Update year range in copyright notice of all files.
708 For older changes see ChangeLog-2020
710 Copyright (C) 2021 Free Software Foundation, Inc.
712 Copying and distribution of this file, with or without modification,
713 are permitted in any medium without royalty provided the copyright
714 notice and this notice are preserved.
720 version-control: never