1 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
3 * ctf-dump.c (ctf_dump_format_type): Fix signed/unsigned confusion.
5 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
7 * ctf-dedup.c (ctf_dedup): Pass on errors from ctf_dedup_hash_type.
8 Call ctf_dedup_fini properly on other errors.
9 (ctf_dedup_emit_type): Set the errno on dynhash insertion failure.
10 * ctf-link.c (ctf_link_deduplicating_per_cu): Close outputs beyond
11 output 0 when asserting because >1 output is found.
12 (ctf_link_deduplicating): Likewise, when asserting because the
13 shared output is not the same as the passed-in fp.
15 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
17 * ctf-impl.h (ctf_dict_t) <ctf_link_type_mapping>: No longer used
18 by the nondeduplicating linker.
19 (ctf_add_type_mapping): Removed, now static.
20 (ctf_type_mapping): Likewise.
21 (ctf_dedup_type_mapping): New.
22 (ctf_dedup_t) <cd_input_nums>: New.
23 * ctf-dedup.c (ctf_dedup_init): Populate it.
24 (ctf_dedup_fini): Free it again. Emphasise that this has to be
25 the last thing called.
26 (ctf_dedup): Populate it.
27 (ctf_dedup_populate_type_mapping): Removed.
28 (ctf_dedup_populate_type_mappings): Likewise.
29 (ctf_dedup_emit): No longer call it. No longer call
30 ctf_dedup_fini either.
31 (ctf_dedup_type_mapping): New.
32 * ctf-link.c (ctf_unnamed_cuname): New.
33 (ctf_create_per_cu): Arguments must be non-null now.
34 (ctf_in_member_cb_arg): Removed.
35 (ctf_link): No longer populate it. No longer discard the
37 (ctf_link_deduplicating_one_symtypetab): Use
38 ctf_dedup_type_mapping, not ctf_type_mapping. Use
40 (ctf_link_one_variable): Likewise. Pass in args individually: no
41 longer a ctf_variable_iter callback.
42 (empty_link_type_mapping): Removed.
43 (ctf_link_deduplicating_variables): Use ctf_variable_next, not
44 ctf_variable_iter. No longer pack arguments to
45 ctf_link_one_variable into a struct.
46 (ctf_link_deduplicating_per_cu): Call ctf_dedup_fini once
47 all link phases are done.
48 (ctf_link_deduplicating): Likewise.
49 (ctf_link_intern_extern_string): Improve comment.
50 (ctf_add_type_mapping): Migrate...
51 (ctf_type_mapping): ... these functions...
52 * ctf-create.c (ctf_add_type_mapping): ... here...
53 (ctf_type_mapping): ... and make static, for the sole use of
56 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
58 * ctf-link.c (ctf_link_one_variable): Remove reference to
59 "unconflicted link mode".
61 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
63 * ctf-link.c (ctf_create_per_cu): Drop FILENAME now that it is
64 always identical to CUNAME.
65 (ctf_link_deduplicating_one_symtypetab): Adjust.
66 (ctf_link_one_type): Remove.
67 (ctf_link_one_input_archive_member): Likewise.
68 (ctf_link_close_one_input_archive): Likewise.
69 (ctf_link_one_input_archive): Likewise.
70 (ctf_link): No longer call it. Drop CTF_LINK_NONDEDUP path.
71 Improve header comment a bit (dicts, not files). Adjust
72 ctf_create_per_cu call.
73 (ctf_link_deduplicating_variables): Simplify.
74 (ctf_link_in_member_cb_arg_t) <cu_name>: Remove.
75 <in_input_cu_file>: Likewise.
76 <in_fp_parent>: Likewise.
77 <done_parent>: Likewise.
78 (ctf_link_one_variable): Turn uses of in_file_name to in_cuname.
80 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
82 * ctf-types.c (ctf_member_iter): Move 'rc' to an inner scope.
83 (ctf_enum_iter): Reimplement in terms of ctf_enum_next.
84 (ctf_type_iter): Reimplement in terms of ctf_type_next.
85 (ctf_type_iter_all): Likewise.
86 (ctf_variable_iter): Reimplement in terms of ctf_variable_next.
87 * ctf-archive.c (ctf_archive_iter_internal): Remove.
88 (ctf_archive_iter): Reimplement in terms of ctf_archive_next.
90 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
92 * ctf-archive.c (ctf_archive_next): Set the name of parents in
93 single-member archives.
95 2021-02-26 Alan Modra <amodra@gmail.com>
97 * Makefile.in: Regenerate.
99 2021-02-21 Alan Modra <amodra@gmail.com>
101 * configure.ac: Invoke AC_CANONICAL_TARGET, AC_CANONICAL_HOST
102 and AC_CANONICAL_BUILD.
103 * configure: Regenerate.
104 * Makefile.in: Regenerate.
106 2021-02-20 Nick Alcock <nick.alcock@oracle.com>
108 * ctf-impl.h (ctf_dict_t) <ctf_symhash>: New.
109 <ctf_symhash_latest>: Likewise.
110 (struct ctf_archive_internal) <ctfi_crossdict_cache>: New.
111 <ctfi_symnamedicts>: New.
113 (ctf_lookup_symbol_name): Remove.
114 * ctf-lookup.c (ctf_lookup_symbol_name): Propagate errors from
115 parent properly. Make static.
116 (ctf_lookup_symbol_idx): New, linear search for the symbol name,
117 cached in the crossdict cache's ctf_symhash (if available), or
118 this dict's (otherwise).
119 (ctf_try_lookup_indexed): Allow the symname to be passed in.
120 (ctf_lookup_by_symbol): Turn into a wrapper around...
121 (ctf_lookup_by_sym_or_name): ... this, supporting name lookup too,
122 using ctf_lookup_symbol_idx in non-writable dicts. Special-case
123 name lookup in dynamic dicts without reported symbols, which have
124 no symtab or dynsymidx but where name lookup should still work.
125 (ctf_lookup_by_symbol_name): New, another wrapper.
126 * ctf-archive.c (enosym): Note that this is present in
127 ctfi_symnamedicts too.
128 (ctf_arc_close): Adjust for removal of ctfi_syms. Free the
130 (ctf_arc_flush_caches): Likewise.
131 (ctf_dict_open_cached): Memoize the first cached dict in the
133 (ctf_arc_lookup_symbol): Turn into a wrapper around...
134 (ctf_arc_lookup_sym_or_name): ... this. No longer cache
135 ctf_id_t lookups: just call ctf_lookup_by_symbol as needed (but
136 still cache the dicts those lookups succeed in). Add
137 lookup-by-name support, with dicts of successful lookups cached in
138 ctfi_symnamedicts. Refactor the caching code a bit.
139 (ctf_arc_lookup_symbol_name): New, another wrapper.
140 * ctf-open.c (ctf_dict_close): Free the ctf_symhash.
141 * libctf.ver (LIBCTF_1.2): New version. Add
142 ctf_lookup_by_symbol_name, ctf_arc_lookup_symbol_name.
143 * testsuite/libctf-lookup/enum-symbol.c (main): Use
144 ctf_arc_lookup_symbol rather than looking up the name ourselves.
145 Fish it out repeatedly, to make sure that symbol caching isn't
149 * testsuite/libctf-lookup/enum-symbol-obj.lk: Test symbol lookup
150 in an unlinked object file (indexed symtypetab sections only).
151 * testsuite/libctf-writable/symtypetab-nonlinker-writeout.c
152 (try_maybe_reporting): Check symbol types via
153 ctf_lookup_by_symbol_name as well as ctf_symbol_next.
154 * testsuite/libctf-lookup/conflicting-type-syms.*: New test of
155 lookups in a multi-dict archive.
157 2021-02-20 Alan Modra <amodra@gmail.com>
159 * testsuite/config/default.exp (ld_L_opt): Define.
160 * testsuite/lib/ctf-lib.exp (load_common_lib): Delete. Instead load
162 (run_host_cmd, run_host_cmd_yesno, check_compiler_available): Delete.
163 (compile_one_cc, check_ctf_available): Delete.
165 2021-02-03 Nick Alcock <nick.alcock@oracle.com>
167 * configure.ac (ac_cv_libctf_bfd_elf): Include string.h.
168 * configure: Regenerated.
170 2021-02-03 Nick Alcock <nick.alcock@oracle.com>
172 * configure.ac (EXPECT): Check for, in order to define...
173 (TCL_TRY): ... this, if Tcl supports try/catch.
174 * Makefile.am (TCL_TRY): Run the testsuite only if set.
175 * configure: Regenerated.
176 * Makefile.in: Likewise.
178 2021-02-02 Nick Alcock <nick.alcock@oracle.com>
180 * configure.ac (CTF_LIBADD): Remove explicit -lintl population in
182 * Makefile.am (libctf_nobfd_la_LIBADD): No longer explicitly
184 (check-DEJAGNU): Pass down to tests as well.
185 * configure: Regenerated.
186 * Makefile.in: Likewise.
188 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
190 * ctf-string.c (ctf_str_add): Treat adding a NULL as adding "".
191 (ctf_str_add_ref): Likewise.
192 (ctf_str_add_external): Likewise.
193 * ctf-types.c (ctf_type_name_raw): Always return "" for offset 0.
194 * ctf-dedup.c (ctf_dedup_multiple_input_dicts): Don't armour
196 (ctf_dedup_maybe_synthesize_forward): Likewise.
198 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
200 * ctf-create.c (ctf_serialize): Fix shadowing.
202 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
204 * ctf-create.c (ctf_add_encoded): Add check for non-empty name.
205 (ctf_add_forward): Likewise.
206 (ctf_add_typedef): Likewise.
208 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
210 * ctf-open.c (init_types): Rip out code to check anonymous typedef
212 * ctf-create.c (ctf_add_reftype): Likewise.
213 * ctf-lookup.c (refresh_pptrtab): Likewise.
215 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
217 * ctf-impl.c (_libctf_nonnull_): Add parameters.
218 (LCTF_LINKING): New flag.
219 (ctf_dict_t) <ctf_link_flags>: Mention it.
220 * ctf-link.c (ctf_link): Keep LCTF_LINKING set across call.
221 (ctf_write): Likewise, including in child dictionaries.
222 (ctf_link_shuffle_syms): Make sure ctf_dynsyms is NULL if there
223 are no reported symbols.
224 * ctf-create.c (symtypetab_delete_nonstatic_vars): Make sure
225 the variable has been reported as a symbol by the linker.
226 (symtypetab_skippable): Mention relationship between SYMFP and the
228 (symtypetab_density): Adjust nonnullity. Exit early if no symbols
229 were reported and force-indexing is off (i.e., we are doing a
231 (ctf_serialize): Handle the !LCTF_LINKING case by writing out an
232 indexed, sorted symtypetab (and allow SYMFP to be NULL in this
233 case). Turn sorting off if this is a non-final link. Only delete
234 nonstatic vars if we are filtering symbols and the linker has
236 * testsuite/libctf-regression/nonstatic-var-section-ld-r*:
237 New test of variable and symtypetab section population when
239 * testsuite/libctf-regression/nonstatic-var-section-ld-executable.lk:
240 Likewise, when ld of an executable is used.
241 * testsuite/libctf-regression/nonstatic-var-section-ld.lk:
242 Likewise, when ld -shared alone is used.
243 * testsuite/libctf-regression/nonstatic-var-section-ld*.c:
244 Lookup programs for the above.
245 * testsuite/libctf-writable/symtypetab-nonlinker-writeout.*: New
246 test, testing survival of symbols across ctf_write paths.
247 * testsuite/lib/ctf-lib.exp (run_lookup_test): New option,
248 nonshared, suppressing linking of the SOURCE with -shared.
250 2021-01-19 Nick Alcock <nick.alcock@oracle.com>
252 * ctf-create.c (membadd): Transform ""-named members into
254 * testsuite/libctf-regression/type-add-unnamed-struct*: New test.
256 2021-01-19 Nick Alcock <nick.alcock@oracle.com>
258 * ctf-lookup.c (ctf_lookup_by_name_internal): Do not return the
259 base type if looking up a nonexistent pointer type.
260 * testsuite/libctf-regression/pptrtab*: Test it.
262 2021-01-13 Alan Modra <amodra@gmail.com>
264 * Makefile.in: Regenerate.
266 2021-01-12 H.J. Lu <hongjiu.lu@intel.com>
269 * configure.ac: Use GNU_MAKE_JOBSERVER.
270 * aclocal.m4: Regenerated.
271 * configure: Likewise.
273 2021-01-11 H.J. Lu <hongjiu.lu@intel.com>
276 * configure: Regenerated.
278 2021-01-09 H.J. Lu <hongjiu.lu@intel.com>
280 * configure: Regenerated.
282 2021-01-09 Nick Clifton <nickc@redhat.com>
284 * 2.36 release branch crated.
286 2021-01-09 Alan Modra <amodra@gmail.com>
288 * configure: Regenerate.
290 2021-01-07 Samuel Thibault <samuel.thibault@gnu.org>
292 * configure: Regenerate.
294 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
296 * testsuite/libctf-lookup/struct-iteration.c (main):
297 ctf_member_count returns an int.
299 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
301 * Makefile.am (BASEDIR): New.
303 (check-DEJAGNU): Add development.exp to prerequisites.
304 (development.exp): New.
305 (CONFIG_STATUS_DEPENDENCIES): New.
306 (EXTRA_DEJAGNU_SITE_CONFIG): Likewise.
307 (DISTCLEANFILES): Likewise.
308 * Makefile.in: Regenerated.
309 * testsuite/lib/ctf-lib.exp (check_ctf_available): Return boolean.
310 * testsuite/libctf-lookup/lookup.exp: Call check_ctf_available.
311 * testsuite/libctf-regression/regression.exp: Likewise.
313 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
315 * ctf-types.c (ctf_type_aname): Print forwards to unions and enums
318 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
320 * ctf-impl.h (ctf_dict_t) <ctf_pptrtab>: New.
321 <ctf_pptrtab_len>: New.
322 <ctf_pptrtab_typemax>: New.
323 * ctf-create.c (ctf_serialize): Update accordingly.
324 (ctf_add_reftype): Note that we don't need to update pptrtab here,
325 despite updating ptrtab.
326 * ctf-open.c (ctf_dict_close): Destroy the pptrtab.
327 (ctf_import): Likewise.
328 (ctf_import_unref): Likewise.
329 * ctf-lookup.c (grow_pptrtab): New.
330 (refresh_pptrtab): New, update a pptrtab.
331 (ctf_lookup_by_name): Turn into a wrapper around (and rename to)...
332 (ctf_lookup_by_name_internal): ... this: construct the pptrtab, and
333 use it in addition to the parent's ptrtab when parent dicts are
335 * testsuite/libctf-regression/regression.exp: New testsuite for
337 * testsuite/libctf-regression/pptrtab*: New test.
338 * testsuite/libctf-writable/writable.exp: New testsuite for tests of
340 * testsuite/libctf-writable/pptrtab*: New test.
342 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
344 * ctf-archive.c (ctf_archive_iter): Remove outdated comment.
346 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
348 * ctf-impl.h (struct ctf_next) <u.ctn_next>: Move to...
349 <ctn_next>: ... here.
350 * ctf-util.c (ctf_next_destroy): Unconditionally destroy it.
351 * ctf-lookup.c (ctf_symbol_next): Adjust accordingly.
352 * ctf-types.c (ctf_member_iter): Reimplement in terms of...
353 (ctf_member_next): ... this. Support recursive unnamed member
354 iteration (off by default).
355 (ctf_member_info): Look up members in unnamed sub-structs.
356 * ctf-dedup.c (ctf_dedup_rhash_type): Adjust ctf_member_next call.
357 (ctf_dedup_emit_struct_members): Likewise.
358 * testsuite/libctf-lookup/struct-iteration-ctf.c: Test empty unnamed
359 members, and a normal member after the end.
360 * testsuite/libctf-lookup/struct-iteration.c: Verify that
361 ctf_member_count is consistent with the number of successful returns
362 from a non-recursive ctf_member_next.
363 * testsuite/libctf-lookup/struct-iteration-*: New, test iteration
365 * testsuite/libctf-lookup/struct-lookup.c: New test.
366 * testsuite/libctf-lookup/struct-lookup.lk: New test.
368 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
370 * ctf-link.c (ctf_link_warn_outdated_inputs): New.
371 (ctf_link_write): Call it.
373 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
375 * testsuite/libctf-lookup/enum-symbol.lk: New symbol-lookup test.
376 * testsuite/libctf-lookup/enum-symbol-ctf.c: New CTF input.
377 * testsuite/libctf-lookup/enum-symbol.c: New lookup test.
379 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
381 * Makefile.am (EXPECT): New.
383 (RUNTESTFLAGS): Likewise.
384 (CC_FOR_TARGET): Likewise.
385 (check-DEJAGNU): Likewise.
386 (AUTOMAKE_OPTIONS): Add dejagnu.
387 * Makefile.in: Regenerated.
388 * testsuite/config/default.exp: New.
389 * testsuite/lib/ctf-lib.exp: Likewise.
390 * testsuite/libctf-lookup/enum.lk: New test.
391 * testsuite/libctf-lookup/enum-ctf.c: New CTF input.
392 * testsuite/libctf-lookup/enum.c: New lookup test.
393 * testsuite/libctf-lookup/ambiguous-struct*.c: New test.
394 * testsuite/libctf-lookup/lookup.exp: New.
396 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
398 * configure.ac (BFD_LIBADD): Remove.
399 (BFD_DEPENDENCIES): Likewise. Remove associated cases.
400 (SHARED_LIBADD): Rename to...
401 (CTF_LIBADD): ... this. Stick in a suitable libiberty even when
403 * Makefile.am (libctf_nobfd_la_LIBADD): Adjust accordingly.
405 (libctf_la_LIBADD): Reference libbfd.la directly, not via
407 (libctf_la_DEPENDENCIES): Remove.
408 * Makefile.in: Regenerate.
409 * configure: Likewise.
411 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
413 * ctf-decl.c (ctf_decl_push): Exclude slices from the decl stack.
414 * ctf-types.c (ctf_type_aname): No longer deal with slices here.
415 * ctf-dump.c (ctf_dump_membstate_t) <cdm_toplevel_indent>: Constify.
417 (CTF_FT_BITFIELD): Likewise.
418 (CTF_FT_ID): Likewise.
419 (ctf_dump_member): Do not do indentation here. Migrate the
420 type-printing parts of this into...
421 (ctf_dump_format_type): ... here, to be shared by all type printers.
422 Get the errno value for non-representable types right. Do not print
423 bitfield info for non-bitfields. Improve the format and indentation
424 of other type output. Shuffle spacing around to make all indentation
425 either 'width of column' or 4 chars.
426 (ctf_dump_label): Pass CTF_FT_REFS to ctf_dump_format_type.
427 (ctf_dump_objts): Likewise. Spacing shuffle.
428 (ctf_dump_var): Likewise.
429 (type_hex_digits): Migrate down in the file, to above its new user.
430 (ctf_dump_type): Indent here instead. Pass CTF_FT_REFS to
431 ctf_dump_format_type. Don't trim off excess linefeeds now we no
432 longer generate them. Dump enumerated types.
434 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
436 * ctf-types.c (ctf_type_resolve): Improve comment.
437 (ctf_type_size): Yield ECTF_INCOMPLETE when applied to forwards.
438 Emit errors into the right dict.
439 (ctf_type_align): Likewise.
440 * ctf-create.c (ctf_add_member_offset): Yield ECTF_INCOMPLETE
441 when adding a member without explicit offset when this member, or
442 the previous member, is incomplete.
443 * ctf-dump.c (ctf_dump_format_type): Do not try to print the size of
445 (ctf_dump_member): Do not try to print their alignment.
447 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
449 * ctf-dump.c (ctf_dump_objts): Dump by calling ctf_dump_format_type.
450 (ctf_dump_format_type): Don't emit the size for function objects.
451 Dump the element type of arrays like we dump the pointed-to type of
454 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
456 * ctf-dump.c (ctf_dump_format_type): Add 0x to hex type IDs.
457 (ctf_dump_header): Add 0x to the hex magic number.
458 (ctf_dump_str): Add 0x to the hex string offsets.
459 (ctf_dump_membstate_t) <cdm_toplevel_indent>: New.
460 (ctf_dump_type): Adjust. Free it when we're done.
461 (type_hex_digits): New.
462 (ctf_dump_member): Align output depending on the width of the type
463 ID being generated. Use printf padding, not a loop, to generate
466 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
468 * ctf-decl.c (ctf_decl_push): Don't print array decls backwards.
470 2021-01-04 Nicolas Boulenguez <nicolas@debian.org>
473 * configure.ac: Make AC_CONFIG_MACRO_DIR consistent with
474 ACLOCAL_AMFLAGS -I dirs.
475 * configure: Regenerate.
477 2021-01-01 Alan Modra <amodra@gmail.com>
479 Update year range in copyright notice of all files.
481 For older changes see ChangeLog-2020
483 Copyright (C) 2021 Free Software Foundation, Inc.
485 Copying and distribution of this file, with or without modification,
486 are permitted in any medium without royalty provided the copyright
487 notice and this notice are preserved.
493 version-control: never