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