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