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