1 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
3 * ctf-link.c (ctf_create_per_cu): Drop FILENAME now that it is
4 always identical to CUNAME.
5 (ctf_link_deduplicating_one_symtypetab): Adjust.
6 (ctf_link_one_type): Remove.
7 (ctf_link_one_input_archive_member): Likewise.
8 (ctf_link_close_one_input_archive): Likewise.
9 (ctf_link_one_input_archive): Likewise.
10 (ctf_link): No longer call it. Drop CTF_LINK_NONDEDUP path.
11 Improve header comment a bit (dicts, not files). Adjust
12 ctf_create_per_cu call.
13 (ctf_link_deduplicating_variables): Simplify.
14 (ctf_link_in_member_cb_arg_t) <cu_name>: Remove.
15 <in_input_cu_file>: Likewise.
16 <in_fp_parent>: Likewise.
17 <done_parent>: Likewise.
18 (ctf_link_one_variable): Turn uses of in_file_name to in_cuname.
20 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
22 * ctf-types.c (ctf_member_iter): Move 'rc' to an inner scope.
23 (ctf_enum_iter): Reimplement in terms of ctf_enum_next.
24 (ctf_type_iter): Reimplement in terms of ctf_type_next.
25 (ctf_type_iter_all): Likewise.
26 (ctf_variable_iter): Reimplement in terms of ctf_variable_next.
27 * ctf-archive.c (ctf_archive_iter_internal): Remove.
28 (ctf_archive_iter): Reimplement in terms of ctf_archive_next.
30 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
32 * ctf-archive.c (ctf_archive_next): Set the name of parents in
33 single-member archives.
35 2021-02-26 Alan Modra <amodra@gmail.com>
37 * Makefile.in: Regenerate.
39 2021-02-21 Alan Modra <amodra@gmail.com>
41 * configure.ac: Invoke AC_CANONICAL_TARGET, AC_CANONICAL_HOST
42 and AC_CANONICAL_BUILD.
43 * configure: Regenerate.
44 * Makefile.in: Regenerate.
46 2021-02-20 Nick Alcock <nick.alcock@oracle.com>
48 * ctf-impl.h (ctf_dict_t) <ctf_symhash>: New.
49 <ctf_symhash_latest>: Likewise.
50 (struct ctf_archive_internal) <ctfi_crossdict_cache>: New.
51 <ctfi_symnamedicts>: New.
53 (ctf_lookup_symbol_name): Remove.
54 * ctf-lookup.c (ctf_lookup_symbol_name): Propagate errors from
55 parent properly. Make static.
56 (ctf_lookup_symbol_idx): New, linear search for the symbol name,
57 cached in the crossdict cache's ctf_symhash (if available), or
58 this dict's (otherwise).
59 (ctf_try_lookup_indexed): Allow the symname to be passed in.
60 (ctf_lookup_by_symbol): Turn into a wrapper around...
61 (ctf_lookup_by_sym_or_name): ... this, supporting name lookup too,
62 using ctf_lookup_symbol_idx in non-writable dicts. Special-case
63 name lookup in dynamic dicts without reported symbols, which have
64 no symtab or dynsymidx but where name lookup should still work.
65 (ctf_lookup_by_symbol_name): New, another wrapper.
66 * ctf-archive.c (enosym): Note that this is present in
67 ctfi_symnamedicts too.
68 (ctf_arc_close): Adjust for removal of ctfi_syms. Free the
70 (ctf_arc_flush_caches): Likewise.
71 (ctf_dict_open_cached): Memoize the first cached dict in the
73 (ctf_arc_lookup_symbol): Turn into a wrapper around...
74 (ctf_arc_lookup_sym_or_name): ... this. No longer cache
75 ctf_id_t lookups: just call ctf_lookup_by_symbol as needed (but
76 still cache the dicts those lookups succeed in). Add
77 lookup-by-name support, with dicts of successful lookups cached in
78 ctfi_symnamedicts. Refactor the caching code a bit.
79 (ctf_arc_lookup_symbol_name): New, another wrapper.
80 * ctf-open.c (ctf_dict_close): Free the ctf_symhash.
81 * libctf.ver (LIBCTF_1.2): New version. Add
82 ctf_lookup_by_symbol_name, ctf_arc_lookup_symbol_name.
83 * testsuite/libctf-lookup/enum-symbol.c (main): Use
84 ctf_arc_lookup_symbol rather than looking up the name ourselves.
85 Fish it out repeatedly, to make sure that symbol caching isn't
89 * testsuite/libctf-lookup/enum-symbol-obj.lk: Test symbol lookup
90 in an unlinked object file (indexed symtypetab sections only).
91 * testsuite/libctf-writable/symtypetab-nonlinker-writeout.c
92 (try_maybe_reporting): Check symbol types via
93 ctf_lookup_by_symbol_name as well as ctf_symbol_next.
94 * testsuite/libctf-lookup/conflicting-type-syms.*: New test of
95 lookups in a multi-dict archive.
97 2021-02-20 Alan Modra <amodra@gmail.com>
99 * testsuite/config/default.exp (ld_L_opt): Define.
100 * testsuite/lib/ctf-lib.exp (load_common_lib): Delete. Instead load
102 (run_host_cmd, run_host_cmd_yesno, check_compiler_available): Delete.
103 (compile_one_cc, check_ctf_available): Delete.
105 2021-02-03 Nick Alcock <nick.alcock@oracle.com>
107 * configure.ac (ac_cv_libctf_bfd_elf): Include string.h.
108 * configure: Regenerated.
110 2021-02-03 Nick Alcock <nick.alcock@oracle.com>
112 * configure.ac (EXPECT): Check for, in order to define...
113 (TCL_TRY): ... this, if Tcl supports try/catch.
114 * Makefile.am (TCL_TRY): Run the testsuite only if set.
115 * configure: Regenerated.
116 * Makefile.in: Likewise.
118 2021-02-02 Nick Alcock <nick.alcock@oracle.com>
120 * configure.ac (CTF_LIBADD): Remove explicit -lintl population in
122 * Makefile.am (libctf_nobfd_la_LIBADD): No longer explicitly
124 (check-DEJAGNU): Pass down to tests as well.
125 * configure: Regenerated.
126 * Makefile.in: Likewise.
128 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
130 * ctf-string.c (ctf_str_add): Treat adding a NULL as adding "".
131 (ctf_str_add_ref): Likewise.
132 (ctf_str_add_external): Likewise.
133 * ctf-types.c (ctf_type_name_raw): Always return "" for offset 0.
134 * ctf-dedup.c (ctf_dedup_multiple_input_dicts): Don't armour
136 (ctf_dedup_maybe_synthesize_forward): Likewise.
138 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
140 * ctf-create.c (ctf_serialize): Fix shadowing.
142 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
144 * ctf-create.c (ctf_add_encoded): Add check for non-empty name.
145 (ctf_add_forward): Likewise.
146 (ctf_add_typedef): Likewise.
148 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
150 * ctf-open.c (init_types): Rip out code to check anonymous typedef
152 * ctf-create.c (ctf_add_reftype): Likewise.
153 * ctf-lookup.c (refresh_pptrtab): Likewise.
155 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
157 * ctf-impl.c (_libctf_nonnull_): Add parameters.
158 (LCTF_LINKING): New flag.
159 (ctf_dict_t) <ctf_link_flags>: Mention it.
160 * ctf-link.c (ctf_link): Keep LCTF_LINKING set across call.
161 (ctf_write): Likewise, including in child dictionaries.
162 (ctf_link_shuffle_syms): Make sure ctf_dynsyms is NULL if there
163 are no reported symbols.
164 * ctf-create.c (symtypetab_delete_nonstatic_vars): Make sure
165 the variable has been reported as a symbol by the linker.
166 (symtypetab_skippable): Mention relationship between SYMFP and the
168 (symtypetab_density): Adjust nonnullity. Exit early if no symbols
169 were reported and force-indexing is off (i.e., we are doing a
171 (ctf_serialize): Handle the !LCTF_LINKING case by writing out an
172 indexed, sorted symtypetab (and allow SYMFP to be NULL in this
173 case). Turn sorting off if this is a non-final link. Only delete
174 nonstatic vars if we are filtering symbols and the linker has
176 * testsuite/libctf-regression/nonstatic-var-section-ld-r*:
177 New test of variable and symtypetab section population when
179 * testsuite/libctf-regression/nonstatic-var-section-ld-executable.lk:
180 Likewise, when ld of an executable is used.
181 * testsuite/libctf-regression/nonstatic-var-section-ld.lk:
182 Likewise, when ld -shared alone is used.
183 * testsuite/libctf-regression/nonstatic-var-section-ld*.c:
184 Lookup programs for the above.
185 * testsuite/libctf-writable/symtypetab-nonlinker-writeout.*: New
186 test, testing survival of symbols across ctf_write paths.
187 * testsuite/lib/ctf-lib.exp (run_lookup_test): New option,
188 nonshared, suppressing linking of the SOURCE with -shared.
190 2021-01-19 Nick Alcock <nick.alcock@oracle.com>
192 * ctf-create.c (membadd): Transform ""-named members into
194 * testsuite/libctf-regression/type-add-unnamed-struct*: New test.
196 2021-01-19 Nick Alcock <nick.alcock@oracle.com>
198 * ctf-lookup.c (ctf_lookup_by_name_internal): Do not return the
199 base type if looking up a nonexistent pointer type.
200 * testsuite/libctf-regression/pptrtab*: Test it.
202 2021-01-13 Alan Modra <amodra@gmail.com>
204 * Makefile.in: Regenerate.
206 2021-01-12 H.J. Lu <hongjiu.lu@intel.com>
209 * configure.ac: Use GNU_MAKE_JOBSERVER.
210 * aclocal.m4: Regenerated.
211 * configure: Likewise.
213 2021-01-11 H.J. Lu <hongjiu.lu@intel.com>
216 * configure: Regenerated.
218 2021-01-09 H.J. Lu <hongjiu.lu@intel.com>
220 * configure: Regenerated.
222 2021-01-09 Nick Clifton <nickc@redhat.com>
224 * 2.36 release branch crated.
226 2021-01-09 Alan Modra <amodra@gmail.com>
228 * configure: Regenerate.
230 2021-01-07 Samuel Thibault <samuel.thibault@gnu.org>
232 * configure: Regenerate.
234 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
236 * testsuite/libctf-lookup/struct-iteration.c (main):
237 ctf_member_count returns an int.
239 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
241 * Makefile.am (BASEDIR): New.
243 (check-DEJAGNU): Add development.exp to prerequisites.
244 (development.exp): New.
245 (CONFIG_STATUS_DEPENDENCIES): New.
246 (EXTRA_DEJAGNU_SITE_CONFIG): Likewise.
247 (DISTCLEANFILES): Likewise.
248 * Makefile.in: Regenerated.
249 * testsuite/lib/ctf-lib.exp (check_ctf_available): Return boolean.
250 * testsuite/libctf-lookup/lookup.exp: Call check_ctf_available.
251 * testsuite/libctf-regression/regression.exp: Likewise.
253 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
255 * ctf-types.c (ctf_type_aname): Print forwards to unions and enums
258 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
260 * ctf-impl.h (ctf_dict_t) <ctf_pptrtab>: New.
261 <ctf_pptrtab_len>: New.
262 <ctf_pptrtab_typemax>: New.
263 * ctf-create.c (ctf_serialize): Update accordingly.
264 (ctf_add_reftype): Note that we don't need to update pptrtab here,
265 despite updating ptrtab.
266 * ctf-open.c (ctf_dict_close): Destroy the pptrtab.
267 (ctf_import): Likewise.
268 (ctf_import_unref): Likewise.
269 * ctf-lookup.c (grow_pptrtab): New.
270 (refresh_pptrtab): New, update a pptrtab.
271 (ctf_lookup_by_name): Turn into a wrapper around (and rename to)...
272 (ctf_lookup_by_name_internal): ... this: construct the pptrtab, and
273 use it in addition to the parent's ptrtab when parent dicts are
275 * testsuite/libctf-regression/regression.exp: New testsuite for
277 * testsuite/libctf-regression/pptrtab*: New test.
278 * testsuite/libctf-writable/writable.exp: New testsuite for tests of
280 * testsuite/libctf-writable/pptrtab*: New test.
282 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
284 * ctf-archive.c (ctf_archive_iter): Remove outdated comment.
286 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
288 * ctf-impl.h (struct ctf_next) <u.ctn_next>: Move to...
289 <ctn_next>: ... here.
290 * ctf-util.c (ctf_next_destroy): Unconditionally destroy it.
291 * ctf-lookup.c (ctf_symbol_next): Adjust accordingly.
292 * ctf-types.c (ctf_member_iter): Reimplement in terms of...
293 (ctf_member_next): ... this. Support recursive unnamed member
294 iteration (off by default).
295 (ctf_member_info): Look up members in unnamed sub-structs.
296 * ctf-dedup.c (ctf_dedup_rhash_type): Adjust ctf_member_next call.
297 (ctf_dedup_emit_struct_members): Likewise.
298 * testsuite/libctf-lookup/struct-iteration-ctf.c: Test empty unnamed
299 members, and a normal member after the end.
300 * testsuite/libctf-lookup/struct-iteration.c: Verify that
301 ctf_member_count is consistent with the number of successful returns
302 from a non-recursive ctf_member_next.
303 * testsuite/libctf-lookup/struct-iteration-*: New, test iteration
305 * testsuite/libctf-lookup/struct-lookup.c: New test.
306 * testsuite/libctf-lookup/struct-lookup.lk: New test.
308 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
310 * ctf-link.c (ctf_link_warn_outdated_inputs): New.
311 (ctf_link_write): Call it.
313 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
315 * testsuite/libctf-lookup/enum-symbol.lk: New symbol-lookup test.
316 * testsuite/libctf-lookup/enum-symbol-ctf.c: New CTF input.
317 * testsuite/libctf-lookup/enum-symbol.c: New lookup test.
319 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
321 * Makefile.am (EXPECT): New.
323 (RUNTESTFLAGS): Likewise.
324 (CC_FOR_TARGET): Likewise.
325 (check-DEJAGNU): Likewise.
326 (AUTOMAKE_OPTIONS): Add dejagnu.
327 * Makefile.in: Regenerated.
328 * testsuite/config/default.exp: New.
329 * testsuite/lib/ctf-lib.exp: Likewise.
330 * testsuite/libctf-lookup/enum.lk: New test.
331 * testsuite/libctf-lookup/enum-ctf.c: New CTF input.
332 * testsuite/libctf-lookup/enum.c: New lookup test.
333 * testsuite/libctf-lookup/ambiguous-struct*.c: New test.
334 * testsuite/libctf-lookup/lookup.exp: New.
336 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
338 * configure.ac (BFD_LIBADD): Remove.
339 (BFD_DEPENDENCIES): Likewise. Remove associated cases.
340 (SHARED_LIBADD): Rename to...
341 (CTF_LIBADD): ... this. Stick in a suitable libiberty even when
343 * Makefile.am (libctf_nobfd_la_LIBADD): Adjust accordingly.
345 (libctf_la_LIBADD): Reference libbfd.la directly, not via
347 (libctf_la_DEPENDENCIES): Remove.
348 * Makefile.in: Regenerate.
349 * configure: Likewise.
351 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
353 * ctf-decl.c (ctf_decl_push): Exclude slices from the decl stack.
354 * ctf-types.c (ctf_type_aname): No longer deal with slices here.
355 * ctf-dump.c (ctf_dump_membstate_t) <cdm_toplevel_indent>: Constify.
357 (CTF_FT_BITFIELD): Likewise.
358 (CTF_FT_ID): Likewise.
359 (ctf_dump_member): Do not do indentation here. Migrate the
360 type-printing parts of this into...
361 (ctf_dump_format_type): ... here, to be shared by all type printers.
362 Get the errno value for non-representable types right. Do not print
363 bitfield info for non-bitfields. Improve the format and indentation
364 of other type output. Shuffle spacing around to make all indentation
365 either 'width of column' or 4 chars.
366 (ctf_dump_label): Pass CTF_FT_REFS to ctf_dump_format_type.
367 (ctf_dump_objts): Likewise. Spacing shuffle.
368 (ctf_dump_var): Likewise.
369 (type_hex_digits): Migrate down in the file, to above its new user.
370 (ctf_dump_type): Indent here instead. Pass CTF_FT_REFS to
371 ctf_dump_format_type. Don't trim off excess linefeeds now we no
372 longer generate them. Dump enumerated types.
374 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
376 * ctf-types.c (ctf_type_resolve): Improve comment.
377 (ctf_type_size): Yield ECTF_INCOMPLETE when applied to forwards.
378 Emit errors into the right dict.
379 (ctf_type_align): Likewise.
380 * ctf-create.c (ctf_add_member_offset): Yield ECTF_INCOMPLETE
381 when adding a member without explicit offset when this member, or
382 the previous member, is incomplete.
383 * ctf-dump.c (ctf_dump_format_type): Do not try to print the size of
385 (ctf_dump_member): Do not try to print their alignment.
387 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
389 * ctf-dump.c (ctf_dump_objts): Dump by calling ctf_dump_format_type.
390 (ctf_dump_format_type): Don't emit the size for function objects.
391 Dump the element type of arrays like we dump the pointed-to type of
394 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
396 * ctf-dump.c (ctf_dump_format_type): Add 0x to hex type IDs.
397 (ctf_dump_header): Add 0x to the hex magic number.
398 (ctf_dump_str): Add 0x to the hex string offsets.
399 (ctf_dump_membstate_t) <cdm_toplevel_indent>: New.
400 (ctf_dump_type): Adjust. Free it when we're done.
401 (type_hex_digits): New.
402 (ctf_dump_member): Align output depending on the width of the type
403 ID being generated. Use printf padding, not a loop, to generate
406 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
408 * ctf-decl.c (ctf_decl_push): Don't print array decls backwards.
410 2021-01-04 Nicolas Boulenguez <nicolas@debian.org>
413 * configure.ac: Make AC_CONFIG_MACRO_DIR consistent with
414 ACLOCAL_AMFLAGS -I dirs.
415 * configure: Regenerate.
417 2021-01-01 Alan Modra <amodra@gmail.com>
419 Update year range in copyright notice of all files.
421 For older changes see ChangeLog-2020
423 Copyright (C) 2021 Free Software Foundation, Inc.
425 Copying and distribution of this file, with or without modification,
426 are permitted in any medium without royalty provided the copyright
427 notice and this notice are preserved.
433 version-control: never