libctf: eliminate dtd_u, part 4: enums
[deliverable/binutils-gdb.git] / libctf / ChangeLog
1 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
2
3 * ctf-impl.h (ctf_dtdef_t) <dtd_vlen_alloc>: New.
4 (ctf_str_move_pending): Declare.
5 * ctf-string.c (ctf_str_add_ref_internal): Fix error return.
6 (ctf_str_move_pending): New.
7 * ctf-create.c (ctf_grow_vlen): New.
8 (ctf_dtd_delete): Zero out the vlen_alloc after free. Free the
9 vlen later: iterate over it and free enum name refs first.
10 (ctf_add_generic): Populate dtd_vlen_alloc from vlen.
11 (ctf_add_enum): populate the vlen; do it by hand if promoting
12 forwards.
13 (ctf_add_enumerator): Set up the vlen rather than the dmd. Expand
14 it as needed, repointing string refs via ctf_str_move_pending. Add
15 the enumerand names as pending strings.
16 * ctf-serialize.c (ctf_copy_emembers): Remove.
17 (ctf_emit_type_sect): Copy the vlen into place and ref the
18 strings.
19 * ctf-types.c (ctf_enum_next): The dynamic portion now uses
20 the same code as the non-dynamic.
21 (ctf_enum_name): Likewise.
22 (ctf_enum_value): Likewise.
23 * testsuite/libctf-lookup/enum-many-ctf.c: New test.
24 * testsuite/libctf-lookup/enum-many.lk: New test.
25
26 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
27
28 * ctf-hash.c (ctf_dynset_elements): New.
29 * ctf-impl.h (ctf_dynset_elements): Declare it.
30 (ctf_str_add_pending): Likewise.
31 (ctf_dict_t) <ctf_str_pending_ref>: New, set of refs that must be
32 added during serialization.
33 * ctf-string.c (ctf_str_create_atoms): Initialize it.
34 (CTF_STR_ADD_REF): New flag.
35 (CTF_STR_MAKE_PROVISIONAL): Likewise.
36 (CTF_STR_PENDING_REF): Likewise.
37 (ctf_str_add_ref_internal): Take a flags word rather than int
38 params. Populate, and clear out, ctf_str_pending_ref.
39 (ctf_str_add): Adjust accordingly.
40 (ctf_str_add_external): Likewise.
41 (ctf_str_add_pending): New.
42 (ctf_str_remove_ref): Also remove the potential ref if it is a
43 pending ref.
44 * ctf-serialize.c (ctf_serialize): Prohibit addition of strings
45 with ctf_str_add_ref before serialization. Ensure that the
46 ctf_str_pending_ref set is empty before strtab finalization.
47 (ctf_emit_type_sect): Add a ref to the ctt_name.
48 * ctf-create.c (ctf_add_generic): Add the ctt_name as a pending
49 ref.
50 * testsuite/libctf-writable/reserialize-strtab-corruption.*: New test.
51
52 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
53
54 * ctf-serialize.c (ctf_serialize): Preserve ctf_typemax across
55 serialization.
56
57 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
58
59 * ctf-impl.h (ctf_dtdef_t) <dtd_u.dtu_argv>: Remove.
60 * ctf-create.c (ctf_dtd_delete): No longer free it.
61 (ctf_add_function): Use the dtd_vlen, not dtu_argv. Properly align.
62 * ctf-serialize.c (ctf_emit_type_sect): Just copy the dtd_vlen.
63 * ctf-types.c (ctf_func_type_info): Just use the vlen.
64 (ctf_func_type_args): Likewise.
65
66 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
67
68 * ctf-impl.h (ctf_dtdef_t) <dtd_u.dtu_arr>: Remove.
69 * ctf-create.c (ctf_add_array): Use the dtd_vlen, not dtu_arr.
70 (ctf_set_array): Likewise.
71 * ctf-serialize.c (ctf_emit_type_sect): Just copy the dtd_vlen.
72 * ctf-types.c (ctf_array_info): Just use the vlen.
73
74 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
75
76 * ctf-impl.h (ctf_dtdef_t) <dtd_u.dtu_enc>: Remove.
77 <dtd_u.dtu_slice>: Likewise.
78 <dtd_vlen>: New.
79 * ctf-create.c (ctf_add_generic): Perhaps allocate it. All
80 callers adjusted.
81 (ctf_dtd_delete): Free it.
82 (ctf_add_slice): Use the dtd_vlen, not dtu_enc.
83 (ctf_add_encoded): Likewise. Assert that this must be an int or
84 float.
85 * ctf-serialize.c (ctf_emit_type_sect): Just copy the dtd_vlen.
86 * ctf-dedup.c (ctf_dedup_rhash_type): Use the dtd_vlen, not
87 dtu_slice.
88 * ctf-types.c (ctf_type_reference): Likewise.
89 (ctf_type_encoding): Remove most dynamic-type-specific code: just
90 get the vlen from the right place. Report failure to look up the
91 underlying type's encoding.
92
93 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
94
95 * ctf-archive.c (ctf_archive_next): GNU style fix for do {} while.
96 * ctf-dedup.c (ctf_dedup_rhash_type): Likewise.
97 (ctf_dedup_rwalk_one_output_mapping): Likewise.
98 * ctf-dump.c (ctf_dump_format_type): Likewise.
99 * ctf-lookup.c (ctf_symbol_next): Likewise.
100 * swap.h (swap_thing): Likewise.
101
102 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
103
104 * ctf-serialize.c: General reshuffling, and...
105 (emit_symtypetab_state_t): New, migrated from
106 local variables in ctf_serialize.
107 (ctf_serialize): Split out most section sizing and
108 emission.
109 (ctf_symtypetab_sect_sizes): New (split out).
110 (ctf_emit_symtypetab_sects): Likewise.
111 (ctf_type_sect_size): Likewise.
112 (ctf_emit_type_sect): Likewise.
113
114 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
115
116 * ctf-impl.h (ctf_dict_t): Fix comment.
117
118 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
119
120 * ctf-create.c (symtypetab_delete_nonstatic_vars): Move
121 into ctf-serialize.c.
122 (ctf_symtab_skippable): Likewise.
123 (CTF_SYMTYPETAB_EMIT_FUNCTION): Likewise.
124 (CTF_SYMTYPETAB_EMIT_PAD): Likewise.
125 (CTF_SYMTYPETAB_FORCE_INDEXED): Likewise.
126 (symtypetab_density): Likewise.
127 (emit_symtypetab): Likewise.
128 (emit_symtypetab_index): Likewise.
129 (ctf_copy_smembers): Likewise.
130 (ctf_copy_lmembers): Likewise.
131 (ctf_copy_emembers): Likewise.
132 (ctf_sort_var): Likewise.
133 (ctf_serialize): Likewise.
134 (ctf_gzwrite): Likewise.
135 (ctf_compress_write): Likewise.
136 (ctf_write_mem): Likewise.
137 (ctf_write): Likewise.
138 * ctf-serialize.c: New file.
139 * Makefile.am (libctf_nobfd_la_SOURCES): Add it.
140 * Makefile.in: Regenerate.
141
142 2021-03-18 Nick Alcock <nick.alcock@oracle.com>
143
144 * ctf-link.c (ctf_link_lazy_open): Move up in the file, to near
145 ctf_link_add_ctf.
146 * ctf-lookup.c (ctf_lookup_symbol_idx): Repair tabdamage.
147 (ctf_lookup_by_sym_or_name): Likewise.
148 * testsuite/libctf-lookup/struct-iteration.c: Likewise.
149 * testsuite/libctf-regression/type-add-unnamed-struct.c: Likewise.
150
151 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
152
153 * ctf-create.c (symtypetab_density): Report the symbol name as
154 well as index in the name != object error; note the likely
155 consequences.
156 * ctf-link.c (ctf_link_shuffle_syms): Report the symbol index
157 as well as name.
158
159 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
160
161 * ctf-link.c (ctf_link_shuffle_syms): Free ctf_dynsyms properly.
162
163 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
164
165 * ctf-dump.c (ctf_dump_format_type): Fix signed/unsigned confusion.
166
167 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
168
169 * ctf-dedup.c (ctf_dedup): Pass on errors from ctf_dedup_hash_type.
170 Call ctf_dedup_fini properly on other errors.
171 (ctf_dedup_emit_type): Set the errno on dynhash insertion failure.
172 * ctf-link.c (ctf_link_deduplicating_per_cu): Close outputs beyond
173 output 0 when asserting because >1 output is found.
174 (ctf_link_deduplicating): Likewise, when asserting because the
175 shared output is not the same as the passed-in fp.
176
177 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
178
179 * ctf-impl.h (ctf_dict_t) <ctf_link_type_mapping>: No longer used
180 by the nondeduplicating linker.
181 (ctf_add_type_mapping): Removed, now static.
182 (ctf_type_mapping): Likewise.
183 (ctf_dedup_type_mapping): New.
184 (ctf_dedup_t) <cd_input_nums>: New.
185 * ctf-dedup.c (ctf_dedup_init): Populate it.
186 (ctf_dedup_fini): Free it again. Emphasise that this has to be
187 the last thing called.
188 (ctf_dedup): Populate it.
189 (ctf_dedup_populate_type_mapping): Removed.
190 (ctf_dedup_populate_type_mappings): Likewise.
191 (ctf_dedup_emit): No longer call it. No longer call
192 ctf_dedup_fini either.
193 (ctf_dedup_type_mapping): New.
194 * ctf-link.c (ctf_unnamed_cuname): New.
195 (ctf_create_per_cu): Arguments must be non-null now.
196 (ctf_in_member_cb_arg): Removed.
197 (ctf_link): No longer populate it. No longer discard the
198 mapping table.
199 (ctf_link_deduplicating_one_symtypetab): Use
200 ctf_dedup_type_mapping, not ctf_type_mapping. Use
201 ctf_unnamed_cuname.
202 (ctf_link_one_variable): Likewise. Pass in args individually: no
203 longer a ctf_variable_iter callback.
204 (empty_link_type_mapping): Removed.
205 (ctf_link_deduplicating_variables): Use ctf_variable_next, not
206 ctf_variable_iter. No longer pack arguments to
207 ctf_link_one_variable into a struct.
208 (ctf_link_deduplicating_per_cu): Call ctf_dedup_fini once
209 all link phases are done.
210 (ctf_link_deduplicating): Likewise.
211 (ctf_link_intern_extern_string): Improve comment.
212 (ctf_add_type_mapping): Migrate...
213 (ctf_type_mapping): ... these functions...
214 * ctf-create.c (ctf_add_type_mapping): ... here...
215 (ctf_type_mapping): ... and make static, for the sole use of
216 ctf_add_type.
217
218 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
219
220 * ctf-link.c (ctf_link_one_variable): Remove reference to
221 "unconflicted link mode".
222
223 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
224
225 * ctf-link.c (ctf_create_per_cu): Drop FILENAME now that it is
226 always identical to CUNAME.
227 (ctf_link_deduplicating_one_symtypetab): Adjust.
228 (ctf_link_one_type): Remove.
229 (ctf_link_one_input_archive_member): Likewise.
230 (ctf_link_close_one_input_archive): Likewise.
231 (ctf_link_one_input_archive): Likewise.
232 (ctf_link): No longer call it. Drop CTF_LINK_NONDEDUP path.
233 Improve header comment a bit (dicts, not files). Adjust
234 ctf_create_per_cu call.
235 (ctf_link_deduplicating_variables): Simplify.
236 (ctf_link_in_member_cb_arg_t) <cu_name>: Remove.
237 <in_input_cu_file>: Likewise.
238 <in_fp_parent>: Likewise.
239 <done_parent>: Likewise.
240 (ctf_link_one_variable): Turn uses of in_file_name to in_cuname.
241
242 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
243
244 * ctf-types.c (ctf_member_iter): Move 'rc' to an inner scope.
245 (ctf_enum_iter): Reimplement in terms of ctf_enum_next.
246 (ctf_type_iter): Reimplement in terms of ctf_type_next.
247 (ctf_type_iter_all): Likewise.
248 (ctf_variable_iter): Reimplement in terms of ctf_variable_next.
249 * ctf-archive.c (ctf_archive_iter_internal): Remove.
250 (ctf_archive_iter): Reimplement in terms of ctf_archive_next.
251
252 2021-03-02 Nick Alcock <nick.alcock@oracle.com>
253
254 * ctf-archive.c (ctf_archive_next): Set the name of parents in
255 single-member archives.
256
257 2021-02-26 Alan Modra <amodra@gmail.com>
258
259 * Makefile.in: Regenerate.
260
261 2021-02-21 Alan Modra <amodra@gmail.com>
262
263 * configure.ac: Invoke AC_CANONICAL_TARGET, AC_CANONICAL_HOST
264 and AC_CANONICAL_BUILD.
265 * configure: Regenerate.
266 * Makefile.in: Regenerate.
267
268 2021-02-20 Nick Alcock <nick.alcock@oracle.com>
269
270 * ctf-impl.h (ctf_dict_t) <ctf_symhash>: New.
271 <ctf_symhash_latest>: Likewise.
272 (struct ctf_archive_internal) <ctfi_crossdict_cache>: New.
273 <ctfi_symnamedicts>: New.
274 <ctfi_syms>: Remove.
275 (ctf_lookup_symbol_name): Remove.
276 * ctf-lookup.c (ctf_lookup_symbol_name): Propagate errors from
277 parent properly. Make static.
278 (ctf_lookup_symbol_idx): New, linear search for the symbol name,
279 cached in the crossdict cache's ctf_symhash (if available), or
280 this dict's (otherwise).
281 (ctf_try_lookup_indexed): Allow the symname to be passed in.
282 (ctf_lookup_by_symbol): Turn into a wrapper around...
283 (ctf_lookup_by_sym_or_name): ... this, supporting name lookup too,
284 using ctf_lookup_symbol_idx in non-writable dicts. Special-case
285 name lookup in dynamic dicts without reported symbols, which have
286 no symtab or dynsymidx but where name lookup should still work.
287 (ctf_lookup_by_symbol_name): New, another wrapper.
288 * ctf-archive.c (enosym): Note that this is present in
289 ctfi_symnamedicts too.
290 (ctf_arc_close): Adjust for removal of ctfi_syms. Free the
291 ctfi_symnamedicts.
292 (ctf_arc_flush_caches): Likewise.
293 (ctf_dict_open_cached): Memoize the first cached dict in the
294 crossdict cache.
295 (ctf_arc_lookup_symbol): Turn into a wrapper around...
296 (ctf_arc_lookup_sym_or_name): ... this. No longer cache
297 ctf_id_t lookups: just call ctf_lookup_by_symbol as needed (but
298 still cache the dicts those lookups succeed in). Add
299 lookup-by-name support, with dicts of successful lookups cached in
300 ctfi_symnamedicts. Refactor the caching code a bit.
301 (ctf_arc_lookup_symbol_name): New, another wrapper.
302 * ctf-open.c (ctf_dict_close): Free the ctf_symhash.
303 * libctf.ver (LIBCTF_1.2): New version. Add
304 ctf_lookup_by_symbol_name, ctf_arc_lookup_symbol_name.
305 * testsuite/libctf-lookup/enum-symbol.c (main): Use
306 ctf_arc_lookup_symbol rather than looking up the name ourselves.
307 Fish it out repeatedly, to make sure that symbol caching isn't
308 broken.
309 (symidx_64): Remove.
310 (symidx_32): Remove.
311 * testsuite/libctf-lookup/enum-symbol-obj.lk: Test symbol lookup
312 in an unlinked object file (indexed symtypetab sections only).
313 * testsuite/libctf-writable/symtypetab-nonlinker-writeout.c
314 (try_maybe_reporting): Check symbol types via
315 ctf_lookup_by_symbol_name as well as ctf_symbol_next.
316 * testsuite/libctf-lookup/conflicting-type-syms.*: New test of
317 lookups in a multi-dict archive.
318
319 2021-02-20 Alan Modra <amodra@gmail.com>
320
321 * testsuite/config/default.exp (ld_L_opt): Define.
322 * testsuite/lib/ctf-lib.exp (load_common_lib): Delete. Instead load
323 ld-lib.exp.
324 (run_host_cmd, run_host_cmd_yesno, check_compiler_available): Delete.
325 (compile_one_cc, check_ctf_available): Delete.
326
327 2021-02-03 Nick Alcock <nick.alcock@oracle.com>
328
329 * configure.ac (ac_cv_libctf_bfd_elf): Include string.h.
330 * configure: Regenerated.
331
332 2021-02-03 Nick Alcock <nick.alcock@oracle.com>
333
334 * configure.ac (EXPECT): Check for, in order to define...
335 (TCL_TRY): ... this, if Tcl supports try/catch.
336 * Makefile.am (TCL_TRY): Run the testsuite only if set.
337 * configure: Regenerated.
338 * Makefile.in: Likewise.
339
340 2021-02-02 Nick Alcock <nick.alcock@oracle.com>
341
342 * configure.ac (CTF_LIBADD): Remove explicit -lintl population in
343 favour of LIBINTL.
344 * Makefile.am (libctf_nobfd_la_LIBADD): No longer explicitly
345 include $(LIBINTL).
346 (check-DEJAGNU): Pass down to tests as well.
347 * configure: Regenerated.
348 * Makefile.in: Likewise.
349
350 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
351
352 * ctf-string.c (ctf_str_add): Treat adding a NULL as adding "".
353 (ctf_str_add_ref): Likewise.
354 (ctf_str_add_external): Likewise.
355 * ctf-types.c (ctf_type_name_raw): Always return "" for offset 0.
356 * ctf-dedup.c (ctf_dedup_multiple_input_dicts): Don't armour
357 against NULL name.
358 (ctf_dedup_maybe_synthesize_forward): Likewise.
359
360 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
361
362 * ctf-create.c (ctf_serialize): Fix shadowing.
363
364 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
365
366 * ctf-create.c (ctf_add_encoded): Add check for non-empty name.
367 (ctf_add_forward): Likewise.
368 (ctf_add_typedef): Likewise.
369
370 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
371
372 * ctf-open.c (init_types): Rip out code to check anonymous typedef
373 nodes.
374 * ctf-create.c (ctf_add_reftype): Likewise.
375 * ctf-lookup.c (refresh_pptrtab): Likewise.
376
377 2021-01-27 Nick Alcock <nick.alcock@oracle.com>
378
379 * ctf-impl.c (_libctf_nonnull_): Add parameters.
380 (LCTF_LINKING): New flag.
381 (ctf_dict_t) <ctf_link_flags>: Mention it.
382 * ctf-link.c (ctf_link): Keep LCTF_LINKING set across call.
383 (ctf_write): Likewise, including in child dictionaries.
384 (ctf_link_shuffle_syms): Make sure ctf_dynsyms is NULL if there
385 are no reported symbols.
386 * ctf-create.c (symtypetab_delete_nonstatic_vars): Make sure
387 the variable has been reported as a symbol by the linker.
388 (symtypetab_skippable): Mention relationship between SYMFP and the
389 flags.
390 (symtypetab_density): Adjust nonnullity. Exit early if no symbols
391 were reported and force-indexing is off (i.e., we are doing a
392 final link).
393 (ctf_serialize): Handle the !LCTF_LINKING case by writing out an
394 indexed, sorted symtypetab (and allow SYMFP to be NULL in this
395 case). Turn sorting off if this is a non-final link. Only delete
396 nonstatic vars if we are filtering symbols and the linker has
397 reported some.
398 * testsuite/libctf-regression/nonstatic-var-section-ld-r*:
399 New test of variable and symtypetab section population when
400 ld -r is used.
401 * testsuite/libctf-regression/nonstatic-var-section-ld-executable.lk:
402 Likewise, when ld of an executable is used.
403 * testsuite/libctf-regression/nonstatic-var-section-ld.lk:
404 Likewise, when ld -shared alone is used.
405 * testsuite/libctf-regression/nonstatic-var-section-ld*.c:
406 Lookup programs for the above.
407 * testsuite/libctf-writable/symtypetab-nonlinker-writeout.*: New
408 test, testing survival of symbols across ctf_write paths.
409 * testsuite/lib/ctf-lib.exp (run_lookup_test): New option,
410 nonshared, suppressing linking of the SOURCE with -shared.
411
412 2021-01-19 Nick Alcock <nick.alcock@oracle.com>
413
414 * ctf-create.c (membadd): Transform ""-named members into
415 NULL-named ones.
416 * testsuite/libctf-regression/type-add-unnamed-struct*: New test.
417
418 2021-01-19 Nick Alcock <nick.alcock@oracle.com>
419
420 * ctf-lookup.c (ctf_lookup_by_name_internal): Do not return the
421 base type if looking up a nonexistent pointer type.
422 * testsuite/libctf-regression/pptrtab*: Test it.
423
424 2021-01-13 Alan Modra <amodra@gmail.com>
425
426 * Makefile.in: Regenerate.
427
428 2021-01-12 H.J. Lu <hongjiu.lu@intel.com>
429
430 PR binutils/26792
431 * configure.ac: Use GNU_MAKE_JOBSERVER.
432 * aclocal.m4: Regenerated.
433 * configure: Likewise.
434
435 2021-01-11 H.J. Lu <hongjiu.lu@intel.com>
436
437 PR ld/27173
438 * configure: Regenerated.
439
440 2021-01-09 H.J. Lu <hongjiu.lu@intel.com>
441
442 * configure: Regenerated.
443
444 2021-01-09 Nick Clifton <nickc@redhat.com>
445
446 * 2.36 release branch crated.
447
448 2021-01-09 Alan Modra <amodra@gmail.com>
449
450 * configure: Regenerate.
451
452 2021-01-07 Samuel Thibault <samuel.thibault@gnu.org>
453
454 * configure: Regenerate.
455
456 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
457
458 * testsuite/libctf-lookup/struct-iteration.c (main):
459 ctf_member_count returns an int.
460
461 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
462
463 * Makefile.am (BASEDIR): New.
464 (BFDDIR): Likewise.
465 (check-DEJAGNU): Add development.exp to prerequisites.
466 (development.exp): New.
467 (CONFIG_STATUS_DEPENDENCIES): New.
468 (EXTRA_DEJAGNU_SITE_CONFIG): Likewise.
469 (DISTCLEANFILES): Likewise.
470 * Makefile.in: Regenerated.
471 * testsuite/lib/ctf-lib.exp (check_ctf_available): Return boolean.
472 * testsuite/libctf-lookup/lookup.exp: Call check_ctf_available.
473 * testsuite/libctf-regression/regression.exp: Likewise.
474
475 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
476
477 * ctf-types.c (ctf_type_aname): Print forwards to unions and enums
478 properly.
479
480 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
481
482 * ctf-impl.h (ctf_dict_t) <ctf_pptrtab>: New.
483 <ctf_pptrtab_len>: New.
484 <ctf_pptrtab_typemax>: New.
485 * ctf-create.c (ctf_serialize): Update accordingly.
486 (ctf_add_reftype): Note that we don't need to update pptrtab here,
487 despite updating ptrtab.
488 * ctf-open.c (ctf_dict_close): Destroy the pptrtab.
489 (ctf_import): Likewise.
490 (ctf_import_unref): Likewise.
491 * ctf-lookup.c (grow_pptrtab): New.
492 (refresh_pptrtab): New, update a pptrtab.
493 (ctf_lookup_by_name): Turn into a wrapper around (and rename to)...
494 (ctf_lookup_by_name_internal): ... this: construct the pptrtab, and
495 use it in addition to the parent's ptrtab when parent dicts are
496 searched.
497 * testsuite/libctf-regression/regression.exp: New testsuite for
498 regression tests.
499 * testsuite/libctf-regression/pptrtab*: New test.
500 * testsuite/libctf-writable/writable.exp: New testsuite for tests of
501 writable CTF dicts.
502 * testsuite/libctf-writable/pptrtab*: New test.
503
504 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
505
506 * ctf-archive.c (ctf_archive_iter): Remove outdated comment.
507
508 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
509
510 * ctf-impl.h (struct ctf_next) <u.ctn_next>: Move to...
511 <ctn_next>: ... here.
512 * ctf-util.c (ctf_next_destroy): Unconditionally destroy it.
513 * ctf-lookup.c (ctf_symbol_next): Adjust accordingly.
514 * ctf-types.c (ctf_member_iter): Reimplement in terms of...
515 (ctf_member_next): ... this. Support recursive unnamed member
516 iteration (off by default).
517 (ctf_member_info): Look up members in unnamed sub-structs.
518 * ctf-dedup.c (ctf_dedup_rhash_type): Adjust ctf_member_next call.
519 (ctf_dedup_emit_struct_members): Likewise.
520 * testsuite/libctf-lookup/struct-iteration-ctf.c: Test empty unnamed
521 members, and a normal member after the end.
522 * testsuite/libctf-lookup/struct-iteration.c: Verify that
523 ctf_member_count is consistent with the number of successful returns
524 from a non-recursive ctf_member_next.
525 * testsuite/libctf-lookup/struct-iteration-*: New, test iteration
526 over struct members.
527 * testsuite/libctf-lookup/struct-lookup.c: New test.
528 * testsuite/libctf-lookup/struct-lookup.lk: New test.
529
530 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
531
532 * ctf-link.c (ctf_link_warn_outdated_inputs): New.
533 (ctf_link_write): Call it.
534
535 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
536
537 * testsuite/libctf-lookup/enum-symbol.lk: New symbol-lookup test.
538 * testsuite/libctf-lookup/enum-symbol-ctf.c: New CTF input.
539 * testsuite/libctf-lookup/enum-symbol.c: New lookup test.
540
541 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
542
543 * Makefile.am (EXPECT): New.
544 (RUNTEST): Likewise.
545 (RUNTESTFLAGS): Likewise.
546 (CC_FOR_TARGET): Likewise.
547 (check-DEJAGNU): Likewise.
548 (AUTOMAKE_OPTIONS): Add dejagnu.
549 * Makefile.in: Regenerated.
550 * testsuite/config/default.exp: New.
551 * testsuite/lib/ctf-lib.exp: Likewise.
552 * testsuite/libctf-lookup/enum.lk: New test.
553 * testsuite/libctf-lookup/enum-ctf.c: New CTF input.
554 * testsuite/libctf-lookup/enum.c: New lookup test.
555 * testsuite/libctf-lookup/ambiguous-struct*.c: New test.
556 * testsuite/libctf-lookup/lookup.exp: New.
557
558 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
559
560 * configure.ac (BFD_LIBADD): Remove.
561 (BFD_DEPENDENCIES): Likewise. Remove associated cases.
562 (SHARED_LIBADD): Rename to...
563 (CTF_LIBADD): ... this. Stick in a suitable libiberty even when
564 linking statically.
565 * Makefile.am (libctf_nobfd_la_LIBADD): Adjust accordingly.
566 libctf uses libintl.
567 (libctf_la_LIBADD): Reference libbfd.la directly, not via
568 BFD_LIBADD.
569 (libctf_la_DEPENDENCIES): Remove.
570 * Makefile.in: Regenerate.
571 * configure: Likewise.
572
573 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
574
575 * ctf-decl.c (ctf_decl_push): Exclude slices from the decl stack.
576 * ctf-types.c (ctf_type_aname): No longer deal with slices here.
577 * ctf-dump.c (ctf_dump_membstate_t) <cdm_toplevel_indent>: Constify.
578 (CTF_FT_REFS): New.
579 (CTF_FT_BITFIELD): Likewise.
580 (CTF_FT_ID): Likewise.
581 (ctf_dump_member): Do not do indentation here. Migrate the
582 type-printing parts of this into...
583 (ctf_dump_format_type): ... here, to be shared by all type printers.
584 Get the errno value for non-representable types right. Do not print
585 bitfield info for non-bitfields. Improve the format and indentation
586 of other type output. Shuffle spacing around to make all indentation
587 either 'width of column' or 4 chars.
588 (ctf_dump_label): Pass CTF_FT_REFS to ctf_dump_format_type.
589 (ctf_dump_objts): Likewise. Spacing shuffle.
590 (ctf_dump_var): Likewise.
591 (type_hex_digits): Migrate down in the file, to above its new user.
592 (ctf_dump_type): Indent here instead. Pass CTF_FT_REFS to
593 ctf_dump_format_type. Don't trim off excess linefeeds now we no
594 longer generate them. Dump enumerated types.
595
596 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
597
598 * ctf-types.c (ctf_type_resolve): Improve comment.
599 (ctf_type_size): Yield ECTF_INCOMPLETE when applied to forwards.
600 Emit errors into the right dict.
601 (ctf_type_align): Likewise.
602 * ctf-create.c (ctf_add_member_offset): Yield ECTF_INCOMPLETE
603 when adding a member without explicit offset when this member, or
604 the previous member, is incomplete.
605 * ctf-dump.c (ctf_dump_format_type): Do not try to print the size of
606 forwards.
607 (ctf_dump_member): Do not try to print their alignment.
608
609 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
610
611 * ctf-dump.c (ctf_dump_objts): Dump by calling ctf_dump_format_type.
612 (ctf_dump_format_type): Don't emit the size for function objects.
613 Dump the element type of arrays like we dump the pointed-to type of
614 pointers, etc.
615
616 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
617
618 * ctf-dump.c (ctf_dump_format_type): Add 0x to hex type IDs.
619 (ctf_dump_header): Add 0x to the hex magic number.
620 (ctf_dump_str): Add 0x to the hex string offsets.
621 (ctf_dump_membstate_t) <cdm_toplevel_indent>: New.
622 (ctf_dump_type): Adjust. Free it when we're done.
623 (type_hex_digits): New.
624 (ctf_dump_member): Align output depending on the width of the type
625 ID being generated. Use printf padding, not a loop, to generate
626 indentation.
627
628 2021-01-05 Nick Alcock <nick.alcock@oracle.com>
629
630 * ctf-decl.c (ctf_decl_push): Don't print array decls backwards.
631
632 2021-01-04 Nicolas Boulenguez <nicolas@debian.org>
633
634 PR 27117
635 * configure.ac: Make AC_CONFIG_MACRO_DIR consistent with
636 ACLOCAL_AMFLAGS -I dirs.
637 * configure: Regenerate.
638
639 2021-01-01 Alan Modra <amodra@gmail.com>
640
641 Update year range in copyright notice of all files.
642
643 For older changes see ChangeLog-2020
644 \f
645 Copyright (C) 2021 Free Software Foundation, Inc.
646
647 Copying and distribution of this file, with or without modification,
648 are permitted in any medium without royalty provided the copyright
649 notice and this notice are preserved.
650
651 Local Variables:
652 mode: change-log
653 left-margin: 8
654 fill-column: 74
655 version-control: never
656 End:
This page took 0.042243 seconds and 5 git commands to generate.