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