1 2021-02-17 Nick Alcock <nick.alcock@oracle.com>
3 * ctf-impl.h (ctf_dict_t) <ctf_symhash>: New.
4 <ctf_symhash_latest>: Likewise.
5 (struct ctf_archive_internal) <ctfi_crossdict_cache>: New.
6 <ctfi_symnamedicts>: New.
8 (ctf_lookup_symbol_name): Remove.
9 * ctf-lookup.c (ctf_lookup_symbol_name): Propagate errors from
10 parent properly. Make static.
11 (ctf_lookup_symbol_idx): New, linear search for the symbol name,
12 cached in the crossdict cache's ctf_symhash (if available), or
13 this dict's (otherwise).
14 (ctf_try_lookup_indexed): Allow the symname to be passed in.
15 (ctf_lookup_by_symbol): Turn into a wrapper around...
16 (ctf_lookup_by_sym_or_name): ... this, supporting name lookup too,
17 using ctf_lookup_symbol_idx in non-writable dicts. Special-case
18 name lookup in dynamic dicts without reported symbols, which have
19 no symtab or dynsymidx but where name lookup should still work.
20 (ctf_lookup_by_symbol_name): New, another wrapper.
21 * ctf-archive.c (enosym): Note that this is present in
22 ctfi_symnamedicts too.
23 (ctf_arc_close): Adjust for removal of ctfi_syms. Free the
25 (ctf_arc_flush_caches): Likewise.
26 (ctf_dict_open_cached): Memoize the first cached dict in the
28 (ctf_arc_lookup_symbol): Turn into a wrapper around...
29 (ctf_arc_lookup_sym_or_name): ... this. No longer cache
30 ctf_id_t lookups: just call ctf_lookup_by_symbol as needed (but
31 still cache the dicts those lookups succeed in). Add
32 lookup-by-name support, with dicts of successful lookups cached in
33 ctfi_symnamedicts. Refactor the caching code a bit.
34 (ctf_arc_lookup_symbol_name): New, another wrapper.
35 * ctf-open.c (ctf_dict_close): Free the ctf_symhash.
36 * libctf.ver (LIBCTF_1.2): New version. Add
37 ctf_lookup_by_symbol_name, ctf_arc_lookup_symbol_name.
38 * testsuite/libctf-lookup/enum-symbol.c (main): Use
39 ctf_arc_lookup_symbol rather than looking up the name ourselves.
40 Fish it out repeatedly, to make sure that symbol caching isn't
44 * testsuite/libctf-lookup/enum-symbol-obj.lk: Test symbol lookup
45 in an unlinked object file (indexed symtypetab sections only).
46 * testsuite/libctf-writable/symtypetab-nonlinker-writeout.c
47 (try_maybe_reporting): Check symbol types via
48 ctf_lookup_by_symbol_name as well as ctf_symbol_next.
49 * testsuite/libctf-lookup/conflicting-type-syms.*: New test of
50 lookups in a multi-dict archive.
52 2021-02-20 Alan Modra <amodra@gmail.com>
54 * testsuite/config/default.exp (ld_L_opt): Define.
55 * testsuite/lib/ctf-lib.exp (load_common_lib): Delete. Instead load
57 (run_host_cmd, run_host_cmd_yesno, check_compiler_available): Delete.
58 (compile_one_cc, check_ctf_available): Delete.
60 2021-02-03 Nick Alcock <nick.alcock@oracle.com>
62 * configure.ac (ac_cv_libctf_bfd_elf): Include string.h.
63 * configure: Regenerated.
65 2021-02-03 Nick Alcock <nick.alcock@oracle.com>
67 * configure.ac (EXPECT): Check for, in order to define...
68 (TCL_TRY): ... this, if Tcl supports try/catch.
69 * Makefile.am (TCL_TRY): Run the testsuite only if set.
70 * configure: Regenerated.
71 * Makefile.in: Likewise.
73 2021-02-02 Nick Alcock <nick.alcock@oracle.com>
75 * configure.ac (CTF_LIBADD): Remove explicit -lintl population in
77 * Makefile.am (libctf_nobfd_la_LIBADD): No longer explicitly
79 (check-DEJAGNU): Pass down to tests as well.
80 * configure: Regenerated.
81 * Makefile.in: Likewise.
83 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
85 * ctf-string.c (ctf_str_add): Treat adding a NULL as adding "".
86 (ctf_str_add_ref): Likewise.
87 (ctf_str_add_external): Likewise.
88 * ctf-types.c (ctf_type_name_raw): Always return "" for offset 0.
89 * ctf-dedup.c (ctf_dedup_multiple_input_dicts): Don't armour
91 (ctf_dedup_maybe_synthesize_forward): Likewise.
93 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
95 * ctf-create.c (ctf_serialize): Fix shadowing.
97 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
99 * ctf-create.c (ctf_add_encoded): Add check for non-empty name.
100 (ctf_add_forward): Likewise.
101 (ctf_add_typedef): Likewise.
103 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
105 * ctf-open.c (init_types): Rip out code to check anonymous typedef
107 * ctf-create.c (ctf_add_reftype): Likewise.
108 * ctf-lookup.c (refresh_pptrtab): Likewise.
110 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
112 * ctf-impl.c (_libctf_nonnull_): Add parameters.
113 (LCTF_LINKING): New flag.
114 (ctf_dict_t) <ctf_link_flags>: Mention it.
115 * ctf-link.c (ctf_link): Keep LCTF_LINKING set across call.
116 (ctf_write): Likewise, including in child dictionaries.
117 (ctf_link_shuffle_syms): Make sure ctf_dynsyms is NULL if there
118 are no reported symbols.
119 * ctf-create.c (symtypetab_delete_nonstatic_vars): Make sure
120 the variable has been reported as a symbol by the linker.
121 (symtypetab_skippable): Mention relationship between SYMFP and the
123 (symtypetab_density): Adjust nonnullity. Exit early if no symbols
124 were reported and force-indexing is off (i.e., we are doing a
126 (ctf_serialize): Handle the !LCTF_LINKING case by writing out an
127 indexed, sorted symtypetab (and allow SYMFP to be NULL in this
128 case). Turn sorting off if this is a non-final link. Only delete
129 nonstatic vars if we are filtering symbols and the linker has
131 * testsuite/libctf-regression/nonstatic-var-section-ld-r*:
132 New test of variable and symtypetab section population when
134 * testsuite/libctf-regression/nonstatic-var-section-ld-executable.lk:
135 Likewise, when ld of an executable is used.
136 * testsuite/libctf-regression/nonstatic-var-section-ld.lk:
137 Likewise, when ld -shared alone is used.
138 * testsuite/libctf-regression/nonstatic-var-section-ld*.c:
139 Lookup programs for the above.
140 * testsuite/libctf-writable/symtypetab-nonlinker-writeout.*: New
141 test, testing survival of symbols across ctf_write paths.
142 * testsuite/lib/ctf-lib.exp (run_lookup_test): New option,
143 nonshared, suppressing linking of the SOURCE with -shared.
145 2021-01-19 Nick Alcock <nick.alcock@oracle.com>
147 * ctf-create.c (membadd): Transform ""-named members into
149 * testsuite/libctf-regression/type-add-unnamed-struct*: New test.
151 2021-01-19 Nick Alcock <nick.alcock@oracle.com>
153 * ctf-lookup.c (ctf_lookup_by_name_internal): Do not return the
154 base type if looking up a nonexistent pointer type.
155 * testsuite/libctf-regression/pptrtab*: Test it.
157 2021-01-13 Alan Modra <amodra@gmail.com>
159 * Makefile.in: Regenerate.
161 2021-01-12 H.J. Lu <hongjiu.lu@intel.com>
164 * configure.ac: Use GNU_MAKE_JOBSERVER.
165 * aclocal.m4: Regenerated.
166 * configure: Likewise.
168 2021-01-11 H.J. Lu <hongjiu.lu@intel.com>
171 * configure: Regenerated.
173 2021-01-09 H.J. Lu <hongjiu.lu@intel.com>
175 * configure: Regenerated.
177 2021-01-09 Nick Clifton <nickc@redhat.com>
179 * 2.36 release branch crated.
181 2021-01-09 Alan Modra <amodra@gmail.com>
183 * configure: Regenerate.
185 2021-01-07 Samuel Thibault <samuel.thibault@gnu.org>
187 * configure: Regenerate.
189 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
191 * testsuite/libctf-lookup/struct-iteration.c (main):
192 ctf_member_count returns an int.
194 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
196 * Makefile.am (BASEDIR): New.
198 (check-DEJAGNU): Add development.exp to prerequisites.
199 (development.exp): New.
200 (CONFIG_STATUS_DEPENDENCIES): New.
201 (EXTRA_DEJAGNU_SITE_CONFIG): Likewise.
202 (DISTCLEANFILES): Likewise.
203 * Makefile.in: Regenerated.
204 * testsuite/lib/ctf-lib.exp (check_ctf_available): Return boolean.
205 * testsuite/libctf-lookup/lookup.exp: Call check_ctf_available.
206 * testsuite/libctf-regression/regression.exp: Likewise.
208 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
210 * ctf-types.c (ctf_type_aname): Print forwards to unions and enums
213 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
215 * ctf-impl.h (ctf_dict_t) <ctf_pptrtab>: New.
216 <ctf_pptrtab_len>: New.
217 <ctf_pptrtab_typemax>: New.
218 * ctf-create.c (ctf_serialize): Update accordingly.
219 (ctf_add_reftype): Note that we don't need to update pptrtab here,
220 despite updating ptrtab.
221 * ctf-open.c (ctf_dict_close): Destroy the pptrtab.
222 (ctf_import): Likewise.
223 (ctf_import_unref): Likewise.
224 * ctf-lookup.c (grow_pptrtab): New.
225 (refresh_pptrtab): New, update a pptrtab.
226 (ctf_lookup_by_name): Turn into a wrapper around (and rename to)...
227 (ctf_lookup_by_name_internal): ... this: construct the pptrtab, and
228 use it in addition to the parent's ptrtab when parent dicts are
230 * testsuite/libctf-regression/regression.exp: New testsuite for
232 * testsuite/libctf-regression/pptrtab*: New test.
233 * testsuite/libctf-writable/writable.exp: New testsuite for tests of
235 * testsuite/libctf-writable/pptrtab*: New test.
237 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
239 * ctf-archive.c (ctf_archive_iter): Remove outdated comment.
241 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
243 * ctf-impl.h (struct ctf_next) <u.ctn_next>: Move to...
244 <ctn_next>: ... here.
245 * ctf-util.c (ctf_next_destroy): Unconditionally destroy it.
246 * ctf-lookup.c (ctf_symbol_next): Adjust accordingly.
247 * ctf-types.c (ctf_member_iter): Reimplement in terms of...
248 (ctf_member_next): ... this. Support recursive unnamed member
249 iteration (off by default).
250 (ctf_member_info): Look up members in unnamed sub-structs.
251 * ctf-dedup.c (ctf_dedup_rhash_type): Adjust ctf_member_next call.
252 (ctf_dedup_emit_struct_members): Likewise.
253 * testsuite/libctf-lookup/struct-iteration-ctf.c: Test empty unnamed
254 members, and a normal member after the end.
255 * testsuite/libctf-lookup/struct-iteration.c: Verify that
256 ctf_member_count is consistent with the number of successful returns
257 from a non-recursive ctf_member_next.
258 * testsuite/libctf-lookup/struct-iteration-*: New, test iteration
260 * testsuite/libctf-lookup/struct-lookup.c: New test.
261 * testsuite/libctf-lookup/struct-lookup.lk: New test.
263 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
265 * ctf-link.c (ctf_link_warn_outdated_inputs): New.
266 (ctf_link_write): Call it.
268 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
270 * testsuite/libctf-lookup/enum-symbol.lk: New symbol-lookup test.
271 * testsuite/libctf-lookup/enum-symbol-ctf.c: New CTF input.
272 * testsuite/libctf-lookup/enum-symbol.c: New lookup test.
274 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
276 * Makefile.am (EXPECT): New.
278 (RUNTESTFLAGS): Likewise.
279 (CC_FOR_TARGET): Likewise.
280 (check-DEJAGNU): Likewise.
281 (AUTOMAKE_OPTIONS): Add dejagnu.
282 * Makefile.in: Regenerated.
283 * testsuite/config/default.exp: New.
284 * testsuite/lib/ctf-lib.exp: Likewise.
285 * testsuite/libctf-lookup/enum.lk: New test.
286 * testsuite/libctf-lookup/enum-ctf.c: New CTF input.
287 * testsuite/libctf-lookup/enum.c: New lookup test.
288 * testsuite/libctf-lookup/ambiguous-struct*.c: New test.
289 * testsuite/libctf-lookup/lookup.exp: New.
291 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
293 * configure.ac (BFD_LIBADD): Remove.
294 (BFD_DEPENDENCIES): Likewise. Remove associated cases.
295 (SHARED_LIBADD): Rename to...
296 (CTF_LIBADD): ... this. Stick in a suitable libiberty even when
298 * Makefile.am (libctf_nobfd_la_LIBADD): Adjust accordingly.
300 (libctf_la_LIBADD): Reference libbfd.la directly, not via
302 (libctf_la_DEPENDENCIES): Remove.
303 * Makefile.in: Regenerate.
304 * configure: Likewise.
306 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
308 * ctf-decl.c (ctf_decl_push): Exclude slices from the decl stack.
309 * ctf-types.c (ctf_type_aname): No longer deal with slices here.
310 * ctf-dump.c (ctf_dump_membstate_t) <cdm_toplevel_indent>: Constify.
312 (CTF_FT_BITFIELD): Likewise.
313 (CTF_FT_ID): Likewise.
314 (ctf_dump_member): Do not do indentation here. Migrate the
315 type-printing parts of this into...
316 (ctf_dump_format_type): ... here, to be shared by all type printers.
317 Get the errno value for non-representable types right. Do not print
318 bitfield info for non-bitfields. Improve the format and indentation
319 of other type output. Shuffle spacing around to make all indentation
320 either 'width of column' or 4 chars.
321 (ctf_dump_label): Pass CTF_FT_REFS to ctf_dump_format_type.
322 (ctf_dump_objts): Likewise. Spacing shuffle.
323 (ctf_dump_var): Likewise.
324 (type_hex_digits): Migrate down in the file, to above its new user.
325 (ctf_dump_type): Indent here instead. Pass CTF_FT_REFS to
326 ctf_dump_format_type. Don't trim off excess linefeeds now we no
327 longer generate them. Dump enumerated types.
329 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
331 * ctf-types.c (ctf_type_resolve): Improve comment.
332 (ctf_type_size): Yield ECTF_INCOMPLETE when applied to forwards.
333 Emit errors into the right dict.
334 (ctf_type_align): Likewise.
335 * ctf-create.c (ctf_add_member_offset): Yield ECTF_INCOMPLETE
336 when adding a member without explicit offset when this member, or
337 the previous member, is incomplete.
338 * ctf-dump.c (ctf_dump_format_type): Do not try to print the size of
340 (ctf_dump_member): Do not try to print their alignment.
342 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
344 * ctf-dump.c (ctf_dump_objts): Dump by calling ctf_dump_format_type.
345 (ctf_dump_format_type): Don't emit the size for function objects.
346 Dump the element type of arrays like we dump the pointed-to type of
349 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
351 * ctf-dump.c (ctf_dump_format_type): Add 0x to hex type IDs.
352 (ctf_dump_header): Add 0x to the hex magic number.
353 (ctf_dump_str): Add 0x to the hex string offsets.
354 (ctf_dump_membstate_t) <cdm_toplevel_indent>: New.
355 (ctf_dump_type): Adjust. Free it when we're done.
356 (type_hex_digits): New.
357 (ctf_dump_member): Align output depending on the width of the type
358 ID being generated. Use printf padding, not a loop, to generate
361 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
363 * ctf-decl.c (ctf_decl_push): Don't print array decls backwards.
365 2021-01-04 Nicolas Boulenguez <nicolas@debian.org>
368 * configure.ac: Make AC_CONFIG_MACRO_DIR consistent with
369 ACLOCAL_AMFLAGS -I dirs.
370 * configure: Regenerate.
372 2021-01-01 Alan Modra <amodra@gmail.com>
374 Update year range in copyright notice of all files.
376 For older changes see ChangeLog-2020
378 Copyright (C) 2021 Free Software Foundation, Inc.
380 Copying and distribution of this file, with or without modification,
381 are permitted in any medium without royalty provided the copyright
382 notice and this notice are preserved.
388 version-control: never