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