]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - libctf/ChangeLog
libctf, include: find types of symbols by name
[thirdparty/binutils-gdb.git] / libctf / ChangeLog
1 2021-02-17 Nick Alcock <nick.alcock@oracle.com>
2
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.
7 <ctfi_syms>: Remove.
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
24 ctfi_symnamedicts.
25 (ctf_arc_flush_caches): Likewise.
26 (ctf_dict_open_cached): Memoize the first cached dict in the
27 crossdict cache.
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
41 broken.
42 (symidx_64): Remove.
43 (symidx_32): Remove.
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.
51
52 2021-02-20 Alan Modra <amodra@gmail.com>
53
54 * testsuite/config/default.exp (ld_L_opt): Define.
55 * testsuite/lib/ctf-lib.exp (load_common_lib): Delete. Instead load
56 ld-lib.exp.
57 (run_host_cmd, run_host_cmd_yesno, check_compiler_available): Delete.
58 (compile_one_cc, check_ctf_available): Delete.
59
60 2021-02-03 Nick Alcock <nick.alcock@oracle.com>
61
62 * configure.ac (ac_cv_libctf_bfd_elf): Include string.h.
63 * configure: Regenerated.
64
65 2021-02-03 Nick Alcock <nick.alcock@oracle.com>
66
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.
72
73 2021-02-02 Nick Alcock <nick.alcock@oracle.com>
74
75 * configure.ac (CTF_LIBADD): Remove explicit -lintl population in
76 favour of LIBINTL.
77 * Makefile.am (libctf_nobfd_la_LIBADD): No longer explicitly
78 include $(LIBINTL).
79 (check-DEJAGNU): Pass down to tests as well.
80 * configure: Regenerated.
81 * Makefile.in: Likewise.
82
83 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
84
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
90 against NULL name.
91 (ctf_dedup_maybe_synthesize_forward): Likewise.
92
93 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
94
95 * ctf-create.c (ctf_serialize): Fix shadowing.
96
97 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
98
99 * ctf-create.c (ctf_add_encoded): Add check for non-empty name.
100 (ctf_add_forward): Likewise.
101 (ctf_add_typedef): Likewise.
102
103 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
104
105 * ctf-open.c (init_types): Rip out code to check anonymous typedef
106 nodes.
107 * ctf-create.c (ctf_add_reftype): Likewise.
108 * ctf-lookup.c (refresh_pptrtab): Likewise.
109
110 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
111
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
122 flags.
123 (symtypetab_density): Adjust nonnullity. Exit early if no symbols
124 were reported and force-indexing is off (i.e., we are doing a
125 final link).
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
130 reported some.
131 * testsuite/libctf-regression/nonstatic-var-section-ld-r*:
132 New test of variable and symtypetab section population when
133 ld -r is used.
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.
144
145 2021-01-19 Nick Alcock <nick.alcock@oracle.com>
146
147 * ctf-create.c (membadd): Transform ""-named members into
148 NULL-named ones.
149 * testsuite/libctf-regression/type-add-unnamed-struct*: New test.
150
151 2021-01-19 Nick Alcock <nick.alcock@oracle.com>
152
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.
156
157 2021-01-13 Alan Modra <amodra@gmail.com>
158
159 * Makefile.in: Regenerate.
160
161 2021-01-12 H.J. Lu <hongjiu.lu@intel.com>
162
163 PR binutils/26792
164 * configure.ac: Use GNU_MAKE_JOBSERVER.
165 * aclocal.m4: Regenerated.
166 * configure: Likewise.
167
168 2021-01-11 H.J. Lu <hongjiu.lu@intel.com>
169
170 PR ld/27173
171 * configure: Regenerated.
172
173 2021-01-09 H.J. Lu <hongjiu.lu@intel.com>
174
175 * configure: Regenerated.
176
177 2021-01-09 Nick Clifton <nickc@redhat.com>
178
179 * 2.36 release branch crated.
180
181 2021-01-09 Alan Modra <amodra@gmail.com>
182
183 * configure: Regenerate.
184
185 2021-01-07 Samuel Thibault <samuel.thibault@gnu.org>
186
187 * configure: Regenerate.
188
189 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
190
191 * testsuite/libctf-lookup/struct-iteration.c (main):
192 ctf_member_count returns an int.
193
194 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
195
196 * Makefile.am (BASEDIR): New.
197 (BFDDIR): Likewise.
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.
207
208 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
209
210 * ctf-types.c (ctf_type_aname): Print forwards to unions and enums
211 properly.
212
213 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
214
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
229 searched.
230 * testsuite/libctf-regression/regression.exp: New testsuite for
231 regression tests.
232 * testsuite/libctf-regression/pptrtab*: New test.
233 * testsuite/libctf-writable/writable.exp: New testsuite for tests of
234 writable CTF dicts.
235 * testsuite/libctf-writable/pptrtab*: New test.
236
237 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
238
239 * ctf-archive.c (ctf_archive_iter): Remove outdated comment.
240
241 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
242
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
259 over struct members.
260 * testsuite/libctf-lookup/struct-lookup.c: New test.
261 * testsuite/libctf-lookup/struct-lookup.lk: New test.
262
263 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
264
265 * ctf-link.c (ctf_link_warn_outdated_inputs): New.
266 (ctf_link_write): Call it.
267
268 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
269
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.
273
274 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
275
276 * Makefile.am (EXPECT): New.
277 (RUNTEST): Likewise.
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.
290
291 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
292
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
297 linking statically.
298 * Makefile.am (libctf_nobfd_la_LIBADD): Adjust accordingly.
299 libctf uses libintl.
300 (libctf_la_LIBADD): Reference libbfd.la directly, not via
301 BFD_LIBADD.
302 (libctf_la_DEPENDENCIES): Remove.
303 * Makefile.in: Regenerate.
304 * configure: Likewise.
305
306 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
307
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.
311 (CTF_FT_REFS): New.
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.
328
329 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
330
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
339 forwards.
340 (ctf_dump_member): Do not try to print their alignment.
341
342 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
343
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
347 pointers, etc.
348
349 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
350
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
359 indentation.
360
361 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
362
363 * ctf-decl.c (ctf_decl_push): Don't print array decls backwards.
364
365 2021-01-04 Nicolas Boulenguez <nicolas@debian.org>
366
367 PR 27117
368 * configure.ac: Make AC_CONFIG_MACRO_DIR consistent with
369 ACLOCAL_AMFLAGS -I dirs.
370 * configure: Regenerate.
371
372 2021-01-01 Alan Modra <amodra@gmail.com>
373
374 Update year range in copyright notice of all files.
375
376 For older changes see ChangeLog-2020
377 \f
378 Copyright (C) 2021 Free Software Foundation, Inc.
379
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.
383
384 Local Variables:
385 mode: change-log
386 left-margin: 8
387 fill-column: 74
388 version-control: never
389 End: