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