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