1 2022-01-22 Nick Clifton <nickc@redhat.com>
3 * 2.38 release branch created.
5 2021-11-08 Nick Alcock <nick.alcock@oracle.com>
7 * doc/ctf-spec.texi: New file.
8 * configure.ac (MAKEINFO): Add.
9 (BUILD_INFO): Likewise.
10 (AC_CONFIG_FILES) [doc/Makefile]: Add.
11 * Makefile.am [BUILD_INFO] (SUBDIRS): Add doc/.
12 * doc/Makefile.am: New file.
13 * doc/Makefile.in: Likewise.
14 * configure: Regenerated.
15 * Makefile.in: Likewise.
17 2021-10-25 Nick Alcock <nick.alcock@oracle.com>
19 * ctf-types.c (ctf_type_rvisit): Handle nonrepresentable types.
21 2021-10-25 Nick Alcock <nick.alcock@oracle.com>
23 * ctf-dump.c (ctf_dump_type): Do not abort on error.
25 2021-09-27 Nick Alcock <nick.alcock@oracle.com>
27 * ctf-lookup.c (ctf_lookup_by_name_internal): Fix pptrtab bounds.
28 * testsuite/libctf-writable/pptrtab-writable-page-deep-lookup.*:
31 2021-09-27 Nick Alcock <nick.alcock@oracle.com>
33 * testsuite/libctf-lookup/enum-symbol.c: Remove unused label.
34 * testsuite/libctf-lookup/conflicting-type-syms.c: Remove unused
36 * testsuite/libctf-regression/pptrtab.c: Likewise.
37 * testsuite/libctf-regression/type-add-unnamed-struct.c: Likewise.
38 * testsuite/libctf-writable/pptrtab.c: Likewise.
39 * testsuite/libctf-writable/reserialize-strtab-corruption.c:
41 * testsuite/libctf-regression/nonstatic-var-section-ld-r.c: Fix
43 * testsuite/libctf-regression/nonstatic-var-section-ld.c:
45 * testsuite/libctf-regression/nonstatic-var-section-ld.lk: Adjust.
46 * testsuite/libctf-writable/symtypetab-nonlinker-writeout.c: Fix
49 2021-09-27 Nick Alcock <nick.alcock@oracle.com>
51 * ctf-open.c (ctf_bufopen_internal): Don't complain about corrupt
52 function index symtypetab sections if this is an old-format
53 function symtypetab section (which should be ignored in any case).
56 2021-09-27 Nick Alcock <nick.alcock@oracle.com>
58 * configure: Regenerate.
59 * Makefile.in: Regenerate.
61 2021-09-27 Nick Alcock <nick.alcock@oracle.com>
64 * configure.ac (VERSION_FLAGS): Replace with...
65 (ac_cv_libctf_version_script): ... this multiple test.
66 (VERSION_FLAGS_NOBFD): Substitute this too.
67 * Makefile.am (libctf_nobfd_la_LDFLAGS): Use it. Split out...
68 (libctf_ldflags_nover): ... non-versioning flags here.
69 (libctf_la_LDFLAGS): Use it.
70 * libctf.ver: Give every symbol not in libctf-nobfd a comment on
71 the same line noting as much.
73 2021-09-27 Nick Alcock <nick.alcock@oracle.com>
76 * Makefile.am (libctf_la_LIBADD): Link against libiberty
77 before pulling in libbfd.la or pulling in libctf-nobfd.la.
78 * Makefile.in: Regenerate.
80 2021-07-03 Nick Clifton <nickc@redhat.com>
82 * 2.37 release branch created.
84 2021-05-09 Alan Modra <amodra@gmail.com>
86 * ctf-impl.h (ctf_dynset_eq_string): Don't declare.
87 * ctf-hash.c (ctf_dynset_eq_string): Delete function.
88 * ctf-dedup.c (make_set_element): Use htab_eq_string.
89 (ctf_dedup_atoms_init, ADD_CITER, ctf_dedup_init): Likewise.
90 (ctf_dedup_conflictify_unshared): Likewise.
91 (ctf_dedup_walk_output_mapping): Likewise.
93 2021-05-06 Nick Alcock <nick.alcock@oracle.com>
95 * testsuite/lib/ctf-lib.exp: Use -gctf, not -gt.
96 * testsuite/libctf-regression/nonstatic-var-section-ld-r.lk:
97 Hidden symbols now get into the symtypetab anyway.
99 2021-05-06 Nick Alcock <nick.alcock@oracle.com>
101 * ctf-open.c (init_types): Unknown types may have names.
102 * ctf-types.c (ctf_type_resolve): CTF_K_UNKNOWN is as
103 non-representable as type ID 0.
104 (ctf_type_aname): Print unknown types.
105 * ctf-dedup.c (ctf_dedup_hash_type): Do not early-exit for
106 CTF_K_UNKNOWN types: they have real hash values now.
107 (ctf_dedup_rwalk_one_output_mapping): Treat CTF_K_UNKNOWN types
108 like other types with no referents: call the callback and do not
110 (ctf_dedup_emit_type): Emit via...
111 * ctf-create.c (ctf_add_unknown): ... this new function.
112 * libctf.ver (LIBCTF_1.2): Add it.
114 2021-03-25 Nick Alcock <nick.alcock@oracle.com>
116 * configure.ac: Check for dlsym, not dlopen.
117 * configure: Regenerate.
119 2021-03-25 Nick Alcock <nick.alcock@oracle.com>
121 * testsuite/libctf-writable/symtypetab-nonlinker-writeout.c: Don't
124 2021-03-25 Nick Alcock <nick.alcock@oracle.com>
127 * ctf-lookup.c (isqualifier): Don't dereference out-of-bounds
130 2021-03-25 Nick Alcock <nick.alcock@oracle.com>
132 * ctf-open-bfd.c (ctf_bfdopen_ctfsect): Initialize debugging.
134 2021-03-25 Nick Alcock <nick.alcock@oracle.com>
137 * ctf-serialize.c (ctf_emit_type_sect): Allow for a NULL vlen in
138 CTF_K_FUNCTION types.
140 2021-03-25 Nick Alcock <nick.alcock@oracle.com>
142 * ctf-dump.c (ctf_dump_format_type): Don't emit size or alignment
145 2021-03-21 Alan Modra <amodra@gmail.com>
147 * ctf-impl.h: Include string.h.
149 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
151 * ctf-types.c (ctf_type_encoding): Support, after a fashion, for enums.
152 * ctf-dump.c (ctf_dump_format_type): Do not report enums' degenerate
155 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
157 * ctf-dedup.c (ctf_dedup_rhash_type): Report errors on the input
159 * ctf-open.c (ctf_bufopen_internal): Report errors initializing
162 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
164 * ctf-impl.h (ctf_next_t) <ctn_tp>: New.
168 * ctf-types.c (ctf_struct_member): New.
169 (ctf_member_next): Use it, dropping separate large/small code paths.
170 (ctf_type_align): Likewise.
171 (ctf_member_info): Likewise.
172 (ctf_type_rvisit): Likewise.
174 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
176 * ctf-impl.h (ctf_dtdef_t) <dtu_members>: Remove.
178 (ctf_dmdef_t): Remove.
179 (struct ctf_next) <u.ctn_dmd>: Remove.
180 * ctf-create.c (INITIAL_VLEN): New, more-or-less arbitrary initial
182 (ctf_add_enum): Use it.
183 (ctf_dtd_delete): Do not free the (removed) dmd; remove string
184 refs from the vlen on struct deletion.
185 (ctf_add_struct_sized): Populate the vlen: do it by hand if
186 promoting forwards. Always populate the full-size
187 lsizehi/lsizelo members.
188 (ctf_add_union_sized): Likewise.
189 (ctf_add_member_offset): Set up the vlen rather than the dmd.
190 Expand it as needed, repointing string refs via
191 ctf_str_move_pending. Add the member names as pending strings.
192 Always populate the full-size lsizehi/lsizelo members.
193 (membadd): Remove, folding back into...
194 (ctf_add_type_internal): ... here, adding via an ordinary
195 ctf_add_struct_sized and _next iteration rather than doing
197 * ctf-serialize.c (ctf_copy_smembers): Remove this...
198 (ctf_copy_lmembers): ... and this...
199 (ctf_emit_type_sect): ... folding into here. Figure out if a
200 ctf_stype_t is needed here, not in ctf_add_*_sized.
201 (ctf_type_sect_size): Figure out the ctf_stype_t stuff the same
203 * ctf-types.c (ctf_member_next): Remove the dmd path and always
204 use the vlen. Force large-structure usage for dynamic types.
205 (ctf_type_align): Likewise.
206 (ctf_member_info): Likewise.
207 (ctf_type_rvisit): Likewise.
208 * testsuite/libctf-regression/type-add-unnamed-struct-ctf.c: Add a
209 self-referential type to this test.
210 * testsuite/libctf-regression/type-add-unnamed-struct.c: Adjusted
212 * testsuite/libctf-regression/type-add-unnamed-struct.lk: Likewise.
214 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
216 * ctf-impl.h (ctf_dtdef_t) <dtd_vlen_alloc>: New.
217 (ctf_str_move_pending): Declare.
218 * ctf-string.c (ctf_str_add_ref_internal): Fix error return.
219 (ctf_str_move_pending): New.
220 * ctf-create.c (ctf_grow_vlen): New.
221 (ctf_dtd_delete): Zero out the vlen_alloc after free. Free the
222 vlen later: iterate over it and free enum name refs first.
223 (ctf_add_generic): Populate dtd_vlen_alloc from vlen.
224 (ctf_add_enum): populate the vlen; do it by hand if promoting
226 (ctf_add_enumerator): Set up the vlen rather than the dmd. Expand
227 it as needed, repointing string refs via ctf_str_move_pending. Add
228 the enumerand names as pending strings.
229 * ctf-serialize.c (ctf_copy_emembers): Remove.
230 (ctf_emit_type_sect): Copy the vlen into place and ref the
232 * ctf-types.c (ctf_enum_next): The dynamic portion now uses
233 the same code as the non-dynamic.
234 (ctf_enum_name): Likewise.
235 (ctf_enum_value): Likewise.
236 * testsuite/libctf-lookup/enum-many-ctf.c: New test.
237 * testsuite/libctf-lookup/enum-many.lk: New test.
239 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
241 * ctf-hash.c (ctf_dynset_elements): New.
242 * ctf-impl.h (ctf_dynset_elements): Declare it.
243 (ctf_str_add_pending): Likewise.
244 (ctf_dict_t) <ctf_str_pending_ref>: New, set of refs that must be
245 added during serialization.
246 * ctf-string.c (ctf_str_create_atoms): Initialize it.
247 (CTF_STR_ADD_REF): New flag.
248 (CTF_STR_MAKE_PROVISIONAL): Likewise.
249 (CTF_STR_PENDING_REF): Likewise.
250 (ctf_str_add_ref_internal): Take a flags word rather than int
251 params. Populate, and clear out, ctf_str_pending_ref.
252 (ctf_str_add): Adjust accordingly.
253 (ctf_str_add_external): Likewise.
254 (ctf_str_add_pending): New.
255 (ctf_str_remove_ref): Also remove the potential ref if it is a
257 * ctf-serialize.c (ctf_serialize): Prohibit addition of strings
258 with ctf_str_add_ref before serialization. Ensure that the
259 ctf_str_pending_ref set is empty before strtab finalization.
260 (ctf_emit_type_sect): Add a ref to the ctt_name.
261 * ctf-create.c (ctf_add_generic): Add the ctt_name as a pending
263 * testsuite/libctf-writable/reserialize-strtab-corruption.*: New test.
265 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
267 * ctf-serialize.c (ctf_serialize): Preserve ctf_typemax across
270 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
272 * ctf-impl.h (ctf_dtdef_t) <dtd_u.dtu_argv>: Remove.
273 * ctf-create.c (ctf_dtd_delete): No longer free it.
274 (ctf_add_function): Use the dtd_vlen, not dtu_argv. Properly align.
275 * ctf-serialize.c (ctf_emit_type_sect): Just copy the dtd_vlen.
276 * ctf-types.c (ctf_func_type_info): Just use the vlen.
277 (ctf_func_type_args): Likewise.
279 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
281 * ctf-impl.h (ctf_dtdef_t) <dtd_u.dtu_arr>: Remove.
282 * ctf-create.c (ctf_add_array): Use the dtd_vlen, not dtu_arr.
283 (ctf_set_array): Likewise.
284 * ctf-serialize.c (ctf_emit_type_sect): Just copy the dtd_vlen.
285 * ctf-types.c (ctf_array_info): Just use the vlen.
287 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
289 * ctf-impl.h (ctf_dtdef_t) <dtd_u.dtu_enc>: Remove.
290 <dtd_u.dtu_slice>: Likewise.
292 * ctf-create.c (ctf_add_generic): Perhaps allocate it. All
294 (ctf_dtd_delete): Free it.
295 (ctf_add_slice): Use the dtd_vlen, not dtu_enc.
296 (ctf_add_encoded): Likewise. Assert that this must be an int or
298 * ctf-serialize.c (ctf_emit_type_sect): Just copy the dtd_vlen.
299 * ctf-dedup.c (ctf_dedup_rhash_type): Use the dtd_vlen, not
301 * ctf-types.c (ctf_type_reference): Likewise.
302 (ctf_type_encoding): Remove most dynamic-type-specific code: just
303 get the vlen from the right place. Report failure to look up the
304 underlying type's encoding.
306 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
308 * ctf-archive.c (ctf_archive_next): GNU style fix for do {} while.
309 * ctf-dedup.c (ctf_dedup_rhash_type): Likewise.
310 (ctf_dedup_rwalk_one_output_mapping): Likewise.
311 * ctf-dump.c (ctf_dump_format_type): Likewise.
312 * ctf-lookup.c (ctf_symbol_next): Likewise.
313 * swap.h (swap_thing): Likewise.
315 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
317 * ctf-serialize.c: General reshuffling, and...
318 (emit_symtypetab_state_t): New, migrated from
319 local variables in ctf_serialize.
320 (ctf_serialize): Split out most section sizing and
322 (ctf_symtypetab_sect_sizes): New (split out).
323 (ctf_emit_symtypetab_sects): Likewise.
324 (ctf_type_sect_size): Likewise.
325 (ctf_emit_type_sect): Likewise.
327 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
329 * ctf-impl.h (ctf_dict_t): Fix comment.
331 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
333 * ctf-create.c (symtypetab_delete_nonstatic_vars): Move
334 into ctf-serialize.c.
335 (ctf_symtab_skippable): Likewise.
336 (CTF_SYMTYPETAB_EMIT_FUNCTION): Likewise.
337 (CTF_SYMTYPETAB_EMIT_PAD): Likewise.
338 (CTF_SYMTYPETAB_FORCE_INDEXED): Likewise.
339 (symtypetab_density): Likewise.
340 (emit_symtypetab): Likewise.
341 (emit_symtypetab_index): Likewise.
342 (ctf_copy_smembers): Likewise.
343 (ctf_copy_lmembers): Likewise.
344 (ctf_copy_emembers): Likewise.
345 (ctf_sort_var): Likewise.
346 (ctf_serialize): Likewise.
347 (ctf_gzwrite): Likewise.
348 (ctf_compress_write): Likewise.
349 (ctf_write_mem): Likewise.
350 (ctf_write): Likewise.
351 * ctf-serialize.c: New file.
352 * Makefile.am (libctf_nobfd_la_SOURCES): Add it.
353 * Makefile.in: Regenerate.
355 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
357 * ctf-link.c (ctf_link_lazy_open): Move up in the file, to near
359 * ctf-lookup.c (ctf_lookup_symbol_idx): Repair tabdamage.
360 (ctf_lookup_by_sym_or_name): Likewise.
361 * testsuite/libctf-lookup/struct-iteration.c: Likewise.
362 * testsuite/libctf-regression/type-add-unnamed-struct.c: Likewise.
364 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
366 * ctf-create.c (symtypetab_density): Report the symbol name as
367 well as index in the name != object error; note the likely
369 * ctf-link.c (ctf_link_shuffle_syms): Report the symbol index
372 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
374 * ctf-link.c (ctf_link_shuffle_syms): Free ctf_dynsyms properly.
376 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
378 * ctf-dump.c (ctf_dump_format_type): Fix signed/unsigned confusion.
380 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
382 * ctf-dedup.c (ctf_dedup): Pass on errors from ctf_dedup_hash_type.
383 Call ctf_dedup_fini properly on other errors.
384 (ctf_dedup_emit_type): Set the errno on dynhash insertion failure.
385 * ctf-link.c (ctf_link_deduplicating_per_cu): Close outputs beyond
386 output 0 when asserting because >1 output is found.
387 (ctf_link_deduplicating): Likewise, when asserting because the
388 shared output is not the same as the passed-in fp.
390 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
392 * ctf-impl.h (ctf_dict_t) <ctf_link_type_mapping>: No longer used
393 by the nondeduplicating linker.
394 (ctf_add_type_mapping): Removed, now static.
395 (ctf_type_mapping): Likewise.
396 (ctf_dedup_type_mapping): New.
397 (ctf_dedup_t) <cd_input_nums>: New.
398 * ctf-dedup.c (ctf_dedup_init): Populate it.
399 (ctf_dedup_fini): Free it again. Emphasise that this has to be
400 the last thing called.
401 (ctf_dedup): Populate it.
402 (ctf_dedup_populate_type_mapping): Removed.
403 (ctf_dedup_populate_type_mappings): Likewise.
404 (ctf_dedup_emit): No longer call it. No longer call
405 ctf_dedup_fini either.
406 (ctf_dedup_type_mapping): New.
407 * ctf-link.c (ctf_unnamed_cuname): New.
408 (ctf_create_per_cu): Arguments must be non-null now.
409 (ctf_in_member_cb_arg): Removed.
410 (ctf_link): No longer populate it. No longer discard the
412 (ctf_link_deduplicating_one_symtypetab): Use
413 ctf_dedup_type_mapping, not ctf_type_mapping. Use
415 (ctf_link_one_variable): Likewise. Pass in args individually: no
416 longer a ctf_variable_iter callback.
417 (empty_link_type_mapping): Removed.
418 (ctf_link_deduplicating_variables): Use ctf_variable_next, not
419 ctf_variable_iter. No longer pack arguments to
420 ctf_link_one_variable into a struct.
421 (ctf_link_deduplicating_per_cu): Call ctf_dedup_fini once
422 all link phases are done.
423 (ctf_link_deduplicating): Likewise.
424 (ctf_link_intern_extern_string): Improve comment.
425 (ctf_add_type_mapping): Migrate...
426 (ctf_type_mapping): ... these functions...
427 * ctf-create.c (ctf_add_type_mapping): ... here...
428 (ctf_type_mapping): ... and make static, for the sole use of
431 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
433 * ctf-link.c (ctf_link_one_variable): Remove reference to
434 "unconflicted link mode".
436 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
438 * ctf-link.c (ctf_create_per_cu): Drop FILENAME now that it is
439 always identical to CUNAME.
440 (ctf_link_deduplicating_one_symtypetab): Adjust.
441 (ctf_link_one_type): Remove.
442 (ctf_link_one_input_archive_member): Likewise.
443 (ctf_link_close_one_input_archive): Likewise.
444 (ctf_link_one_input_archive): Likewise.
445 (ctf_link): No longer call it. Drop CTF_LINK_NONDEDUP path.
446 Improve header comment a bit (dicts, not files). Adjust
447 ctf_create_per_cu call.
448 (ctf_link_deduplicating_variables): Simplify.
449 (ctf_link_in_member_cb_arg_t) <cu_name>: Remove.
450 <in_input_cu_file>: Likewise.
451 <in_fp_parent>: Likewise.
452 <done_parent>: Likewise.
453 (ctf_link_one_variable): Turn uses of in_file_name to in_cuname.
455 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
457 * ctf-types.c (ctf_member_iter): Move 'rc' to an inner scope.
458 (ctf_enum_iter): Reimplement in terms of ctf_enum_next.
459 (ctf_type_iter): Reimplement in terms of ctf_type_next.
460 (ctf_type_iter_all): Likewise.
461 (ctf_variable_iter): Reimplement in terms of ctf_variable_next.
462 * ctf-archive.c (ctf_archive_iter_internal): Remove.
463 (ctf_archive_iter): Reimplement in terms of ctf_archive_next.
465 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
467 * ctf-archive.c (ctf_archive_next): Set the name of parents in
468 single-member archives.
470 2021-02-26 Alan Modra <amodra@gmail.com>
472 * Makefile.in: Regenerate.
474 2021-02-21 Alan Modra <amodra@gmail.com>
476 * configure.ac: Invoke AC_CANONICAL_TARGET, AC_CANONICAL_HOST
477 and AC_CANONICAL_BUILD.
478 * configure: Regenerate.
479 * Makefile.in: Regenerate.
481 2021-02-20 Nick Alcock <nick.alcock@oracle.com>
483 * ctf-impl.h (ctf_dict_t) <ctf_symhash>: New.
484 <ctf_symhash_latest>: Likewise.
485 (struct ctf_archive_internal) <ctfi_crossdict_cache>: New.
486 <ctfi_symnamedicts>: New.
488 (ctf_lookup_symbol_name): Remove.
489 * ctf-lookup.c (ctf_lookup_symbol_name): Propagate errors from
490 parent properly. Make static.
491 (ctf_lookup_symbol_idx): New, linear search for the symbol name,
492 cached in the crossdict cache's ctf_symhash (if available), or
493 this dict's (otherwise).
494 (ctf_try_lookup_indexed): Allow the symname to be passed in.
495 (ctf_lookup_by_symbol): Turn into a wrapper around...
496 (ctf_lookup_by_sym_or_name): ... this, supporting name lookup too,
497 using ctf_lookup_symbol_idx in non-writable dicts. Special-case
498 name lookup in dynamic dicts without reported symbols, which have
499 no symtab or dynsymidx but where name lookup should still work.
500 (ctf_lookup_by_symbol_name): New, another wrapper.
501 * ctf-archive.c (enosym): Note that this is present in
502 ctfi_symnamedicts too.
503 (ctf_arc_close): Adjust for removal of ctfi_syms. Free the
505 (ctf_arc_flush_caches): Likewise.
506 (ctf_dict_open_cached): Memoize the first cached dict in the
508 (ctf_arc_lookup_symbol): Turn into a wrapper around...
509 (ctf_arc_lookup_sym_or_name): ... this. No longer cache
510 ctf_id_t lookups: just call ctf_lookup_by_symbol as needed (but
511 still cache the dicts those lookups succeed in). Add
512 lookup-by-name support, with dicts of successful lookups cached in
513 ctfi_symnamedicts. Refactor the caching code a bit.
514 (ctf_arc_lookup_symbol_name): New, another wrapper.
515 * ctf-open.c (ctf_dict_close): Free the ctf_symhash.
516 * libctf.ver (LIBCTF_1.2): New version. Add
517 ctf_lookup_by_symbol_name, ctf_arc_lookup_symbol_name.
518 * testsuite/libctf-lookup/enum-symbol.c (main): Use
519 ctf_arc_lookup_symbol rather than looking up the name ourselves.
520 Fish it out repeatedly, to make sure that symbol caching isn't
524 * testsuite/libctf-lookup/enum-symbol-obj.lk: Test symbol lookup
525 in an unlinked object file (indexed symtypetab sections only).
526 * testsuite/libctf-writable/symtypetab-nonlinker-writeout.c
527 (try_maybe_reporting): Check symbol types via
528 ctf_lookup_by_symbol_name as well as ctf_symbol_next.
529 * testsuite/libctf-lookup/conflicting-type-syms.*: New test of
530 lookups in a multi-dict archive.
532 2021-02-20 Alan Modra <amodra@gmail.com>
534 * testsuite/config/default.exp (ld_L_opt): Define.
535 * testsuite/lib/ctf-lib.exp (load_common_lib): Delete. Instead load
537 (run_host_cmd, run_host_cmd_yesno, check_compiler_available): Delete.
538 (compile_one_cc, check_ctf_available): Delete.
540 2021-02-03 Nick Alcock <nick.alcock@oracle.com>
542 * configure.ac (ac_cv_libctf_bfd_elf): Include string.h.
543 * configure: Regenerated.
545 2021-02-03 Nick Alcock <nick.alcock@oracle.com>
547 * configure.ac (EXPECT): Check for, in order to define...
548 (TCL_TRY): ... this, if Tcl supports try/catch.
549 * Makefile.am (TCL_TRY): Run the testsuite only if set.
550 * configure: Regenerated.
551 * Makefile.in: Likewise.
553 2021-02-02 Nick Alcock <nick.alcock@oracle.com>
555 * configure.ac (CTF_LIBADD): Remove explicit -lintl population in
557 * Makefile.am (libctf_nobfd_la_LIBADD): No longer explicitly
559 (check-DEJAGNU): Pass down to tests as well.
560 * configure: Regenerated.
561 * Makefile.in: Likewise.
563 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
565 * ctf-string.c (ctf_str_add): Treat adding a NULL as adding "".
566 (ctf_str_add_ref): Likewise.
567 (ctf_str_add_external): Likewise.
568 * ctf-types.c (ctf_type_name_raw): Always return "" for offset 0.
569 * ctf-dedup.c (ctf_dedup_multiple_input_dicts): Don't armour
571 (ctf_dedup_maybe_synthesize_forward): Likewise.
573 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
575 * ctf-create.c (ctf_serialize): Fix shadowing.
577 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
579 * ctf-create.c (ctf_add_encoded): Add check for non-empty name.
580 (ctf_add_forward): Likewise.
581 (ctf_add_typedef): Likewise.
583 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
585 * ctf-open.c (init_types): Rip out code to check anonymous typedef
587 * ctf-create.c (ctf_add_reftype): Likewise.
588 * ctf-lookup.c (refresh_pptrtab): Likewise.
590 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
592 * ctf-impl.c (_libctf_nonnull_): Add parameters.
593 (LCTF_LINKING): New flag.
594 (ctf_dict_t) <ctf_link_flags>: Mention it.
595 * ctf-link.c (ctf_link): Keep LCTF_LINKING set across call.
596 (ctf_write): Likewise, including in child dictionaries.
597 (ctf_link_shuffle_syms): Make sure ctf_dynsyms is NULL if there
598 are no reported symbols.
599 * ctf-create.c (symtypetab_delete_nonstatic_vars): Make sure
600 the variable has been reported as a symbol by the linker.
601 (symtypetab_skippable): Mention relationship between SYMFP and the
603 (symtypetab_density): Adjust nonnullity. Exit early if no symbols
604 were reported and force-indexing is off (i.e., we are doing a
606 (ctf_serialize): Handle the !LCTF_LINKING case by writing out an
607 indexed, sorted symtypetab (and allow SYMFP to be NULL in this
608 case). Turn sorting off if this is a non-final link. Only delete
609 nonstatic vars if we are filtering symbols and the linker has
611 * testsuite/libctf-regression/nonstatic-var-section-ld-r*:
612 New test of variable and symtypetab section population when
614 * testsuite/libctf-regression/nonstatic-var-section-ld-executable.lk:
615 Likewise, when ld of an executable is used.
616 * testsuite/libctf-regression/nonstatic-var-section-ld.lk:
617 Likewise, when ld -shared alone is used.
618 * testsuite/libctf-regression/nonstatic-var-section-ld*.c:
619 Lookup programs for the above.
620 * testsuite/libctf-writable/symtypetab-nonlinker-writeout.*: New
621 test, testing survival of symbols across ctf_write paths.
622 * testsuite/lib/ctf-lib.exp (run_lookup_test): New option,
623 nonshared, suppressing linking of the SOURCE with -shared.
625 2021-01-19 Nick Alcock <nick.alcock@oracle.com>
627 * ctf-create.c (membadd): Transform ""-named members into
629 * testsuite/libctf-regression/type-add-unnamed-struct*: New test.
631 2021-01-19 Nick Alcock <nick.alcock@oracle.com>
633 * ctf-lookup.c (ctf_lookup_by_name_internal): Do not return the
634 base type if looking up a nonexistent pointer type.
635 * testsuite/libctf-regression/pptrtab*: Test it.
637 2021-01-13 Alan Modra <amodra@gmail.com>
639 * Makefile.in: Regenerate.
641 2021-01-12 H.J. Lu <hongjiu.lu@intel.com>
644 * configure.ac: Use GNU_MAKE_JOBSERVER.
645 * aclocal.m4: Regenerated.
646 * configure: Likewise.
648 2021-01-11 H.J. Lu <hongjiu.lu@intel.com>
651 * configure: Regenerated.
653 2021-01-09 H.J. Lu <hongjiu.lu@intel.com>
655 * configure: Regenerated.
657 2021-01-09 Nick Clifton <nickc@redhat.com>
659 * 2.36 release branch crated.
661 2021-01-09 Alan Modra <amodra@gmail.com>
663 * configure: Regenerate.
665 2021-01-07 Samuel Thibault <samuel.thibault@gnu.org>
667 * configure: Regenerate.
669 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
671 * testsuite/libctf-lookup/struct-iteration.c (main):
672 ctf_member_count returns an int.
674 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
676 * Makefile.am (BASEDIR): New.
678 (check-DEJAGNU): Add development.exp to prerequisites.
679 (development.exp): New.
680 (CONFIG_STATUS_DEPENDENCIES): New.
681 (EXTRA_DEJAGNU_SITE_CONFIG): Likewise.
682 (DISTCLEANFILES): Likewise.
683 * Makefile.in: Regenerated.
684 * testsuite/lib/ctf-lib.exp (check_ctf_available): Return boolean.
685 * testsuite/libctf-lookup/lookup.exp: Call check_ctf_available.
686 * testsuite/libctf-regression/regression.exp: Likewise.
688 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
690 * ctf-types.c (ctf_type_aname): Print forwards to unions and enums
693 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
695 * ctf-impl.h (ctf_dict_t) <ctf_pptrtab>: New.
696 <ctf_pptrtab_len>: New.
697 <ctf_pptrtab_typemax>: New.
698 * ctf-create.c (ctf_serialize): Update accordingly.
699 (ctf_add_reftype): Note that we don't need to update pptrtab here,
700 despite updating ptrtab.
701 * ctf-open.c (ctf_dict_close): Destroy the pptrtab.
702 (ctf_import): Likewise.
703 (ctf_import_unref): Likewise.
704 * ctf-lookup.c (grow_pptrtab): New.
705 (refresh_pptrtab): New, update a pptrtab.
706 (ctf_lookup_by_name): Turn into a wrapper around (and rename to)...
707 (ctf_lookup_by_name_internal): ... this: construct the pptrtab, and
708 use it in addition to the parent's ptrtab when parent dicts are
710 * testsuite/libctf-regression/regression.exp: New testsuite for
712 * testsuite/libctf-regression/pptrtab*: New test.
713 * testsuite/libctf-writable/writable.exp: New testsuite for tests of
715 * testsuite/libctf-writable/pptrtab*: New test.
717 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
719 * ctf-archive.c (ctf_archive_iter): Remove outdated comment.
721 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
723 * ctf-impl.h (struct ctf_next) <u.ctn_next>: Move to...
724 <ctn_next>: ... here.
725 * ctf-util.c (ctf_next_destroy): Unconditionally destroy it.
726 * ctf-lookup.c (ctf_symbol_next): Adjust accordingly.
727 * ctf-types.c (ctf_member_iter): Reimplement in terms of...
728 (ctf_member_next): ... this. Support recursive unnamed member
729 iteration (off by default).
730 (ctf_member_info): Look up members in unnamed sub-structs.
731 * ctf-dedup.c (ctf_dedup_rhash_type): Adjust ctf_member_next call.
732 (ctf_dedup_emit_struct_members): Likewise.
733 * testsuite/libctf-lookup/struct-iteration-ctf.c: Test empty unnamed
734 members, and a normal member after the end.
735 * testsuite/libctf-lookup/struct-iteration.c: Verify that
736 ctf_member_count is consistent with the number of successful returns
737 from a non-recursive ctf_member_next.
738 * testsuite/libctf-lookup/struct-iteration-*: New, test iteration
740 * testsuite/libctf-lookup/struct-lookup.c: New test.
741 * testsuite/libctf-lookup/struct-lookup.lk: New test.
743 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
745 * ctf-link.c (ctf_link_warn_outdated_inputs): New.
746 (ctf_link_write): Call it.
748 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
750 * testsuite/libctf-lookup/enum-symbol.lk: New symbol-lookup test.
751 * testsuite/libctf-lookup/enum-symbol-ctf.c: New CTF input.
752 * testsuite/libctf-lookup/enum-symbol.c: New lookup test.
754 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
756 * Makefile.am (EXPECT): New.
758 (RUNTESTFLAGS): Likewise.
759 (CC_FOR_TARGET): Likewise.
760 (check-DEJAGNU): Likewise.
761 (AUTOMAKE_OPTIONS): Add dejagnu.
762 * Makefile.in: Regenerated.
763 * testsuite/config/default.exp: New.
764 * testsuite/lib/ctf-lib.exp: Likewise.
765 * testsuite/libctf-lookup/enum.lk: New test.
766 * testsuite/libctf-lookup/enum-ctf.c: New CTF input.
767 * testsuite/libctf-lookup/enum.c: New lookup test.
768 * testsuite/libctf-lookup/ambiguous-struct*.c: New test.
769 * testsuite/libctf-lookup/lookup.exp: New.
771 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
773 * configure.ac (BFD_LIBADD): Remove.
774 (BFD_DEPENDENCIES): Likewise. Remove associated cases.
775 (SHARED_LIBADD): Rename to...
776 (CTF_LIBADD): ... this. Stick in a suitable libiberty even when
778 * Makefile.am (libctf_nobfd_la_LIBADD): Adjust accordingly.
780 (libctf_la_LIBADD): Reference libbfd.la directly, not via
782 (libctf_la_DEPENDENCIES): Remove.
783 * Makefile.in: Regenerate.
784 * configure: Likewise.
786 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
788 * ctf-decl.c (ctf_decl_push): Exclude slices from the decl stack.
789 * ctf-types.c (ctf_type_aname): No longer deal with slices here.
790 * ctf-dump.c (ctf_dump_membstate_t) <cdm_toplevel_indent>: Constify.
792 (CTF_FT_BITFIELD): Likewise.
793 (CTF_FT_ID): Likewise.
794 (ctf_dump_member): Do not do indentation here. Migrate the
795 type-printing parts of this into...
796 (ctf_dump_format_type): ... here, to be shared by all type printers.
797 Get the errno value for non-representable types right. Do not print
798 bitfield info for non-bitfields. Improve the format and indentation
799 of other type output. Shuffle spacing around to make all indentation
800 either 'width of column' or 4 chars.
801 (ctf_dump_label): Pass CTF_FT_REFS to ctf_dump_format_type.
802 (ctf_dump_objts): Likewise. Spacing shuffle.
803 (ctf_dump_var): Likewise.
804 (type_hex_digits): Migrate down in the file, to above its new user.
805 (ctf_dump_type): Indent here instead. Pass CTF_FT_REFS to
806 ctf_dump_format_type. Don't trim off excess linefeeds now we no
807 longer generate them. Dump enumerated types.
809 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
811 * ctf-types.c (ctf_type_resolve): Improve comment.
812 (ctf_type_size): Yield ECTF_INCOMPLETE when applied to forwards.
813 Emit errors into the right dict.
814 (ctf_type_align): Likewise.
815 * ctf-create.c (ctf_add_member_offset): Yield ECTF_INCOMPLETE
816 when adding a member without explicit offset when this member, or
817 the previous member, is incomplete.
818 * ctf-dump.c (ctf_dump_format_type): Do not try to print the size of
820 (ctf_dump_member): Do not try to print their alignment.
822 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
824 * ctf-dump.c (ctf_dump_objts): Dump by calling ctf_dump_format_type.
825 (ctf_dump_format_type): Don't emit the size for function objects.
826 Dump the element type of arrays like we dump the pointed-to type of
829 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
831 * ctf-dump.c (ctf_dump_format_type): Add 0x to hex type IDs.
832 (ctf_dump_header): Add 0x to the hex magic number.
833 (ctf_dump_str): Add 0x to the hex string offsets.
834 (ctf_dump_membstate_t) <cdm_toplevel_indent>: New.
835 (ctf_dump_type): Adjust. Free it when we're done.
836 (type_hex_digits): New.
837 (ctf_dump_member): Align output depending on the width of the type
838 ID being generated. Use printf padding, not a loop, to generate
841 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
843 * ctf-decl.c (ctf_decl_push): Don't print array decls backwards.
845 2021-01-04 Nicolas Boulenguez <nicolas@debian.org>
848 * configure.ac: Make AC_CONFIG_MACRO_DIR consistent with
849 ACLOCAL_AMFLAGS -I dirs.
850 * configure: Regenerate.
852 2021-01-01 Alan Modra <amodra@gmail.com>
854 Update year range in copyright notice of all files.
856 For older changes see ChangeLog-2020
858 Copyright (C) 2021-2022 Free Software Foundation, Inc.
860 Copying and distribution of this file, with or without modification,
861 are permitted in any medium without royalty provided the copyright
862 notice and this notice are preserved.
868 version-control: never