1 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
3 * ctf-impl.h (ctf_dtdef_t) <dtd_vlen_alloc>: New.
4 (ctf_str_move_pending): Declare.
5 * ctf-string.c (ctf_str_add_ref_internal): Fix error return.
6 (ctf_str_move_pending): New.
7 * ctf-create.c (ctf_grow_vlen): New.
8 (ctf_dtd_delete): Zero out the vlen_alloc after free. Free the
9 vlen later: iterate over it and free enum name refs first.
10 (ctf_add_generic): Populate dtd_vlen_alloc from vlen.
11 (ctf_add_enum): populate the vlen; do it by hand if promoting
13 (ctf_add_enumerator): Set up the vlen rather than the dmd. Expand
14 it as needed, repointing string refs via ctf_str_move_pending. Add
15 the enumerand names as pending strings.
16 * ctf-serialize.c (ctf_copy_emembers): Remove.
17 (ctf_emit_type_sect): Copy the vlen into place and ref the
19 * ctf-types.c (ctf_enum_next): The dynamic portion now uses
20 the same code as the non-dynamic.
21 (ctf_enum_name): Likewise.
22 (ctf_enum_value): Likewise.
23 * testsuite/libctf-lookup/enum-many-ctf.c: New test.
24 * testsuite/libctf-lookup/enum-many.lk: New test.
26 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
28 * ctf-hash.c (ctf_dynset_elements): New.
29 * ctf-impl.h (ctf_dynset_elements): Declare it.
30 (ctf_str_add_pending): Likewise.
31 (ctf_dict_t) <ctf_str_pending_ref>: New, set of refs that must be
32 added during serialization.
33 * ctf-string.c (ctf_str_create_atoms): Initialize it.
34 (CTF_STR_ADD_REF): New flag.
35 (CTF_STR_MAKE_PROVISIONAL): Likewise.
36 (CTF_STR_PENDING_REF): Likewise.
37 (ctf_str_add_ref_internal): Take a flags word rather than int
38 params. Populate, and clear out, ctf_str_pending_ref.
39 (ctf_str_add): Adjust accordingly.
40 (ctf_str_add_external): Likewise.
41 (ctf_str_add_pending): New.
42 (ctf_str_remove_ref): Also remove the potential ref if it is a
44 * ctf-serialize.c (ctf_serialize): Prohibit addition of strings
45 with ctf_str_add_ref before serialization. Ensure that the
46 ctf_str_pending_ref set is empty before strtab finalization.
47 (ctf_emit_type_sect): Add a ref to the ctt_name.
48 * ctf-create.c (ctf_add_generic): Add the ctt_name as a pending
50 * testsuite/libctf-writable/reserialize-strtab-corruption.*: New test.
52 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
54 * ctf-serialize.c (ctf_serialize): Preserve ctf_typemax across
57 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
59 * ctf-impl.h (ctf_dtdef_t) <dtd_u.dtu_argv>: Remove.
60 * ctf-create.c (ctf_dtd_delete): No longer free it.
61 (ctf_add_function): Use the dtd_vlen, not dtu_argv. Properly align.
62 * ctf-serialize.c (ctf_emit_type_sect): Just copy the dtd_vlen.
63 * ctf-types.c (ctf_func_type_info): Just use the vlen.
64 (ctf_func_type_args): Likewise.
66 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
68 * ctf-impl.h (ctf_dtdef_t) <dtd_u.dtu_arr>: Remove.
69 * ctf-create.c (ctf_add_array): Use the dtd_vlen, not dtu_arr.
70 (ctf_set_array): Likewise.
71 * ctf-serialize.c (ctf_emit_type_sect): Just copy the dtd_vlen.
72 * ctf-types.c (ctf_array_info): Just use the vlen.
74 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
76 * ctf-impl.h (ctf_dtdef_t) <dtd_u.dtu_enc>: Remove.
77 <dtd_u.dtu_slice>: Likewise.
79 * ctf-create.c (ctf_add_generic): Perhaps allocate it. All
81 (ctf_dtd_delete): Free it.
82 (ctf_add_slice): Use the dtd_vlen, not dtu_enc.
83 (ctf_add_encoded): Likewise. Assert that this must be an int or
85 * ctf-serialize.c (ctf_emit_type_sect): Just copy the dtd_vlen.
86 * ctf-dedup.c (ctf_dedup_rhash_type): Use the dtd_vlen, not
88 * ctf-types.c (ctf_type_reference): Likewise.
89 (ctf_type_encoding): Remove most dynamic-type-specific code: just
90 get the vlen from the right place. Report failure to look up the
91 underlying type's encoding.
93 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
95 * ctf-archive.c (ctf_archive_next): GNU style fix for do {} while.
96 * ctf-dedup.c (ctf_dedup_rhash_type): Likewise.
97 (ctf_dedup_rwalk_one_output_mapping): Likewise.
98 * ctf-dump.c (ctf_dump_format_type): Likewise.
99 * ctf-lookup.c (ctf_symbol_next): Likewise.
100 * swap.h (swap_thing): Likewise.
102 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
104 * ctf-serialize.c: General reshuffling, and...
105 (emit_symtypetab_state_t): New, migrated from
106 local variables in ctf_serialize.
107 (ctf_serialize): Split out most section sizing and
109 (ctf_symtypetab_sect_sizes): New (split out).
110 (ctf_emit_symtypetab_sects): Likewise.
111 (ctf_type_sect_size): Likewise.
112 (ctf_emit_type_sect): Likewise.
114 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
116 * ctf-impl.h (ctf_dict_t): Fix comment.
118 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
120 * ctf-create.c (symtypetab_delete_nonstatic_vars): Move
121 into ctf-serialize.c.
122 (ctf_symtab_skippable): Likewise.
123 (CTF_SYMTYPETAB_EMIT_FUNCTION): Likewise.
124 (CTF_SYMTYPETAB_EMIT_PAD): Likewise.
125 (CTF_SYMTYPETAB_FORCE_INDEXED): Likewise.
126 (symtypetab_density): Likewise.
127 (emit_symtypetab): Likewise.
128 (emit_symtypetab_index): Likewise.
129 (ctf_copy_smembers): Likewise.
130 (ctf_copy_lmembers): Likewise.
131 (ctf_copy_emembers): Likewise.
132 (ctf_sort_var): Likewise.
133 (ctf_serialize): Likewise.
134 (ctf_gzwrite): Likewise.
135 (ctf_compress_write): Likewise.
136 (ctf_write_mem): Likewise.
137 (ctf_write): Likewise.
138 * ctf-serialize.c: New file.
139 * Makefile.am (libctf_nobfd_la_SOURCES): Add it.
140 * Makefile.in: Regenerate.
142 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
144 * ctf-link.c (ctf_link_lazy_open): Move up in the file, to near
146 * ctf-lookup.c (ctf_lookup_symbol_idx): Repair tabdamage.
147 (ctf_lookup_by_sym_or_name): Likewise.
148 * testsuite/libctf-lookup/struct-iteration.c: Likewise.
149 * testsuite/libctf-regression/type-add-unnamed-struct.c: Likewise.
151 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
153 * ctf-create.c (symtypetab_density): Report the symbol name as
154 well as index in the name != object error; note the likely
156 * ctf-link.c (ctf_link_shuffle_syms): Report the symbol index
159 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
161 * ctf-link.c (ctf_link_shuffle_syms): Free ctf_dynsyms properly.
163 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
165 * ctf-dump.c (ctf_dump_format_type): Fix signed/unsigned confusion.
167 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
169 * ctf-dedup.c (ctf_dedup): Pass on errors from ctf_dedup_hash_type.
170 Call ctf_dedup_fini properly on other errors.
171 (ctf_dedup_emit_type): Set the errno on dynhash insertion failure.
172 * ctf-link.c (ctf_link_deduplicating_per_cu): Close outputs beyond
173 output 0 when asserting because >1 output is found.
174 (ctf_link_deduplicating): Likewise, when asserting because the
175 shared output is not the same as the passed-in fp.
177 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
179 * ctf-impl.h (ctf_dict_t) <ctf_link_type_mapping>: No longer used
180 by the nondeduplicating linker.
181 (ctf_add_type_mapping): Removed, now static.
182 (ctf_type_mapping): Likewise.
183 (ctf_dedup_type_mapping): New.
184 (ctf_dedup_t) <cd_input_nums>: New.
185 * ctf-dedup.c (ctf_dedup_init): Populate it.
186 (ctf_dedup_fini): Free it again. Emphasise that this has to be
187 the last thing called.
188 (ctf_dedup): Populate it.
189 (ctf_dedup_populate_type_mapping): Removed.
190 (ctf_dedup_populate_type_mappings): Likewise.
191 (ctf_dedup_emit): No longer call it. No longer call
192 ctf_dedup_fini either.
193 (ctf_dedup_type_mapping): New.
194 * ctf-link.c (ctf_unnamed_cuname): New.
195 (ctf_create_per_cu): Arguments must be non-null now.
196 (ctf_in_member_cb_arg): Removed.
197 (ctf_link): No longer populate it. No longer discard the
199 (ctf_link_deduplicating_one_symtypetab): Use
200 ctf_dedup_type_mapping, not ctf_type_mapping. Use
202 (ctf_link_one_variable): Likewise. Pass in args individually: no
203 longer a ctf_variable_iter callback.
204 (empty_link_type_mapping): Removed.
205 (ctf_link_deduplicating_variables): Use ctf_variable_next, not
206 ctf_variable_iter. No longer pack arguments to
207 ctf_link_one_variable into a struct.
208 (ctf_link_deduplicating_per_cu): Call ctf_dedup_fini once
209 all link phases are done.
210 (ctf_link_deduplicating): Likewise.
211 (ctf_link_intern_extern_string): Improve comment.
212 (ctf_add_type_mapping): Migrate...
213 (ctf_type_mapping): ... these functions...
214 * ctf-create.c (ctf_add_type_mapping): ... here...
215 (ctf_type_mapping): ... and make static, for the sole use of
218 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
220 * ctf-link.c (ctf_link_one_variable): Remove reference to
221 "unconflicted link mode".
223 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
225 * ctf-link.c (ctf_create_per_cu): Drop FILENAME now that it is
226 always identical to CUNAME.
227 (ctf_link_deduplicating_one_symtypetab): Adjust.
228 (ctf_link_one_type): Remove.
229 (ctf_link_one_input_archive_member): Likewise.
230 (ctf_link_close_one_input_archive): Likewise.
231 (ctf_link_one_input_archive): Likewise.
232 (ctf_link): No longer call it. Drop CTF_LINK_NONDEDUP path.
233 Improve header comment a bit (dicts, not files). Adjust
234 ctf_create_per_cu call.
235 (ctf_link_deduplicating_variables): Simplify.
236 (ctf_link_in_member_cb_arg_t) <cu_name>: Remove.
237 <in_input_cu_file>: Likewise.
238 <in_fp_parent>: Likewise.
239 <done_parent>: Likewise.
240 (ctf_link_one_variable): Turn uses of in_file_name to in_cuname.
242 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
244 * ctf-types.c (ctf_member_iter): Move 'rc' to an inner scope.
245 (ctf_enum_iter): Reimplement in terms of ctf_enum_next.
246 (ctf_type_iter): Reimplement in terms of ctf_type_next.
247 (ctf_type_iter_all): Likewise.
248 (ctf_variable_iter): Reimplement in terms of ctf_variable_next.
249 * ctf-archive.c (ctf_archive_iter_internal): Remove.
250 (ctf_archive_iter): Reimplement in terms of ctf_archive_next.
252 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
254 * ctf-archive.c (ctf_archive_next): Set the name of parents in
255 single-member archives.
257 2021-02-26 Alan Modra <amodra@gmail.com>
259 * Makefile.in: Regenerate.
261 2021-02-21 Alan Modra <amodra@gmail.com>
263 * configure.ac: Invoke AC_CANONICAL_TARGET, AC_CANONICAL_HOST
264 and AC_CANONICAL_BUILD.
265 * configure: Regenerate.
266 * Makefile.in: Regenerate.
268 2021-02-20 Nick Alcock <nick.alcock@oracle.com>
270 * ctf-impl.h (ctf_dict_t) <ctf_symhash>: New.
271 <ctf_symhash_latest>: Likewise.
272 (struct ctf_archive_internal) <ctfi_crossdict_cache>: New.
273 <ctfi_symnamedicts>: New.
275 (ctf_lookup_symbol_name): Remove.
276 * ctf-lookup.c (ctf_lookup_symbol_name): Propagate errors from
277 parent properly. Make static.
278 (ctf_lookup_symbol_idx): New, linear search for the symbol name,
279 cached in the crossdict cache's ctf_symhash (if available), or
280 this dict's (otherwise).
281 (ctf_try_lookup_indexed): Allow the symname to be passed in.
282 (ctf_lookup_by_symbol): Turn into a wrapper around...
283 (ctf_lookup_by_sym_or_name): ... this, supporting name lookup too,
284 using ctf_lookup_symbol_idx in non-writable dicts. Special-case
285 name lookup in dynamic dicts without reported symbols, which have
286 no symtab or dynsymidx but where name lookup should still work.
287 (ctf_lookup_by_symbol_name): New, another wrapper.
288 * ctf-archive.c (enosym): Note that this is present in
289 ctfi_symnamedicts too.
290 (ctf_arc_close): Adjust for removal of ctfi_syms. Free the
292 (ctf_arc_flush_caches): Likewise.
293 (ctf_dict_open_cached): Memoize the first cached dict in the
295 (ctf_arc_lookup_symbol): Turn into a wrapper around...
296 (ctf_arc_lookup_sym_or_name): ... this. No longer cache
297 ctf_id_t lookups: just call ctf_lookup_by_symbol as needed (but
298 still cache the dicts those lookups succeed in). Add
299 lookup-by-name support, with dicts of successful lookups cached in
300 ctfi_symnamedicts. Refactor the caching code a bit.
301 (ctf_arc_lookup_symbol_name): New, another wrapper.
302 * ctf-open.c (ctf_dict_close): Free the ctf_symhash.
303 * libctf.ver (LIBCTF_1.2): New version. Add
304 ctf_lookup_by_symbol_name, ctf_arc_lookup_symbol_name.
305 * testsuite/libctf-lookup/enum-symbol.c (main): Use
306 ctf_arc_lookup_symbol rather than looking up the name ourselves.
307 Fish it out repeatedly, to make sure that symbol caching isn't
311 * testsuite/libctf-lookup/enum-symbol-obj.lk: Test symbol lookup
312 in an unlinked object file (indexed symtypetab sections only).
313 * testsuite/libctf-writable/symtypetab-nonlinker-writeout.c
314 (try_maybe_reporting): Check symbol types via
315 ctf_lookup_by_symbol_name as well as ctf_symbol_next.
316 * testsuite/libctf-lookup/conflicting-type-syms.*: New test of
317 lookups in a multi-dict archive.
319 2021-02-20 Alan Modra <amodra@gmail.com>
321 * testsuite/config/default.exp (ld_L_opt): Define.
322 * testsuite/lib/ctf-lib.exp (load_common_lib): Delete. Instead load
324 (run_host_cmd, run_host_cmd_yesno, check_compiler_available): Delete.
325 (compile_one_cc, check_ctf_available): Delete.
327 2021-02-03 Nick Alcock <nick.alcock@oracle.com>
329 * configure.ac (ac_cv_libctf_bfd_elf): Include string.h.
330 * configure: Regenerated.
332 2021-02-03 Nick Alcock <nick.alcock@oracle.com>
334 * configure.ac (EXPECT): Check for, in order to define...
335 (TCL_TRY): ... this, if Tcl supports try/catch.
336 * Makefile.am (TCL_TRY): Run the testsuite only if set.
337 * configure: Regenerated.
338 * Makefile.in: Likewise.
340 2021-02-02 Nick Alcock <nick.alcock@oracle.com>
342 * configure.ac (CTF_LIBADD): Remove explicit -lintl population in
344 * Makefile.am (libctf_nobfd_la_LIBADD): No longer explicitly
346 (check-DEJAGNU): Pass down to tests as well.
347 * configure: Regenerated.
348 * Makefile.in: Likewise.
350 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
352 * ctf-string.c (ctf_str_add): Treat adding a NULL as adding "".
353 (ctf_str_add_ref): Likewise.
354 (ctf_str_add_external): Likewise.
355 * ctf-types.c (ctf_type_name_raw): Always return "" for offset 0.
356 * ctf-dedup.c (ctf_dedup_multiple_input_dicts): Don't armour
358 (ctf_dedup_maybe_synthesize_forward): Likewise.
360 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
362 * ctf-create.c (ctf_serialize): Fix shadowing.
364 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
366 * ctf-create.c (ctf_add_encoded): Add check for non-empty name.
367 (ctf_add_forward): Likewise.
368 (ctf_add_typedef): Likewise.
370 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
372 * ctf-open.c (init_types): Rip out code to check anonymous typedef
374 * ctf-create.c (ctf_add_reftype): Likewise.
375 * ctf-lookup.c (refresh_pptrtab): Likewise.
377 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
379 * ctf-impl.c (_libctf_nonnull_): Add parameters.
380 (LCTF_LINKING): New flag.
381 (ctf_dict_t) <ctf_link_flags>: Mention it.
382 * ctf-link.c (ctf_link): Keep LCTF_LINKING set across call.
383 (ctf_write): Likewise, including in child dictionaries.
384 (ctf_link_shuffle_syms): Make sure ctf_dynsyms is NULL if there
385 are no reported symbols.
386 * ctf-create.c (symtypetab_delete_nonstatic_vars): Make sure
387 the variable has been reported as a symbol by the linker.
388 (symtypetab_skippable): Mention relationship between SYMFP and the
390 (symtypetab_density): Adjust nonnullity. Exit early if no symbols
391 were reported and force-indexing is off (i.e., we are doing a
393 (ctf_serialize): Handle the !LCTF_LINKING case by writing out an
394 indexed, sorted symtypetab (and allow SYMFP to be NULL in this
395 case). Turn sorting off if this is a non-final link. Only delete
396 nonstatic vars if we are filtering symbols and the linker has
398 * testsuite/libctf-regression/nonstatic-var-section-ld-r*:
399 New test of variable and symtypetab section population when
401 * testsuite/libctf-regression/nonstatic-var-section-ld-executable.lk:
402 Likewise, when ld of an executable is used.
403 * testsuite/libctf-regression/nonstatic-var-section-ld.lk:
404 Likewise, when ld -shared alone is used.
405 * testsuite/libctf-regression/nonstatic-var-section-ld*.c:
406 Lookup programs for the above.
407 * testsuite/libctf-writable/symtypetab-nonlinker-writeout.*: New
408 test, testing survival of symbols across ctf_write paths.
409 * testsuite/lib/ctf-lib.exp (run_lookup_test): New option,
410 nonshared, suppressing linking of the SOURCE with -shared.
412 2021-01-19 Nick Alcock <nick.alcock@oracle.com>
414 * ctf-create.c (membadd): Transform ""-named members into
416 * testsuite/libctf-regression/type-add-unnamed-struct*: New test.
418 2021-01-19 Nick Alcock <nick.alcock@oracle.com>
420 * ctf-lookup.c (ctf_lookup_by_name_internal): Do not return the
421 base type if looking up a nonexistent pointer type.
422 * testsuite/libctf-regression/pptrtab*: Test it.
424 2021-01-13 Alan Modra <amodra@gmail.com>
426 * Makefile.in: Regenerate.
428 2021-01-12 H.J. Lu <hongjiu.lu@intel.com>
431 * configure.ac: Use GNU_MAKE_JOBSERVER.
432 * aclocal.m4: Regenerated.
433 * configure: Likewise.
435 2021-01-11 H.J. Lu <hongjiu.lu@intel.com>
438 * configure: Regenerated.
440 2021-01-09 H.J. Lu <hongjiu.lu@intel.com>
442 * configure: Regenerated.
444 2021-01-09 Nick Clifton <nickc@redhat.com>
446 * 2.36 release branch crated.
448 2021-01-09 Alan Modra <amodra@gmail.com>
450 * configure: Regenerate.
452 2021-01-07 Samuel Thibault <samuel.thibault@gnu.org>
454 * configure: Regenerate.
456 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
458 * testsuite/libctf-lookup/struct-iteration.c (main):
459 ctf_member_count returns an int.
461 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
463 * Makefile.am (BASEDIR): New.
465 (check-DEJAGNU): Add development.exp to prerequisites.
466 (development.exp): New.
467 (CONFIG_STATUS_DEPENDENCIES): New.
468 (EXTRA_DEJAGNU_SITE_CONFIG): Likewise.
469 (DISTCLEANFILES): Likewise.
470 * Makefile.in: Regenerated.
471 * testsuite/lib/ctf-lib.exp (check_ctf_available): Return boolean.
472 * testsuite/libctf-lookup/lookup.exp: Call check_ctf_available.
473 * testsuite/libctf-regression/regression.exp: Likewise.
475 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
477 * ctf-types.c (ctf_type_aname): Print forwards to unions and enums
480 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
482 * ctf-impl.h (ctf_dict_t) <ctf_pptrtab>: New.
483 <ctf_pptrtab_len>: New.
484 <ctf_pptrtab_typemax>: New.
485 * ctf-create.c (ctf_serialize): Update accordingly.
486 (ctf_add_reftype): Note that we don't need to update pptrtab here,
487 despite updating ptrtab.
488 * ctf-open.c (ctf_dict_close): Destroy the pptrtab.
489 (ctf_import): Likewise.
490 (ctf_import_unref): Likewise.
491 * ctf-lookup.c (grow_pptrtab): New.
492 (refresh_pptrtab): New, update a pptrtab.
493 (ctf_lookup_by_name): Turn into a wrapper around (and rename to)...
494 (ctf_lookup_by_name_internal): ... this: construct the pptrtab, and
495 use it in addition to the parent's ptrtab when parent dicts are
497 * testsuite/libctf-regression/regression.exp: New testsuite for
499 * testsuite/libctf-regression/pptrtab*: New test.
500 * testsuite/libctf-writable/writable.exp: New testsuite for tests of
502 * testsuite/libctf-writable/pptrtab*: New test.
504 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
506 * ctf-archive.c (ctf_archive_iter): Remove outdated comment.
508 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
510 * ctf-impl.h (struct ctf_next) <u.ctn_next>: Move to...
511 <ctn_next>: ... here.
512 * ctf-util.c (ctf_next_destroy): Unconditionally destroy it.
513 * ctf-lookup.c (ctf_symbol_next): Adjust accordingly.
514 * ctf-types.c (ctf_member_iter): Reimplement in terms of...
515 (ctf_member_next): ... this. Support recursive unnamed member
516 iteration (off by default).
517 (ctf_member_info): Look up members in unnamed sub-structs.
518 * ctf-dedup.c (ctf_dedup_rhash_type): Adjust ctf_member_next call.
519 (ctf_dedup_emit_struct_members): Likewise.
520 * testsuite/libctf-lookup/struct-iteration-ctf.c: Test empty unnamed
521 members, and a normal member after the end.
522 * testsuite/libctf-lookup/struct-iteration.c: Verify that
523 ctf_member_count is consistent with the number of successful returns
524 from a non-recursive ctf_member_next.
525 * testsuite/libctf-lookup/struct-iteration-*: New, test iteration
527 * testsuite/libctf-lookup/struct-lookup.c: New test.
528 * testsuite/libctf-lookup/struct-lookup.lk: New test.
530 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
532 * ctf-link.c (ctf_link_warn_outdated_inputs): New.
533 (ctf_link_write): Call it.
535 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
537 * testsuite/libctf-lookup/enum-symbol.lk: New symbol-lookup test.
538 * testsuite/libctf-lookup/enum-symbol-ctf.c: New CTF input.
539 * testsuite/libctf-lookup/enum-symbol.c: New lookup test.
541 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
543 * Makefile.am (EXPECT): New.
545 (RUNTESTFLAGS): Likewise.
546 (CC_FOR_TARGET): Likewise.
547 (check-DEJAGNU): Likewise.
548 (AUTOMAKE_OPTIONS): Add dejagnu.
549 * Makefile.in: Regenerated.
550 * testsuite/config/default.exp: New.
551 * testsuite/lib/ctf-lib.exp: Likewise.
552 * testsuite/libctf-lookup/enum.lk: New test.
553 * testsuite/libctf-lookup/enum-ctf.c: New CTF input.
554 * testsuite/libctf-lookup/enum.c: New lookup test.
555 * testsuite/libctf-lookup/ambiguous-struct*.c: New test.
556 * testsuite/libctf-lookup/lookup.exp: New.
558 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
560 * configure.ac (BFD_LIBADD): Remove.
561 (BFD_DEPENDENCIES): Likewise. Remove associated cases.
562 (SHARED_LIBADD): Rename to...
563 (CTF_LIBADD): ... this. Stick in a suitable libiberty even when
565 * Makefile.am (libctf_nobfd_la_LIBADD): Adjust accordingly.
567 (libctf_la_LIBADD): Reference libbfd.la directly, not via
569 (libctf_la_DEPENDENCIES): Remove.
570 * Makefile.in: Regenerate.
571 * configure: Likewise.
573 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
575 * ctf-decl.c (ctf_decl_push): Exclude slices from the decl stack.
576 * ctf-types.c (ctf_type_aname): No longer deal with slices here.
577 * ctf-dump.c (ctf_dump_membstate_t) <cdm_toplevel_indent>: Constify.
579 (CTF_FT_BITFIELD): Likewise.
580 (CTF_FT_ID): Likewise.
581 (ctf_dump_member): Do not do indentation here. Migrate the
582 type-printing parts of this into...
583 (ctf_dump_format_type): ... here, to be shared by all type printers.
584 Get the errno value for non-representable types right. Do not print
585 bitfield info for non-bitfields. Improve the format and indentation
586 of other type output. Shuffle spacing around to make all indentation
587 either 'width of column' or 4 chars.
588 (ctf_dump_label): Pass CTF_FT_REFS to ctf_dump_format_type.
589 (ctf_dump_objts): Likewise. Spacing shuffle.
590 (ctf_dump_var): Likewise.
591 (type_hex_digits): Migrate down in the file, to above its new user.
592 (ctf_dump_type): Indent here instead. Pass CTF_FT_REFS to
593 ctf_dump_format_type. Don't trim off excess linefeeds now we no
594 longer generate them. Dump enumerated types.
596 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
598 * ctf-types.c (ctf_type_resolve): Improve comment.
599 (ctf_type_size): Yield ECTF_INCOMPLETE when applied to forwards.
600 Emit errors into the right dict.
601 (ctf_type_align): Likewise.
602 * ctf-create.c (ctf_add_member_offset): Yield ECTF_INCOMPLETE
603 when adding a member without explicit offset when this member, or
604 the previous member, is incomplete.
605 * ctf-dump.c (ctf_dump_format_type): Do not try to print the size of
607 (ctf_dump_member): Do not try to print their alignment.
609 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
611 * ctf-dump.c (ctf_dump_objts): Dump by calling ctf_dump_format_type.
612 (ctf_dump_format_type): Don't emit the size for function objects.
613 Dump the element type of arrays like we dump the pointed-to type of
616 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
618 * ctf-dump.c (ctf_dump_format_type): Add 0x to hex type IDs.
619 (ctf_dump_header): Add 0x to the hex magic number.
620 (ctf_dump_str): Add 0x to the hex string offsets.
621 (ctf_dump_membstate_t) <cdm_toplevel_indent>: New.
622 (ctf_dump_type): Adjust. Free it when we're done.
623 (type_hex_digits): New.
624 (ctf_dump_member): Align output depending on the width of the type
625 ID being generated. Use printf padding, not a loop, to generate
628 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
630 * ctf-decl.c (ctf_decl_push): Don't print array decls backwards.
632 2021-01-04 Nicolas Boulenguez <nicolas@debian.org>
635 * configure.ac: Make AC_CONFIG_MACRO_DIR consistent with
636 ACLOCAL_AMFLAGS -I dirs.
637 * configure: Regenerate.
639 2021-01-01 Alan Modra <amodra@gmail.com>
641 Update year range in copyright notice of all files.
643 For older changes see ChangeLog-2020
645 Copyright (C) 2021 Free Software Foundation, Inc.
647 Copying and distribution of this file, with or without modification,
648 are permitted in any medium without royalty provided the copyright
649 notice and this notice are preserved.
655 version-control: never