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