[gdb/testsuite] Fix filename in gdb.debuginfod/crc_mismatch.exp
[binutils-gdb.git] / libctf / ChangeLog
blob1c6e454420aebbaedcc06146c6ec41662031b95b
1 2022-12-31  Nick Clifton  <nickc@redhat.com>
3         * 2.40 branch created.
5 2022-07-08  Nick Clifton  <nickc@redhat.com>
7         * 2.39 branch created.
9 2022-01-22  Nick Clifton  <nickc@redhat.com>
11         * 2.38 release branch created.
13 2021-11-08  Nick Alcock  <nick.alcock@oracle.com>
15         * doc/ctf-spec.texi: New file.
16         * configure.ac (MAKEINFO): Add.
17         (BUILD_INFO): Likewise.
18         (AC_CONFIG_FILES) [doc/Makefile]: Add.
19         * Makefile.am [BUILD_INFO] (SUBDIRS): Add doc/.
20         * doc/Makefile.am: New file.
21         * doc/Makefile.in: Likewise.
22         * configure: Regenerated.
23         * Makefile.in: Likewise.
25 2021-10-25  Nick Alcock  <nick.alcock@oracle.com>
27         * ctf-types.c (ctf_type_rvisit): Handle nonrepresentable types.
29 2021-10-25  Nick Alcock  <nick.alcock@oracle.com>
31         * ctf-dump.c (ctf_dump_type): Do not abort on error.
33 2021-09-27  Nick Alcock  <nick.alcock@oracle.com>
35         * ctf-lookup.c (ctf_lookup_by_name_internal): Fix pptrtab bounds.
36         * testsuite/libctf-writable/pptrtab-writable-page-deep-lookup.*:
37         New test.
39 2021-09-27  Nick Alcock  <nick.alcock@oracle.com>
41         * testsuite/libctf-lookup/enum-symbol.c: Remove unused label.
42         * testsuite/libctf-lookup/conflicting-type-syms.c: Remove unused
43         variables.
44         * testsuite/libctf-regression/pptrtab.c: Likewise.
45         * testsuite/libctf-regression/type-add-unnamed-struct.c: Likewise.
46         * testsuite/libctf-writable/pptrtab.c: Likewise.
47         * testsuite/libctf-writable/reserialize-strtab-corruption.c:
48         Likewise.
49         * testsuite/libctf-regression/nonstatic-var-section-ld-r.c: Fix
50         format string.
51         * testsuite/libctf-regression/nonstatic-var-section-ld.c:
52         Likewise.
53         * testsuite/libctf-regression/nonstatic-var-section-ld.lk: Adjust.
54         * testsuite/libctf-writable/symtypetab-nonlinker-writeout.c: Fix
55         initializer.
57 2021-09-27  Nick Alcock  <nick.alcock@oracle.com>
59         * ctf-open.c (ctf_bufopen_internal): Don't complain about corrupt
60         function index symtypetab sections if this is an old-format
61         function symtypetab section (which should be ignored in any case).
62         Fix bad grammar.
64 2021-09-27  Nick Alcock  <nick.alcock@oracle.com>
66         * configure: Regenerate.
67         * Makefile.in: Regenerate.
69 2021-09-27  Nick Alcock  <nick.alcock@oracle.com>
71         PR libctf/27967
72         * configure.ac (VERSION_FLAGS): Replace with...
73         (ac_cv_libctf_version_script): ... this multiple test.
74         (VERSION_FLAGS_NOBFD): Substitute this too.
75         * Makefile.am (libctf_nobfd_la_LDFLAGS): Use it.  Split out...
76         (libctf_ldflags_nover): ... non-versioning flags here.
77         (libctf_la_LDFLAGS): Use it.
78         * libctf.ver: Give every symbol not in libctf-nobfd a comment on
79         the same line noting as much.
81 2021-09-27  Nick Alcock  <nick.alcock@oracle.com>
83         PR libctf/27360
84         * Makefile.am (libctf_la_LIBADD): Link against libiberty
85         before pulling in libbfd.la or pulling in libctf-nobfd.la.
86         * Makefile.in: Regenerate.
88 2021-07-03  Nick Clifton  <nickc@redhat.com>
90         * 2.37 release branch created.
92 2021-05-09  Alan Modra  <amodra@gmail.com>
94         * ctf-impl.h (ctf_dynset_eq_string): Don't declare.
95         * ctf-hash.c (ctf_dynset_eq_string): Delete function.
96         * ctf-dedup.c (make_set_element): Use htab_eq_string.
97         (ctf_dedup_atoms_init, ADD_CITER, ctf_dedup_init): Likewise.
98         (ctf_dedup_conflictify_unshared): Likewise.
99         (ctf_dedup_walk_output_mapping): Likewise.
101 2021-05-06  Nick Alcock  <nick.alcock@oracle.com>
103         * testsuite/lib/ctf-lib.exp: Use -gctf, not -gt.
104         * testsuite/libctf-regression/nonstatic-var-section-ld-r.lk:
105         Hidden symbols now get into the symtypetab anyway.
107 2021-05-06  Nick Alcock  <nick.alcock@oracle.com>
109         * ctf-open.c (init_types): Unknown types may have names.
110         * ctf-types.c (ctf_type_resolve): CTF_K_UNKNOWN is as
111         non-representable as type ID 0.
112         (ctf_type_aname): Print unknown types.
113         * ctf-dedup.c (ctf_dedup_hash_type): Do not early-exit for
114         CTF_K_UNKNOWN types: they have real hash values now.
115         (ctf_dedup_rwalk_one_output_mapping): Treat CTF_K_UNKNOWN types
116         like other types with no referents: call the callback and do not
117         skip them.
118         (ctf_dedup_emit_type): Emit via...
119         * ctf-create.c (ctf_add_unknown): ... this new function.
120         * libctf.ver (LIBCTF_1.2): Add it.
122 2021-03-25  Nick Alcock  <nick.alcock@oracle.com>
124         * configure.ac: Check for dlsym, not dlopen.
125         * configure: Regenerate.
127 2021-03-25  Nick Alcock  <nick.alcock@oracle.com>
129         * testsuite/libctf-writable/symtypetab-nonlinker-writeout.c: Don't
130         leak buf.
132 2021-03-25  Nick Alcock  <nick.alcock@oracle.com>
134         PR libctf/27628
135         * ctf-lookup.c (isqualifier): Don't dereference out-of-bounds
136         qhash values.
138 2021-03-25  Nick Alcock  <nick.alcock@oracle.com>
140         * ctf-open-bfd.c (ctf_bfdopen_ctfsect): Initialize debugging.
142 2021-03-25  Nick Alcock  <nick.alcock@oracle.com>
144         PR libctf/27628
145         * ctf-serialize.c (ctf_emit_type_sect): Allow for a NULL vlen in
146         CTF_K_FUNCTION types.
148 2021-03-25  Nick Alcock  <nick.alcock@oracle.com>
150         * ctf-dump.c (ctf_dump_format_type): Don't emit size or alignment
151         on error.
153 2021-03-21  Alan Modra  <amodra@gmail.com>
155         * ctf-impl.h: Include string.h.
157 2021-03-18  Nick Alcock  <nick.alcock@oracle.com>
159         * ctf-types.c (ctf_type_encoding): Support, after a fashion, for enums.
160         * ctf-dump.c (ctf_dump_format_type): Do not report enums' degenerate
161         encoding.
163 2021-03-18  Nick Alcock  <nick.alcock@oracle.com>
165         * ctf-dedup.c (ctf_dedup_rhash_type): Report errors on the input
166         dict properly.
167         * ctf-open.c (ctf_bufopen_internal): Report errors initializing
168         the atoms table.
170 2021-03-18  Nick Alcock  <nick.alcock@oracle.com>
172         * ctf-impl.h (ctf_next_t) <ctn_tp>: New.
173         <u.ctn_mp>: Remove.
174         <u.ctn_lmp>: Remove.
175         <u.ctn_vlen>: New.
176         * ctf-types.c (ctf_struct_member): New.
177         (ctf_member_next): Use it, dropping separate large/small code paths.
178         (ctf_type_align): Likewise.
179         (ctf_member_info): Likewise.
180         (ctf_type_rvisit): Likewise.
182 2021-03-18  Nick Alcock  <nick.alcock@oracle.com>
184         * ctf-impl.h (ctf_dtdef_t) <dtu_members>: Remove.
185         <dtd_u>: Likewise.
186         (ctf_dmdef_t): Remove.
187         (struct ctf_next) <u.ctn_dmd>: Remove.
188         * ctf-create.c (INITIAL_VLEN): New, more-or-less arbitrary initial
189         vlen size.
190         (ctf_add_enum): Use it.
191         (ctf_dtd_delete): Do not free the (removed) dmd; remove string
192         refs from the vlen on struct deletion.
193         (ctf_add_struct_sized): Populate the vlen: do it by hand if
194         promoting forwards.  Always populate the full-size
195         lsizehi/lsizelo members.
196         (ctf_add_union_sized): Likewise.
197         (ctf_add_member_offset): Set up the vlen rather than the dmd.
198         Expand it as needed, repointing string refs via
199         ctf_str_move_pending. Add the member names as pending strings.
200         Always populate the full-size lsizehi/lsizelo members.
201         (membadd): Remove, folding back into...
202         (ctf_add_type_internal): ... here, adding via an ordinary
203         ctf_add_struct_sized and _next iteration rather than doing
204         everything by hand.
205         * ctf-serialize.c (ctf_copy_smembers): Remove this...
206         (ctf_copy_lmembers): ... and this...
207         (ctf_emit_type_sect): ... folding into here. Figure out if a
208         ctf_stype_t is needed here, not in ctf_add_*_sized.
209         (ctf_type_sect_size): Figure out the ctf_stype_t stuff the same
210         way here.
211         * ctf-types.c (ctf_member_next): Remove the dmd path and always
212         use the vlen.  Force large-structure usage for dynamic types.
213         (ctf_type_align): Likewise.
214         (ctf_member_info): Likewise.
215         (ctf_type_rvisit): Likewise.
216         * testsuite/libctf-regression/type-add-unnamed-struct-ctf.c: Add a
217         self-referential type to this test.
218         * testsuite/libctf-regression/type-add-unnamed-struct.c: Adjusted
219         accordingly.
220         * testsuite/libctf-regression/type-add-unnamed-struct.lk: Likewise.
222 2021-03-18  Nick Alcock  <nick.alcock@oracle.com>
224         * ctf-impl.h (ctf_dtdef_t) <dtd_vlen_alloc>: New.
225         (ctf_str_move_pending): Declare.
226         * ctf-string.c (ctf_str_add_ref_internal): Fix error return.
227         (ctf_str_move_pending): New.
228         * ctf-create.c (ctf_grow_vlen): New.
229         (ctf_dtd_delete): Zero out the vlen_alloc after free.  Free the
230         vlen later: iterate over it and free enum name refs first.
231         (ctf_add_generic): Populate dtd_vlen_alloc from vlen.
232         (ctf_add_enum): populate the vlen; do it by hand if promoting
233         forwards.
234         (ctf_add_enumerator): Set up the vlen rather than the dmd.  Expand
235         it as needed, repointing string refs via ctf_str_move_pending. Add
236         the enumerand names as pending strings.
237         * ctf-serialize.c (ctf_copy_emembers): Remove.
238         (ctf_emit_type_sect): Copy the vlen into place and ref the
239         strings.
240         * ctf-types.c (ctf_enum_next): The dynamic portion now uses
241         the same code as the non-dynamic.
242         (ctf_enum_name): Likewise.
243         (ctf_enum_value): Likewise.
244         * testsuite/libctf-lookup/enum-many-ctf.c: New test.
245         * testsuite/libctf-lookup/enum-many.lk: New test.
247 2021-03-18  Nick Alcock  <nick.alcock@oracle.com>
249         * ctf-hash.c (ctf_dynset_elements): New.
250         * ctf-impl.h (ctf_dynset_elements): Declare it.
251         (ctf_str_add_pending): Likewise.
252         (ctf_dict_t) <ctf_str_pending_ref>: New, set of refs that must be
253         added during serialization.
254         * ctf-string.c (ctf_str_create_atoms): Initialize it.
255         (CTF_STR_ADD_REF): New flag.
256         (CTF_STR_MAKE_PROVISIONAL): Likewise.
257         (CTF_STR_PENDING_REF): Likewise.
258         (ctf_str_add_ref_internal): Take a flags word rather than int
259         params.  Populate, and clear out, ctf_str_pending_ref.
260         (ctf_str_add): Adjust accordingly.
261         (ctf_str_add_external): Likewise.
262         (ctf_str_add_pending): New.
263         (ctf_str_remove_ref): Also remove the potential ref if it is a
264         pending ref.
265         * ctf-serialize.c (ctf_serialize): Prohibit addition of strings
266         with ctf_str_add_ref before serialization.  Ensure that the
267         ctf_str_pending_ref set is empty before strtab finalization.
268         (ctf_emit_type_sect): Add a ref to the ctt_name.
269         * ctf-create.c (ctf_add_generic): Add the ctt_name as a pending
270         ref.
271         * testsuite/libctf-writable/reserialize-strtab-corruption.*: New test.
273 2021-03-18  Nick Alcock  <nick.alcock@oracle.com>
275         * ctf-serialize.c (ctf_serialize): Preserve ctf_typemax across
276         serialization.
278 2021-03-18  Nick Alcock  <nick.alcock@oracle.com>
280         * ctf-impl.h (ctf_dtdef_t) <dtd_u.dtu_argv>: Remove.
281         * ctf-create.c (ctf_dtd_delete): No longer free it.
282         (ctf_add_function): Use the dtd_vlen, not dtu_argv.  Properly align.
283         * ctf-serialize.c (ctf_emit_type_sect): Just copy the dtd_vlen.
284         * ctf-types.c (ctf_func_type_info): Just use the vlen.
285         (ctf_func_type_args): Likewise.
287 2021-03-18  Nick Alcock  <nick.alcock@oracle.com>
289         * ctf-impl.h (ctf_dtdef_t) <dtd_u.dtu_arr>: Remove.
290         * ctf-create.c (ctf_add_array): Use the dtd_vlen, not dtu_arr.
291         (ctf_set_array): Likewise.
292         * ctf-serialize.c (ctf_emit_type_sect): Just copy the dtd_vlen.
293         * ctf-types.c (ctf_array_info): Just use the vlen.
295 2021-03-18  Nick Alcock  <nick.alcock@oracle.com>
297         * ctf-impl.h (ctf_dtdef_t) <dtd_u.dtu_enc>: Remove.
298         <dtd_u.dtu_slice>: Likewise.
299         <dtd_vlen>: New.
300         * ctf-create.c (ctf_add_generic): Perhaps allocate it.  All
301         callers adjusted.
302         (ctf_dtd_delete): Free it.
303         (ctf_add_slice): Use the dtd_vlen, not dtu_enc.
304         (ctf_add_encoded): Likewise.  Assert that this must be an int or
305         float.
306         * ctf-serialize.c (ctf_emit_type_sect): Just copy the dtd_vlen.
307         * ctf-dedup.c (ctf_dedup_rhash_type): Use the dtd_vlen, not
308         dtu_slice.
309         * ctf-types.c (ctf_type_reference): Likewise.
310         (ctf_type_encoding): Remove most dynamic-type-specific code: just
311         get the vlen from the right place.  Report failure to look up the
312         underlying type's encoding.
314 2021-03-18  Nick Alcock  <nick.alcock@oracle.com>
316         * ctf-archive.c (ctf_archive_next): GNU style fix for do {} while.
317         * ctf-dedup.c (ctf_dedup_rhash_type): Likewise.
318         (ctf_dedup_rwalk_one_output_mapping): Likewise.
319         * ctf-dump.c (ctf_dump_format_type): Likewise.
320         * ctf-lookup.c (ctf_symbol_next): Likewise.
321         * swap.h (swap_thing): Likewise.
323 2021-03-18  Nick Alcock  <nick.alcock@oracle.com>
325         * ctf-serialize.c: General reshuffling, and...
326         (emit_symtypetab_state_t): New, migrated from
327         local variables in ctf_serialize.
328         (ctf_serialize): Split out most section sizing and
329         emission.
330         (ctf_symtypetab_sect_sizes): New (split out).
331         (ctf_emit_symtypetab_sects): Likewise.
332         (ctf_type_sect_size): Likewise.
333         (ctf_emit_type_sect): Likewise.
335 2021-03-18  Nick Alcock  <nick.alcock@oracle.com>
337         * ctf-impl.h (ctf_dict_t): Fix comment.
339 2021-03-18  Nick Alcock  <nick.alcock@oracle.com>
341         * ctf-create.c (symtypetab_delete_nonstatic_vars): Move
342         into ctf-serialize.c.
343         (ctf_symtab_skippable): Likewise.
344         (CTF_SYMTYPETAB_EMIT_FUNCTION): Likewise.
345         (CTF_SYMTYPETAB_EMIT_PAD): Likewise.
346         (CTF_SYMTYPETAB_FORCE_INDEXED): Likewise.
347         (symtypetab_density): Likewise.
348         (emit_symtypetab): Likewise.
349         (emit_symtypetab_index): Likewise.
350         (ctf_copy_smembers): Likewise.
351         (ctf_copy_lmembers): Likewise.
352         (ctf_copy_emembers): Likewise.
353         (ctf_sort_var): Likewise.
354         (ctf_serialize): Likewise.
355         (ctf_gzwrite): Likewise.
356         (ctf_compress_write): Likewise.
357         (ctf_write_mem): Likewise.
358         (ctf_write): Likewise.
359         * ctf-serialize.c: New file.
360         * Makefile.am (libctf_nobfd_la_SOURCES): Add it.
361         * Makefile.in: Regenerate.
363 2021-03-18  Nick Alcock  <nick.alcock@oracle.com>
365         * ctf-link.c (ctf_link_lazy_open): Move up in the file, to near
366         ctf_link_add_ctf.
367         * ctf-lookup.c (ctf_lookup_symbol_idx): Repair tabdamage.
368         (ctf_lookup_by_sym_or_name): Likewise.
369         * testsuite/libctf-lookup/struct-iteration.c: Likewise.
370         * testsuite/libctf-regression/type-add-unnamed-struct.c: Likewise.
372 2021-03-02  Nick Alcock  <nick.alcock@oracle.com>
374         * ctf-create.c (symtypetab_density): Report the symbol name as
375         well as index in the name != object error; note the likely
376         consequences.
377         * ctf-link.c (ctf_link_shuffle_syms): Report the symbol index
378         as well as name.
380 2021-03-02  Nick Alcock  <nick.alcock@oracle.com>
382         * ctf-link.c (ctf_link_shuffle_syms): Free ctf_dynsyms properly.
384 2021-03-02  Nick Alcock  <nick.alcock@oracle.com>
386         * ctf-dump.c (ctf_dump_format_type): Fix signed/unsigned confusion.
388 2021-03-02  Nick Alcock  <nick.alcock@oracle.com>
390         * ctf-dedup.c (ctf_dedup): Pass on errors from ctf_dedup_hash_type.
391         Call ctf_dedup_fini properly on other errors.
392         (ctf_dedup_emit_type): Set the errno on dynhash insertion failure.
393         * ctf-link.c (ctf_link_deduplicating_per_cu): Close outputs beyond
394         output 0 when asserting because >1 output is found.
395         (ctf_link_deduplicating): Likewise, when asserting because the
396         shared output is not the same as the passed-in fp.
398 2021-03-02  Nick Alcock  <nick.alcock@oracle.com>
400         * ctf-impl.h (ctf_dict_t) <ctf_link_type_mapping>: No longer used
401         by the nondeduplicating linker.
402         (ctf_add_type_mapping): Removed, now static.
403         (ctf_type_mapping): Likewise.
404         (ctf_dedup_type_mapping): New.
405         (ctf_dedup_t) <cd_input_nums>: New.
406         * ctf-dedup.c (ctf_dedup_init): Populate it.
407         (ctf_dedup_fini): Free it again.  Emphasise that this has to be
408         the last thing called.
409         (ctf_dedup): Populate it.
410         (ctf_dedup_populate_type_mapping): Removed.
411         (ctf_dedup_populate_type_mappings): Likewise.
412         (ctf_dedup_emit): No longer call it.  No longer call
413         ctf_dedup_fini either.
414         (ctf_dedup_type_mapping): New.
415         * ctf-link.c (ctf_unnamed_cuname): New.
416         (ctf_create_per_cu): Arguments must be non-null now.
417         (ctf_in_member_cb_arg): Removed.
418         (ctf_link): No longer populate it.  No longer discard the
419         mapping table.
420         (ctf_link_deduplicating_one_symtypetab): Use
421         ctf_dedup_type_mapping, not ctf_type_mapping.  Use
422         ctf_unnamed_cuname.
423         (ctf_link_one_variable): Likewise.  Pass in args individually: no
424         longer a ctf_variable_iter callback.
425         (empty_link_type_mapping): Removed.
426         (ctf_link_deduplicating_variables): Use ctf_variable_next, not
427         ctf_variable_iter.  No longer pack arguments to
428         ctf_link_one_variable into a struct.
429         (ctf_link_deduplicating_per_cu): Call ctf_dedup_fini once
430         all link phases are done.
431         (ctf_link_deduplicating): Likewise.
432         (ctf_link_intern_extern_string): Improve comment.
433         (ctf_add_type_mapping): Migrate...
434         (ctf_type_mapping): ... these functions...
435         * ctf-create.c (ctf_add_type_mapping): ... here...
436         (ctf_type_mapping): ... and make static, for the sole use of
437         ctf_add_type.
439 2021-03-02  Nick Alcock  <nick.alcock@oracle.com>
441         * ctf-link.c (ctf_link_one_variable): Remove reference to
442         "unconflicted link mode".
444 2021-03-02  Nick Alcock  <nick.alcock@oracle.com>
446         * ctf-link.c (ctf_create_per_cu): Drop FILENAME now that it is
447         always identical to CUNAME.
448         (ctf_link_deduplicating_one_symtypetab): Adjust.
449         (ctf_link_one_type): Remove.
450         (ctf_link_one_input_archive_member): Likewise.
451         (ctf_link_close_one_input_archive): Likewise.
452         (ctf_link_one_input_archive): Likewise.
453         (ctf_link): No longer call it.  Drop CTF_LINK_NONDEDUP path.
454         Improve header comment a bit (dicts, not files).  Adjust
455         ctf_create_per_cu call.
456         (ctf_link_deduplicating_variables): Simplify.
457         (ctf_link_in_member_cb_arg_t) <cu_name>: Remove.
458         <in_input_cu_file>: Likewise.
459         <in_fp_parent>: Likewise.
460         <done_parent>: Likewise.
461         (ctf_link_one_variable): Turn uses of in_file_name to in_cuname.
463 2021-03-02  Nick Alcock  <nick.alcock@oracle.com>
465         * ctf-types.c (ctf_member_iter): Move 'rc' to an inner scope.
466         (ctf_enum_iter): Reimplement in terms of ctf_enum_next.
467         (ctf_type_iter): Reimplement in terms of ctf_type_next.
468         (ctf_type_iter_all): Likewise.
469         (ctf_variable_iter): Reimplement in terms of ctf_variable_next.
470         * ctf-archive.c (ctf_archive_iter_internal): Remove.
471         (ctf_archive_iter): Reimplement in terms of ctf_archive_next.
473 2021-03-02  Nick Alcock  <nick.alcock@oracle.com>
475         * ctf-archive.c (ctf_archive_next): Set the name of parents in
476         single-member archives.
478 2021-02-26  Alan Modra  <amodra@gmail.com>
480         * Makefile.in: Regenerate.
482 2021-02-21  Alan Modra  <amodra@gmail.com>
484         * configure.ac: Invoke AC_CANONICAL_TARGET, AC_CANONICAL_HOST
485         and AC_CANONICAL_BUILD.
486         * configure: Regenerate.
487         * Makefile.in: Regenerate.
489 2021-02-20  Nick Alcock  <nick.alcock@oracle.com>
491         * ctf-impl.h (ctf_dict_t) <ctf_symhash>: New.
492         <ctf_symhash_latest>: Likewise.
493         (struct ctf_archive_internal) <ctfi_crossdict_cache>: New.
494         <ctfi_symnamedicts>: New.
495         <ctfi_syms>: Remove.
496         (ctf_lookup_symbol_name): Remove.
497         * ctf-lookup.c (ctf_lookup_symbol_name): Propagate errors from
498         parent properly.  Make static.
499         (ctf_lookup_symbol_idx): New, linear search for the symbol name,
500         cached in the crossdict cache's ctf_symhash (if available), or
501         this dict's (otherwise).
502         (ctf_try_lookup_indexed): Allow the symname to be passed in.
503         (ctf_lookup_by_symbol): Turn into a wrapper around...
504         (ctf_lookup_by_sym_or_name): ... this, supporting name lookup too,
505         using ctf_lookup_symbol_idx in non-writable dicts.  Special-case
506         name lookup in dynamic dicts without reported symbols, which have
507         no symtab or dynsymidx but where name lookup should still work.
508         (ctf_lookup_by_symbol_name): New, another wrapper.
509         * ctf-archive.c (enosym): Note that this is present in
510         ctfi_symnamedicts too.
511         (ctf_arc_close): Adjust for removal of ctfi_syms.  Free the
512         ctfi_symnamedicts.
513         (ctf_arc_flush_caches): Likewise.
514         (ctf_dict_open_cached): Memoize the first cached dict in the
515         crossdict cache.
516         (ctf_arc_lookup_symbol): Turn into a wrapper around...
517         (ctf_arc_lookup_sym_or_name): ... this.  No longer cache
518         ctf_id_t lookups: just call ctf_lookup_by_symbol as needed (but
519         still cache the dicts those lookups succeed in).  Add
520         lookup-by-name support, with dicts of successful lookups cached in
521         ctfi_symnamedicts.  Refactor the caching code a bit.
522         (ctf_arc_lookup_symbol_name): New, another wrapper.
523         * ctf-open.c (ctf_dict_close): Free the ctf_symhash.
524         * libctf.ver (LIBCTF_1.2): New version.  Add
525         ctf_lookup_by_symbol_name, ctf_arc_lookup_symbol_name.
526         * testsuite/libctf-lookup/enum-symbol.c (main): Use
527         ctf_arc_lookup_symbol rather than looking up the name ourselves.
528         Fish it out repeatedly, to make sure that symbol caching isn't
529         broken.
530         (symidx_64): Remove.
531         (symidx_32): Remove.
532         * testsuite/libctf-lookup/enum-symbol-obj.lk: Test symbol lookup
533         in an unlinked object file (indexed symtypetab sections only).
534         * testsuite/libctf-writable/symtypetab-nonlinker-writeout.c
535         (try_maybe_reporting): Check symbol types via
536         ctf_lookup_by_symbol_name as well as ctf_symbol_next.
537         * testsuite/libctf-lookup/conflicting-type-syms.*: New test of
538         lookups in a multi-dict archive.
540 2021-02-20  Alan Modra  <amodra@gmail.com>
542         * testsuite/config/default.exp (ld_L_opt): Define.
543         * testsuite/lib/ctf-lib.exp (load_common_lib): Delete.  Instead load
544         ld-lib.exp.
545         (run_host_cmd, run_host_cmd_yesno, check_compiler_available): Delete.
546         (compile_one_cc, check_ctf_available): Delete.
548 2021-02-03  Nick Alcock  <nick.alcock@oracle.com>
550         * configure.ac (ac_cv_libctf_bfd_elf): Include string.h.
551         * configure: Regenerated.
553 2021-02-03  Nick Alcock  <nick.alcock@oracle.com>
555         * configure.ac (EXPECT): Check for, in order to define...
556         (TCL_TRY): ... this, if Tcl supports try/catch.
557         * Makefile.am (TCL_TRY): Run the testsuite only if set.
558         * configure: Regenerated.
559         * Makefile.in: Likewise.
561 2021-02-02  Nick Alcock  <nick.alcock@oracle.com>
563         * configure.ac (CTF_LIBADD): Remove explicit -lintl population in
564         favour of LIBINTL.
565         * Makefile.am (libctf_nobfd_la_LIBADD): No longer explicitly
566         include $(LIBINTL).
567         (check-DEJAGNU): Pass down to tests as well.
568         * configure: Regenerated.
569         * Makefile.in: Likewise.
571 2021-01-27  Nick Alcock  <nick.alcock@oracle.com>
573         * ctf-string.c (ctf_str_add): Treat adding a NULL as adding "".
574         (ctf_str_add_ref): Likewise.
575         (ctf_str_add_external): Likewise.
576         * ctf-types.c (ctf_type_name_raw): Always return "" for offset 0.
577         * ctf-dedup.c (ctf_dedup_multiple_input_dicts): Don't armour
578         against NULL name.
579         (ctf_dedup_maybe_synthesize_forward): Likewise.
581 2021-01-27  Nick Alcock  <nick.alcock@oracle.com>
583         * ctf-create.c (ctf_serialize): Fix shadowing.
585 2021-01-27  Nick Alcock  <nick.alcock@oracle.com>
587         * ctf-create.c (ctf_add_encoded): Add check for non-empty name.
588         (ctf_add_forward): Likewise.
589         (ctf_add_typedef): Likewise.
591 2021-01-27  Nick Alcock  <nick.alcock@oracle.com>
593         * ctf-open.c (init_types): Rip out code to check anonymous typedef
594         nodes.
595         * ctf-create.c (ctf_add_reftype): Likewise.
596         * ctf-lookup.c (refresh_pptrtab): Likewise.
598 2021-01-27  Nick Alcock  <nick.alcock@oracle.com>
600         * ctf-impl.c (_libctf_nonnull_): Add parameters.
601         (LCTF_LINKING): New flag.
602         (ctf_dict_t) <ctf_link_flags>: Mention it.
603         * ctf-link.c (ctf_link): Keep LCTF_LINKING set across call.
604         (ctf_write): Likewise, including in child dictionaries.
605         (ctf_link_shuffle_syms): Make sure ctf_dynsyms is NULL if there
606         are no reported symbols.
607         * ctf-create.c (symtypetab_delete_nonstatic_vars): Make sure
608         the variable has been reported as a symbol by the linker.
609         (symtypetab_skippable): Mention relationship between SYMFP and the
610         flags.
611         (symtypetab_density): Adjust nonnullity.  Exit early if no symbols
612         were reported and force-indexing is off (i.e., we are doing a
613         final link).
614         (ctf_serialize): Handle the !LCTF_LINKING case by writing out an
615         indexed, sorted symtypetab (and allow SYMFP to be NULL in this
616         case).  Turn sorting off if this is a non-final link.  Only delete
617         nonstatic vars if we are filtering symbols and the linker has
618         reported some.
619         * testsuite/libctf-regression/nonstatic-var-section-ld-r*:
620         New test of variable and symtypetab section population when
621         ld -r is used.
622         * testsuite/libctf-regression/nonstatic-var-section-ld-executable.lk:
623         Likewise, when ld of an executable is used.
624         * testsuite/libctf-regression/nonstatic-var-section-ld.lk:
625         Likewise, when ld -shared alone is used.
626         * testsuite/libctf-regression/nonstatic-var-section-ld*.c:
627         Lookup programs for the above.
628         * testsuite/libctf-writable/symtypetab-nonlinker-writeout.*: New
629         test, testing survival of symbols across ctf_write paths.
630         * testsuite/lib/ctf-lib.exp (run_lookup_test): New option,
631         nonshared, suppressing linking of the SOURCE with -shared.
633 2021-01-19  Nick Alcock  <nick.alcock@oracle.com>
635         * ctf-create.c (membadd): Transform ""-named members into
636         NULL-named ones.
637         * testsuite/libctf-regression/type-add-unnamed-struct*: New test.
639 2021-01-19  Nick Alcock  <nick.alcock@oracle.com>
641         * ctf-lookup.c (ctf_lookup_by_name_internal): Do not return the
642         base type if looking up a nonexistent pointer type.
643         * testsuite/libctf-regression/pptrtab*: Test it.
645 2021-01-13  Alan Modra  <amodra@gmail.com>
647         * Makefile.in: Regenerate.
649 2021-01-12  H.J. Lu  <hongjiu.lu@intel.com>
651         PR binutils/26792
652         * configure.ac: Use GNU_MAKE_JOBSERVER.
653         * aclocal.m4: Regenerated.
654         * configure: Likewise.
656 2021-01-11  H.J. Lu  <hongjiu.lu@intel.com>
658         PR ld/27173
659         * configure: Regenerated.
661 2021-01-09  H.J. Lu  <hongjiu.lu@intel.com>
663         * configure: Regenerated.
665 2021-01-09  Nick Clifton  <nickc@redhat.com>
667         * 2.36 release branch crated.
669 2021-01-09  Alan Modra  <amodra@gmail.com>
671         * configure: Regenerate.
673 2021-01-07  Samuel Thibault  <samuel.thibault@gnu.org>
675         * configure: Regenerate.
677 2021-01-05  Nick Alcock  <nick.alcock@oracle.com>
679         * testsuite/libctf-lookup/struct-iteration.c (main):
680         ctf_member_count returns an int.
682 2021-01-05  Nick Alcock  <nick.alcock@oracle.com>
684         * Makefile.am (BASEDIR): New.
685         (BFDDIR): Likewise.
686         (check-DEJAGNU): Add development.exp to prerequisites.
687         (development.exp): New.
688         (CONFIG_STATUS_DEPENDENCIES): New.
689         (EXTRA_DEJAGNU_SITE_CONFIG): Likewise.
690         (DISTCLEANFILES): Likewise.
691         * Makefile.in: Regenerated.
692         * testsuite/lib/ctf-lib.exp (check_ctf_available): Return boolean.
693         * testsuite/libctf-lookup/lookup.exp: Call check_ctf_available.
694         * testsuite/libctf-regression/regression.exp: Likewise.
696 2021-01-05  Nick Alcock  <nick.alcock@oracle.com>
698         * ctf-types.c (ctf_type_aname): Print forwards to unions and enums
699         properly.
701 2021-01-05  Nick Alcock  <nick.alcock@oracle.com>
703         * ctf-impl.h (ctf_dict_t) <ctf_pptrtab>: New.
704         <ctf_pptrtab_len>: New.
705         <ctf_pptrtab_typemax>: New.
706         * ctf-create.c (ctf_serialize): Update accordingly.
707         (ctf_add_reftype): Note that we don't need to update pptrtab here,
708         despite updating ptrtab.
709         * ctf-open.c (ctf_dict_close): Destroy the pptrtab.
710         (ctf_import): Likewise.
711         (ctf_import_unref): Likewise.
712         * ctf-lookup.c (grow_pptrtab): New.
713         (refresh_pptrtab): New, update a pptrtab.
714         (ctf_lookup_by_name): Turn into a wrapper around (and rename to)...
715         (ctf_lookup_by_name_internal): ... this: construct the pptrtab, and
716         use it in addition to the parent's ptrtab when parent dicts are
717         searched.
718         * testsuite/libctf-regression/regression.exp: New testsuite for
719         regression tests.
720         * testsuite/libctf-regression/pptrtab*: New test.
721         * testsuite/libctf-writable/writable.exp: New testsuite for tests of
722         writable CTF dicts.
723         * testsuite/libctf-writable/pptrtab*: New test.
725 2021-01-05  Nick Alcock  <nick.alcock@oracle.com>
727         * ctf-archive.c (ctf_archive_iter): Remove outdated comment.
729 2021-01-05  Nick Alcock  <nick.alcock@oracle.com>
731         * ctf-impl.h (struct ctf_next) <u.ctn_next>: Move to...
732         <ctn_next>: ... here.
733         * ctf-util.c (ctf_next_destroy): Unconditionally destroy it.
734         * ctf-lookup.c (ctf_symbol_next): Adjust accordingly.
735         * ctf-types.c (ctf_member_iter): Reimplement in terms of...
736         (ctf_member_next): ... this.  Support recursive unnamed member
737         iteration (off by default).
738         (ctf_member_info): Look up members in unnamed sub-structs.
739         * ctf-dedup.c (ctf_dedup_rhash_type): Adjust ctf_member_next call.
740         (ctf_dedup_emit_struct_members): Likewise.
741         * testsuite/libctf-lookup/struct-iteration-ctf.c: Test empty unnamed
742         members, and a normal member after the end.
743         * testsuite/libctf-lookup/struct-iteration.c: Verify that
744         ctf_member_count is consistent with the number of successful returns
745         from a non-recursive ctf_member_next.
746         * testsuite/libctf-lookup/struct-iteration-*: New, test iteration
747         over struct members.
748         * testsuite/libctf-lookup/struct-lookup.c: New test.
749         * testsuite/libctf-lookup/struct-lookup.lk: New test.
751 2021-01-05  Nick Alcock  <nick.alcock@oracle.com>
753         * ctf-link.c (ctf_link_warn_outdated_inputs): New.
754         (ctf_link_write): Call it.
756 2021-01-05  Nick Alcock  <nick.alcock@oracle.com>
758         * testsuite/libctf-lookup/enum-symbol.lk: New symbol-lookup test.
759         * testsuite/libctf-lookup/enum-symbol-ctf.c: New CTF input.
760         * testsuite/libctf-lookup/enum-symbol.c: New lookup test.
762 2021-01-05  Nick Alcock  <nick.alcock@oracle.com>
764         * Makefile.am (EXPECT): New.
765         (RUNTEST): Likewise.
766         (RUNTESTFLAGS): Likewise.
767         (CC_FOR_TARGET): Likewise.
768         (check-DEJAGNU): Likewise.
769         (AUTOMAKE_OPTIONS): Add dejagnu.
770         * Makefile.in: Regenerated.
771         * testsuite/config/default.exp: New.
772         * testsuite/lib/ctf-lib.exp: Likewise.
773         * testsuite/libctf-lookup/enum.lk: New test.
774         * testsuite/libctf-lookup/enum-ctf.c: New CTF input.
775         * testsuite/libctf-lookup/enum.c: New lookup test.
776         * testsuite/libctf-lookup/ambiguous-struct*.c: New test.
777         * testsuite/libctf-lookup/lookup.exp: New.
779 2021-01-05  Nick Alcock  <nick.alcock@oracle.com>
781         * configure.ac (BFD_LIBADD): Remove.
782         (BFD_DEPENDENCIES): Likewise. Remove associated cases.
783         (SHARED_LIBADD): Rename to...
784         (CTF_LIBADD): ... this.  Stick in a suitable libiberty even when
785         linking statically.
786         * Makefile.am (libctf_nobfd_la_LIBADD): Adjust accordingly.
787         libctf uses libintl.
788         (libctf_la_LIBADD): Reference libbfd.la directly, not via
789         BFD_LIBADD.
790         (libctf_la_DEPENDENCIES): Remove.
791         * Makefile.in: Regenerate.
792         * configure: Likewise.
794 2021-01-05  Nick Alcock  <nick.alcock@oracle.com>
796         * ctf-decl.c (ctf_decl_push): Exclude slices from the decl stack.
797         * ctf-types.c (ctf_type_aname): No longer deal with slices here.
798         * ctf-dump.c (ctf_dump_membstate_t) <cdm_toplevel_indent>: Constify.
799         (CTF_FT_REFS): New.
800         (CTF_FT_BITFIELD): Likewise.
801         (CTF_FT_ID): Likewise.
802         (ctf_dump_member): Do not do indentation here. Migrate the
803         type-printing parts of this into...
804         (ctf_dump_format_type): ... here, to be shared by all type printers.
805         Get the errno value for non-representable types right.  Do not print
806         bitfield info for non-bitfields.  Improve the format and indentation
807         of other type output.  Shuffle spacing around to make all indentation
808         either 'width of column' or 4 chars.
809         (ctf_dump_label): Pass CTF_FT_REFS to ctf_dump_format_type.
810         (ctf_dump_objts): Likewise.  Spacing shuffle.
811         (ctf_dump_var): Likewise.
812         (type_hex_digits): Migrate down in the file, to above its new user.
813         (ctf_dump_type): Indent here instead.  Pass CTF_FT_REFS to
814         ctf_dump_format_type. Don't trim off excess linefeeds now we no
815         longer generate them.  Dump enumerated types.
817 2021-01-05  Nick Alcock  <nick.alcock@oracle.com>
819         * ctf-types.c (ctf_type_resolve): Improve comment.
820         (ctf_type_size): Yield ECTF_INCOMPLETE when applied to forwards.
821         Emit errors into the right dict.
822         (ctf_type_align): Likewise.
823         * ctf-create.c (ctf_add_member_offset): Yield ECTF_INCOMPLETE
824         when adding a member without explicit offset when this member, or
825         the previous member, is incomplete.
826         * ctf-dump.c (ctf_dump_format_type): Do not try to print the size of
827         forwards.
828         (ctf_dump_member): Do not try to print their alignment.
830 2021-01-05  Nick Alcock  <nick.alcock@oracle.com>
832         * ctf-dump.c (ctf_dump_objts): Dump by calling ctf_dump_format_type.
833         (ctf_dump_format_type): Don't emit the size for function objects.
834         Dump the element type of arrays like we dump the pointed-to type of
835         pointers, etc.
837 2021-01-05  Nick Alcock  <nick.alcock@oracle.com>
839         * ctf-dump.c (ctf_dump_format_type): Add 0x to hex type IDs.
840         (ctf_dump_header): Add 0x to the hex magic number.
841         (ctf_dump_str): Add 0x to the hex string offsets.
842         (ctf_dump_membstate_t) <cdm_toplevel_indent>: New.
843         (ctf_dump_type): Adjust.  Free it when we're done.
844         (type_hex_digits): New.
845         (ctf_dump_member): Align output depending on the width of the type
846         ID being generated.  Use printf padding, not a loop, to generate
847         indentation.
849 2021-01-05  Nick Alcock  <nick.alcock@oracle.com>
851         * ctf-decl.c (ctf_decl_push): Don't print array decls backwards.
853 2021-01-04  Nicolas Boulenguez  <nicolas@debian.org>
855         PR 27117
856         * configure.ac: Make AC_CONFIG_MACRO_DIR consistent with
857         ACLOCAL_AMFLAGS -I dirs.
858         * configure: Regenerate.
860 2021-01-01  Alan Modra  <amodra@gmail.com>
862         Update year range in copyright notice of all files.
864 For older changes see ChangeLog-2020
866 Copyright (C) 2021-2023 Free Software Foundation, Inc.
868 Copying and distribution of this file, with or without modification,
869 are permitted in any medium without royalty provided the copyright
870 notice and this notice are preserved.
872 Local Variables:
873 mode: change-log
874 left-margin: 8
875 fill-column: 74
876 version-control: never
877 End: