libctf: pass the thunk down properly when wrapping qsort_r
[deliverable/binutils-gdb.git] / libctf / ChangeLog
CommitLineData
67d4cc67
NA
12020-07-22 Nick Alcock <nick.alcock@oracle.com>
2
3 ctf-decls.h (ctf_qsort_compar_thunk): Fix arg passing.
4
e28591b3
NA
52020-07-22 Nick Alcock <nick.alcock@oracle.com>
6
7 * ctf-impl.h (ctf_next_hkv_t): New, kv-pairs passed to
8 sorting functions.
9 (ctf_next_t) <u.ctn_sorted_hkv>: New, sorted kv-pairs for
10 ctf_dynhash_next_sorted.
11 <cu.ctn_h>: New, pointer to the dynhash under iteration.
12 <cu.ctn_s>: New, pointer to the dynset under iteration.
13 (ctf_hash_sort_f): Sorting function passed to...
14 (ctf_dynhash_next_sorted): ... this new function.
15 (ctf_dynhash_next): New.
16 (ctf_dynset_next): New.
17 * ctf-inlines.h (ctf_dynhash_cnext_sorted): New.
18 (ctf_dynhash_cnext): New.
19 (ctf_dynset_cnext): New.
20 * ctf-hash.c (ctf_dynhash_next_sorted): New.
21 (ctf_dynhash_next): New.
22 (ctf_dynset_next): New.
23 * ctf-util.c (ctf_next_destroy): Free the u.ctn_sorted_hkv if
24 needed.
25 (ctf_next_copy): Alloc-and-copy the u.ctn_sorted_hkv if needed.
26
688d28f6
NA
272020-07-22 Nick Alcock <nick.alcock@oracle.com>
28
29 * ctf-impl.h (ctf_next): New.
30 (ctf_get_dict): New prototype.
31 * ctf-lookup.c (ctf_get_dict): New, split out of...
32 (ctf_lookup_by_id): ... here.
33 * ctf-util.c (ctf_next_create): New.
34 (ctf_next_destroy): New.
35 (ctf_next_copy): New.
36 * ctf-types.c (includes): Add <assert.h>.
37 (ctf_member_next): New.
38 (ctf_enum_next): New.
39 (ctf_type_iter): Document the lack of iteration over parent
40 types.
41 (ctf_type_next): New.
42 (ctf_variable_next): New.
43 * ctf-archive.c (ctf_archive_next): New.
44 * libctf.ver: Add new public functions.
45
2399827b
NA
462020-07-22 Nick Alcock <nick.alcock@oracle.com>
47
48 * libctf.ver (ctf_ref): New.
49 * ctf-open.c (ctf_ref): Implement it.
50
9850ce4d
NA
512020-07-22 Nick Alcock <nick.alcock@oracle.com>
52
53 * ctf-inlines.h (ctf_forwardable_kind): New.
54 * ctf-create.c (ctf_add_forward): Use it.
55
2c9ca36b
NA
562020-07-22 Nick Alcock <nick.alcock@oracle.com>
57
58 * ctf-impl.h (ctf_get_ctt_size): Move definition from here...
59 * ctf-inlines.h (ctf_get_ctt_size): ... to here.
60
77648241
NA
612020-07-22 Nick Alcock <nick.alcock@oracle.com>
62
63 * ctf-hash.c (ctf_dynset_eq_string): New.
64 (ctf_dynset_create): New.
65 (DYNSET_EMPTY_ENTRY_REPLACEMENT): New.
66 (DYNSET_DELETED_ENTRY_REPLACEMENT): New.
67 (key_to_internal): New.
68 (internal_to_key): New.
69 (ctf_dynset_insert): New.
70 (ctf_dynset_remove): New.
71 (ctf_dynset_destroy): New.
72 (ctf_dynset_lookup): New.
73 (ctf_dynset_exists): New.
74 (ctf_dynset_lookup_any): New.
75 (ctf_hash_insert_type): Coding style.
76 (ctf_hash_define_type): Likewise.
77 * ctf-impl.h (ctf_dynset_t): New.
78 (ctf_dynset_eq_string): New.
79 (ctf_dynset_create): New.
80 (ctf_dynset_insert): New.
81 (ctf_dynset_remove): New.
82 (ctf_dynset_destroy): New.
83 (ctf_dynset_lookup): New.
84 (ctf_dynset_exists): New.
85 (ctf_dynset_lookup_any): New.
86 * ctf-inlines.h (ctf_dynset_cinsert): New.
87
a49c6c6a
NA
882020-07-22 Nick Alcock <nick.alcock@oracle.com>
89
90 * ctf-hash.c (ctf_helem_t) <key_free>: Remove.
91 <value_free>: Likewise.
92 <owner>: New.
93 (ctf_dynhash_item_free): Indirect through the owner.
94 (ctf_dynhash_create): Only pass in ctf_dynhash_item_free and
95 allocate space for the key_free and value_free fields fields
96 if necessary.
97 (ctf_hashtab_insert): Likewise. Fix OOM errno value.
98 (ctf_dynhash_insert): Only access ctf_hashtab's key_free and
99 value_free if they will exist. Set the slot's owner, but only
100 if it exists.
101 (ctf_dynhash_remove): Adjust.
102
5ceee3db
NA
1032020-07-22 Nick Alcock <nick.alcock@oracle.com>
104
105 * ctf-hash.c (ctf_hashtab_insert): Free the key passed in if
106 there is a key-freeing function and the key already exists.
107
809f6eb3
NA
1082020-07-22 Nick Alcock <nick.alcock@oracle.com>
109
110 * ctf-inlines.h: New file.
111 * ctf-impl.h: Include it.
112 (ctf_hash_iter_find_f): New typedef.
113 (ctf_dynhash_elements): New.
114 (ctf_dynhash_lookup_kv): New.
115 (ctf_dynhash_iter_find): New.
116 * ctf-hash.c (ctf_dynhash_lookup_kv): New.
117 (ctf_traverse_find_cb_arg_t): New.
118 (ctf_hashtab_traverse_find): New.
119 (ctf_dynhash_iter_find): New.
120 (ctf_dynhash_elements): New.
121
469e75b6
NA
1222020-07-22 Nick Alcock <nick.alcock@oracle.com>
123
124 * ctf-impl.h [!__GNUC__] (__extension__): Define to nothing.
125
9c23dfa5
NA
1262020-07-22 Nick Alcock <nick.alcock@oracle.com>
127
128 * ctf-archive.c (ctf_archive_count): New.
129 * libctf.ver: New public function.
130
e0325e2c
NA
1312020-07-22 Nick Alcock <nick.alcock@oracle.com>
132
133 * ctf-types.c (ctf_member_count): New.
134 * libctf.ver: New public function.
135
9b15cbb7
NA
1362020-07-22 Nick Alcock <nick.alcock@oracle.com>
137
138 * ctf-types.c (ctf_type_kind_forwarded): New.
139
01d93174
NA
1402020-07-22 Nick Alcock <nick.alcock@oracle.com>
141
142 * ctf-types.c (ctf_type_name_raw): New.
143 (ctf_type_aname_raw): Reimplement accordingly.
144
5ec7465f
NA
1452020-07-22 Nick Alcock <nick.alcock@oracle.com>
146
147 * ctf-subr.c (ctf_dprintf): _libctf_debug is unlikely to be set.
148
601e455b
NA
1492020-07-22 Nick Alcock <nick.alcock@oracle.com>
150
151 * ctf-impl.h (struct ctf_archive_internal)
152 <ctfi_unmap_on_close>: New.
153 (ctf_new_archive_internal): Adjust.
154 * ctf-archive.c (ctf_new_archive_internal): Likewise.
155 Initialize ctfi_unmap_on_close. Adjust error path.
156 (ctf_arc_bufopen): Adjust ctf_new_archive_internal call
157 (unmap_on_close is 0).
158 (ctf_arc_close): Only unmap if ctfi_unmap_on_close.
159 * ctf-open-bfd.c (ctf_fdopen): Adjust.
160
96e3ec29
NA
1612020-07-22 Nick Alcock <nick.alcock@oracle.com>
162
163 * ctf-types.c (ctf_type_aname): Return ECTF_CORRUPT if
164 ints, floats or typedefs have no name. Fix comment typo.
165
502e838e
NA
1662020-07-22 Nick Alcock <nick.alcock@oracle.com>
167
168 * ctf-create.c (ctf_add_slice): Support slices of any kind that
169 resolves to an integral type.
170 * ctf-types.c (ctf_type_encoding): Resolve the type before
171 fishing its encoding out.
172
dd987f00
NA
1732020-07-22 Nick Alcock <nick.alcock@oracle.com>
174
175 * ctf-create.c (ctf_create): Mark dirty.
176
f47ca311
NA
1772020-07-22 Nick Alcock <nick.alcock@oracle.com>
178
179 * ctf-create.c (membcmp) Skip nameless members.
180
ab769488
NA
1812020-07-22 Nick Alcock <nick.alcock@oracle.com>
182
183 * ctf-create.c (ctf_add_member_offset): Support names of ""
184 as if they were the null pointer.
185
2484ca43
NA
1862020-07-22 Nick Alcock <nick.alcock@oracle.com>
187
188 * ctf-open.c (init_types): Remove typeless CTF_K_FORWARD
189 special-casing.
190
43706199
NA
1912020-07-22 Nick Alcock <nick.alcock@oracle.com>
192
193 * ctf-types.c (ctf_type_reference): Add support for dynamic slices.
194
9943fa3a
NA
1952020-07-22 Nick Alcock <nick.alcock@oracle.com>
196
197 * ctf-create.c (ctf_serialize): Add cast.
198 (ctf_add_slice): Likewise.
199
afd78bd6
NA
2002020-07-22 Nick Alcock <nick.alcock@oracle.com>
201
202 * ctf-impl.h (ctf_dtdef_t) <dtu_argv>: Fix type.
203 * ctf-create.c (ctf_add_function): Check for unimplemented type
204 and populate at the same time. Populate one-by-one, not via
205 memcpy.
206 (ctf_serialize): Remove unnecessary cast.
207 * ctf-types.c (ctf_func_type_info): Likewise.
208 (ctf_func_type_args): Likewise. Fix comment typo.
209
2361f1c8
NA
2102020-07-22 Nick Alcock <nick.alcock@oracle.com>
211
212 * ctf-create.c (ctf_add_reftype): Support refs to type zero.
213 (ctf_add_array): Support array contents of type zero.
214 (ctf_add_function): Support arguments and return types of
215 type zero.
216 (ctf_add_typedef): Support typedefs to type zero.
217 (ctf_add_member_offset): Support members of type zero,
218 unless added at unspecified (naturally-aligned) offset.
219
7eea9d3b
NA
2202020-07-22 Nick Alcock <nick.alcock@oracle.com>
221
222 * ctf-error.c: Include <stddef.h>, for offsetof.
223 (_ctf_errlist): Migrate to...
224 (_ctf_errlist_t): ... this.
225 (_ctf_erridx): New, indexes into _ctf_errlist_t.
226 (_ctf_nerr): Remove.
227 (ctf_errmsg): Adjust accordingly.
228 * Makefile.am (BUILT_SOURCES): Note...
229 (ctf-error.h): ... this new rule.
230 * Makefile.in: Regenerate.
231 * mkerrors.sed: New, process ctf-api.h to generate ctf-error.h.
232 * .gitignore: New, ignore ctf-error.h.
233
b64751cf
NA
2342020-07-22 Nick Alcock <nick.alcock@oracle.com>
235
236 * ctf-impl.h: Fix typos in comments.
237
df16e041
NC
2382020-07-22 Nick Clifton <nickc@redhat.com>
239
240 * ctf-archive.c (ctf_arc_write): Avoid calling close twice on the
241 same file descriptor.
242
b115b9fd
NC
2432020-07-04 Nick Clifton <nickc@redhat.com>
244
245 Binutils 2.35 branch created.
246
8e6635bd
NA
2472020-06-26 Nick Alcock <nick.alcock@oracle.com>
248
249 * aclocal.m4: Add config/gettext-sister.m4: Shuffle into
250 alphabetical order.
251 * configure.ac: Add ZW_GNU_GETTEXT_SISTER_DIR.
252 * config.h.in: Regenerated.
253 * Makefile.in: Likewise.
254 * configure: Likewise.
255
c1401ecc
NA
2562020-06-26 Nick Alcock <nick.alcock@oracle.com>
257
258 * ctf-create.c: Include <unistd.h>.
259 * ctf-open-bfd.c: Likewise.
260
e755667f
NA
2612020-06-26 Nick Alcock <nick.alcock@oracle.com>
262
263 PR libctf/25120
264 * configure.ac: Check for bswap_16, bswap_32, and bswap_64 decls.
265 * swap.h (bswap_16): Do not assume that presence of <byteswap.h>
266 means this is declared.
267 (bswap_32): Likewise.
268 (bswap_64): Likewise.
269 (bswap_identity_64): Remove, unused.
270 * configure: Regenerated.
271 * config.h.in: Likewise.
272
86670658
NA
2732020-06-26 Nick Alcock <nick.alcock@oracle.com>
274
275 PR libctf/25120
276 * ctf-impl.h (_libctf_printflike_): Add non-GNU-C fallback.
277 (_libctf_unlikely_): Likewise.
278 (_libctf_unused): Likewise.
279 (_libctf_malloc_): Likewise.
280
2e428e74
NA
2812020-06-26 Nick Alcock <nick.alcock@oracle.com>
282
283 PR libctf/25120
284 * ctf-archive.c (search_nametbl): No longer global: declare...
285 (ctf_arc_open_by_name_internal): ... here. Use bsearch_r.
286 (search_modent_by_name): Take and use ARG for the nametbl.
287
2f6ecaed
NA
2882020-06-26 Nick Alcock <nick.alcock@oracle.com>
289
290 * ctf-impl.h (ctf_new_archive_internal): Declare.
291 (ctf_arc_bufopen): Remove.
292 (ctf_archive_internal) <ctfi_free_symsect>: New.
293 * ctf-archive.c (ctf_arc_close): Use it.
294 (ctf_arc_bufopen): Fuse into...
295 (ctf_new_archive_internal): ... this, moved across from...
296 * ctf-open-bfd.c: ... here.
297 (ctf_bfdopen_ctfsect): Use ctf_arc_bufopen.
298 * libctf.ver: Add it.
299
8ffcdf18
NA
3002020-06-26 Nick Alcock <nick.alcock@oracle.com>
301
302 * ctf-create.c (ctf_add_forward): Intern in the right namespace.
303 (ctf_dtd_delete): Remove correspondingly.
304 (ctf_rollback): Likewise.
305
d04a47ac
NA
3062020-06-26 Nick Alcock <nick.alcock@oracle.com>
307
308 * ctf-create.c (ctf_add_type_internal): Hand back existing types
309 unchanged.
310
6bbf9da8
NA
3112020-06-26 Nick Alcock <nick.alcock@oracle.com>
312
313 * ctf-create.c (ctf_add_forward): Don't add forwards to
314 types that already exist.
315
fe4c2d55
NA
3162020-06-26 Nick Alcock <nick.alcock@oracle.com>
317
318 * ctf-open.c (init_types): Only intern root-visible types.
319 * ctf-create.c (ctf_dtd_insert): Likewise.
320 (ctf_dtd_delete): Only remove root-visible types.
321 (ctf_rollback): Likewise.
322 (ctf_add_generic): Adjust.
323 (ctf_add_struct_sized): Adjust comment.
324 (ctf_add_union_sized): Likewise.
325 (ctf_add_enum): Likewise.
326 * ctf-impl.h (ctf_dtd_insert): Adjust prototype.
327
11978942
JB
3282020-03-11 John Baldwin <jhb@FreeBSD.org>
329
330 * swap.h (bswap_identity_64): Make static.
331
ae774686
NC
3322020-01-18 Nick Clifton <nickc@redhat.com>
333
334 Binutils 2.34 branch created.
335
eb9a7e35 3362020-01-05 Joel Brobecker <brobecker@adacore.com>
3a657c60
EZ
337
338 PR binutils/25155:
339 * configure.ac: Add AC_CHECK_DECLS([asprintf]).
340 * configure, config.h.in: Regenerate.
341
b14ce8bf
AM
3422020-01-01 Alan Modra <amodra@gmail.com>
343
344 Update year range in copyright notice of all files.
345
cbbbc402
SM
3462019-10-16 Simon Marchi <simon.marchi@polymtl.ca>
347
348 * swap.h (bswap_16, bswap_32, bswap_64): Make static.
349
fa56cdcd
NA
3502019-09-30 Nick Alcock <nick.alcock@oracle.com>
351
352 * ctf-open.c (ctf_bufopen_internal): Fix tabdamage.
353 * ctf-types.c (ctf_type_lname): Likewise.
354
ad613f1d
NA
3552019-09-23 Nick Alcock <nick.alcock@oracle.com>
356
357 * ctf-open.c (ctf_import): Do not leak a ctf_file_t ref on every
358 ctf_import after the first for a given file.
359
9323dd86
NA
3602019-09-23 Nick Alcock <nick.alcock@oracle.com>
361
362 * ctf-impl.h (ctf_str_append_noerr): Declare.
363 * ctf-util.c (ctf_str_append_noerr): Define in terms of
364 ctf_str_append.
365 * ctf-dump.c (str_append): New, call it.
366 (ctf_dump_format_type): Use str_append, not ctf_str_append.
367 (ctf_dump_label): Likewise.
368 (ctf_dump_objts): Likewise.
369 (ctf_dump_funcs): Likewise.
370 (ctf_dump_var): Likewise.
371 (ctf_dump_member): Likewise.
372 (ctf_dump_type): Likewise.
373 (ctf_dump): Likewise.
374
de07e349
NA
3752019-09-23 Nick Alcock <nick.alcock@oracle.com>
376
377 * ctf-impl.h (ctf_alloc): Remove.
378 (ctf_free): Likewise.
379 (ctf_strdup): Likewise.
380 * ctf-subr.c (ctf_alloc): Remove.
381 (ctf_free): Likewise.
382 * ctf-util.c (ctf_strdup): Remove.
383
384 * ctf-create.c (ctf_serialize): Use malloc, not ctf_alloc; free, not
385 ctf_free; strdup, not ctf_strdup.
386 (ctf_dtd_delete): Likewise.
387 (ctf_dvd_delete): Likewise.
388 (ctf_add_generic): Likewise.
389 (ctf_add_function): Likewise.
390 (ctf_add_enumerator): Likewise.
391 (ctf_add_member_offset): Likewise.
392 (ctf_add_variable): Likewise.
393 (membadd): Likewise.
394 (ctf_compress_write): Likewise.
395 (ctf_write_mem): Likewise.
396 * ctf-decl.c (ctf_decl_push): Likewise.
397 (ctf_decl_fini): Likewise.
398 (ctf_decl_sprintf): Likewise. Check for OOM.
399 * ctf-dump.c (ctf_dump_append): Use malloc, not ctf_alloc; free, not
400 ctf_free; strdup, not ctf_strdup.
401 (ctf_dump_free): Likewise.
402 (ctf_dump): Likewise.
403 * ctf-open.c (upgrade_types_v1): Likewise.
404 (init_types): Likewise.
405 (ctf_file_close): Likewise.
406 (ctf_bufopen_internal): Likewise. Check for OOM.
407 (ctf_parent_name_set): Likewise: report the OOM to the caller.
408 (ctf_cuname_set): Likewise.
409 (ctf_import): Likewise.
410 * ctf-string.c (ctf_str_purge_atom_refs): Use malloc, not ctf_alloc;
411 free, not ctf_free; strdup, not ctf_strdup.
412 (ctf_str_free_atom): Likewise.
413 (ctf_str_create_atoms): Likewise.
414 (ctf_str_add_ref_internal): Likewise.
415 (ctf_str_remove_ref): Likewise.
416 (ctf_str_write_strtab): Likewise.
417
9c1a2295
NA
4182019-08-09 Nick Alcock <nick.alcock@oracle.com>
419
420 * ctf-types.c (ctf_type_encoding): Fix the dynamic case to
421 work right for non-int/fps.
422
1a6ab13e
NA
4232019-08-08 Nick Alcock <nick.alcock@oracle.com>
424
425 * ctf-types.c (ctf_type_name): Don't strlen a potentially-
426 null pointer.
427
99dc3ebd
NA
4282019-08-07 Nick Alcock <nick.alcock@oracle.com>
429
430 * ctf-impl.h (ctf_file_t) <ctf_add_processing>: New.
431 * ctf-open.c (ctf_file_close): Free it.
432 * ctf-create.c (ctf_serialize): Adjust.
433 (membcmp): When reporting a conflict due to an error, report the
434 error.
435 (ctf_add_type): Turn into a ctf_add_processing wrapper. Rename to...
436 (ctf_add_type_internal): ... this. Hand back types we are already
437 in the middle of adding immediately. Hand back structs/unions with
438 the same number of members immediately. Do not walk the dynamic
439 list. Call ctf_add_type_internal, not ctf_add_type. Handle
440 forwards promoted to other types and the inverse case identically.
441 Add structs to the mapping as soon as we intern them, before they
442 gain any members.
443
676c3ecb
NA
4442019-08-09 Nick Alcock <nick.alcock@oracle.com>
445
446 * ctf-impl.h (ctf_names_t): New.
447 (ctf_lookup_t) <ctf_hash>: Now a ctf_names_t, not a ctf_hash_t.
448 (ctf_file_t) <ctf_structs>: Likewise.
449 <ctf_unions>: Likewise.
450 <ctf_enums>: Likewise.
451 <ctf_names>: Likewise.
452 <ctf_lookups>: Improve comment.
453 <ctf_ptrtab_len>: New.
454 <ctf_prov_strtab>: New.
455 <ctf_str_prov_offset>: New.
456 <ctf_dtbyname>: Remove, redundant to the names hashes.
457 <ctf_dtnextid>: Remove, redundant to ctf_typemax.
458 (ctf_dtdef_t) <dtd_name>: Remove.
459 <dtd_data>: Note that the ctt_name is now populated.
460 (ctf_str_atom_t) <csa_offset>: This is now the strtab
461 offset for internal strings too.
462 <csa_external_offset>: New, the external strtab offset.
463 (CTF_INDEX_TO_TYPEPTR): Handle the LCTF_RDWR case.
464 (ctf_name_table): New declaration.
465 (ctf_lookup_by_rawname): Likewise.
466 (ctf_lookup_by_rawhash): Likewise.
467 (ctf_set_ctl_hashes): Likewise.
468 (ctf_serialize): Likewise.
469 (ctf_dtd_insert): Adjust.
470 (ctf_simple_open_internal): Likewise.
471 (ctf_bufopen_internal): Likewise.
472 (ctf_list_empty_p): Likewise.
473 (ctf_str_remove_ref): Likewise.
474 (ctf_str_add): Returns uint32_t now.
475 (ctf_str_add_ref): Likewise.
476 (ctf_str_add_external): Now returns a boolean (int).
477 * ctf-string.c (ctf_strraw_explicit): Check the ctf_prov_strtab
478 for strings in the appropriate range.
479 (ctf_str_create_atoms): Create the ctf_prov_strtab. Detect OOM
480 when adding the null string to the new strtab.
481 (ctf_str_free_atoms): Destroy the ctf_prov_strtab.
482 (ctf_str_add_ref_internal): Add make_provisional argument. If
483 make_provisional, populate the offset and fill in the
484 ctf_prov_strtab accordingly.
485 (ctf_str_add): Return the offset, not the string.
486 (ctf_str_add_ref): Likewise.
487 (ctf_str_add_external): Return a success integer.
488 (ctf_str_remove_ref): New, remove a single ref.
489 (ctf_str_count_strtab): Do not count the initial null string's
490 length or the existence or length of any unreferenced internal
491 atoms.
492 (ctf_str_populate_sorttab): Skip atoms with no refs.
493 (ctf_str_write_strtab): Populate the nullstr earlier. Add one
494 to the cts_len for the null string, since it is no longer done
495 in ctf_str_count_strtab. Adjust for csa_external_offset rename.
496 Populate the csa_offset for both internal and external cases.
497 Flush the ctf_prov_strtab afterwards, and reset the
498 ctf_str_prov_offset.
499 * ctf-create.c (ctf_grow_ptrtab): New.
500 (ctf_create): Call it. Initialize new fields rather than old
501 ones. Tell ctf_bufopen_internal that this is a writable dictionary.
502 Set the ctl hashes and data model.
503 (ctf_update): Rename to...
504 (ctf_serialize): ... this. Leave a compatibility function behind.
505 Tell ctf_simple_open_internal that this is a writable dictionary.
506 Pass the new fields along from the old dictionary. Drop
507 ctf_dtnextid and ctf_dtbyname. Use ctf_strraw, not dtd_name.
508 Do not zero out the DTD's ctt_name.
509 (ctf_prefixed_name): Rename to...
510 (ctf_name_table): ... this. No longer return a prefixed name: return
511 the applicable name table instead.
512 (ctf_dtd_insert): Use it, and use the right name table. Pass in the
513 kind we're adding. Migrate away from dtd_name.
514 (ctf_dtd_delete): Adjust similarly. Remove the ref to the
515 deleted ctt_name.
516 (ctf_dtd_lookup_type_by_name): Remove.
517 (ctf_dynamic_type): Always return NULL on read-only dictionaries.
518 No longer check ctf_dtnextid: check ctf_typemax instead.
519 (ctf_snapshot): No longer use ctf_dtnextid: use ctf_typemax instead.
520 (ctf_rollback): Likewise. No longer fail with ECTF_OVERROLLBACK. Use
521 ctf_name_table and the right name table, and migrate away from
522 dtd_name as in ctf_dtd_delete.
523 (ctf_add_generic): Pass in the kind explicitly and pass it to
524 ctf_dtd_insert. Use ctf_typemax, not ctf_dtnextid. Migrate away
525 from dtd_name to using ctf_str_add_ref to populate the ctt_name.
526 Grow the ptrtab if needed.
527 (ctf_add_encoded): Pass in the kind.
528 (ctf_add_slice): Likewise.
529 (ctf_add_array): Likewise.
530 (ctf_add_function): Likewise.
531 (ctf_add_typedef): Likewise.
532 (ctf_add_reftype): Likewise. Initialize the ctf_ptrtab, checking
533 ctt_name rather than dtd_name.
534 (ctf_add_struct_sized): Pass in the kind. Use
535 ctf_lookup_by_rawname, not ctf_hash_lookup_type /
536 ctf_dtd_lookup_type_by_name.
537 (ctf_add_union_sized): Likewise.
538 (ctf_add_enum): Likewise.
539 (ctf_add_enum_encoded): Likewise.
540 (ctf_add_forward): Likewise.
541 (ctf_add_type): Likewise.
542 (ctf_compress_write): Call ctf_serialize: adjust for ctf_size not
543 being initialized until after the call.
544 (ctf_write_mem): Likewise.
545 (ctf_write): Likewise.
546 * ctf-archive.c (arc_write_one_ctf): Likewise.
547 * ctf-lookup.c (ctf_lookup_by_name): Use ctf_lookuup_by_rawhash, not
548 ctf_hash_lookup_type.
549 (ctf_lookup_by_id): No longer check the readonly types if the
550 dictionary is writable.
551 * ctf-open.c (init_types): Assert that this dictionary is not
552 writable. Adjust to use the new name hashes, ctf_name_table,
553 and ctf_ptrtab_len. GNU style fix for the final ptrtab scan.
554 (ctf_bufopen_internal): New 'writable' parameter. Flip on LCTF_RDWR
555 if set. Drop out early when dictionary is writable. Split the
556 ctf_lookups initialization into...
557 (ctf_set_cth_hashes): ... this new function.
558 (ctf_simple_open_internal): Adjust. New 'writable' parameter.
559 (ctf_simple_open): Adjust accordingly.
560 (ctf_bufopen): Likewise.
561 (ctf_file_close): Destroy the appropriate name hashes. No longer
562 destroy ctf_dtbyname, which is gone.
563 (ctf_getdatasect): Remove spurious "extern".
564 * ctf-types.c (ctf_lookup_by_rawname): New, look up types in the
565 specified name table, given a kind.
566 (ctf_lookup_by_rawhash): Likewise, given a ctf_names_t *.
567 (ctf_member_iter): Add support for iterating over the
568 dynamic type list.
569 (ctf_enum_iter): Likewise.
570 (ctf_variable_iter): Likewise.
571 (ctf_type_rvisit): Likewise.
572 (ctf_member_info): Add support for types in the dynamic type list.
573 (ctf_enum_name): Likewise.
574 (ctf_enum_value): Likewise.
575 (ctf_func_type_info): Likewise.
576 (ctf_func_type_args): Likewise.
577 * ctf-link.c (ctf_accumulate_archive_names): No longer call
578 ctf_update.
579 (ctf_link_write): Likewise.
580 (ctf_link_intern_extern_string): Adjust for new
581 ctf_str_add_external return value.
582 (ctf_link_add_strtab): Likewise.
583 * ctf-util.c (ctf_list_empty_p): New.
584
791915db
NA
5852019-08-05 Nick Alcock <nick.alcock@oracle.com>
586
587 * ctf-types.c (ctf_type_resolve): Return ECTF_NONREPRESENTABLE on
588 type zero.
589 * ctf-create.c (ctf_add_type): Detect and skip nonrepresentable
590 members and types.
591 (ctf_add_variable): Likewise for variables pointing to them.
592 * ctf-link.c (ctf_link_one_type): Do not warn for nonrepresentable
593 type link failure, but do warn for others.
594 * ctf-dump.c (ctf_dump_format_type): Likewise. Do not assume all
595 errors to be ENOMEM.
596 (ctf_dump_member): Likewise.
597 (ctf_dump_type): Likewise.
598 (ctf_dump_header_strfield): Do not assume all errors to be ENOMEM.
599 (ctf_dump_header_sectfield): Do not assume all errors to be ENOMEM.
600 (ctf_dump_header): Likewise.
601 (ctf_dump_label): likewise.
602 (ctf_dump_objts): likewise.
603 (ctf_dump_funcs): likewise.
604 (ctf_dump_var): likewise.
605 (ctf_dump_str): Likewise.
606
87279e3c
NA
6072019-09-30 Nick Alcock <nick.alcock@oracle.com>
608
609 * configure.ac (AC_DISABLE_SHARED): New, like opcodes/.
610 (LT_INIT): Likewise.
611 (AM_INSTALL_LIBBFD): Likewise.
612 (dlopen): Note why this is necessary in a comment.
613 (SHARED_LIBADD): Initialize for possibly-PIC libiberty: derived from
614 opcodes/.
615 (SHARED_LDFLAGS): Likewise.
616 (BFD_LIBADD): Likewise, for libbfd.
617 (BFD_DEPENDENCIES): Likewise.
618 (VERSION_FLAGS): Initialize, using a version script if ld supports
619 one, or libtool -export-symbols-regex otherwise.
620 (AC_CONFIG_MACRO_DIR): Add ../BFD.
621 * Makefile.am (ACLOCAL_AMFLAGS): Likewise.
622 (INCDIR): New.
623 (AM_CPPFLAGS): Use $(srcdir), not $(top_srcdir).
624 (noinst_LIBRARIES): Replace with...
625 [INSTALL_LIBBFD] (lib_LTLIBRARIES): This, or...
626 [!INSTALL_LIBBFD] (noinst_LTLIBRARIES): ... this, mentioning new
627 libctf-nobfd.la as well.
628 [INSTALL_LIBCTF] (include_HEADERS): Add the CTF headers.
629 [!INSTALL_LIBCTF] (include_HEADERS): New, empty.
630 (libctf_a_SOURCES): Rename to...
631 (libctf_nobfd_la_SOURCES): ... this, all of libctf other than
632 ctf-open-bfd.c.
633 (libctf_la_SOURCES): Now derived from libctf_nobfd_la_SOURCES,
634 with ctf-open-bfd.c added.
635 (libctf_nobfd_la_LIBADD): New, using @SHARED_LIBADD@.
636 (libctf_la_LIBADD): New, using @BFD_LIBADD@ as well.
637 (libctf_la_DEPENDENCIES): New, using @BFD_DEPENDENCIES@.
638 * Makefile.am [INSTALL_LIBCTF]: Use it.
639 * aclocal.m4: Add ../bfd/acinclude.m4, ../config/acx.m4, and the
640 libtool macros.
641 * libctf.ver: New, everything is version LIBCTF_1.0 currently (even
642 the unstable components).
643 * Makefile.in: Regenerated.
644 * config.h.in: Likewise.
645 * configure: Likewise.
646
6472019-07-30 Nick Alcock <nick.alcock@oracle.com>
648
649 * configure.ac (INSTALL_LIBCTF): New, controlled by
650 --enable-install-libctf.
651 [INSTALL_LIBCTF] (lib_LIBRARIES): Add libctf.a.
652 * Makefile.in: Regenerated.
653 * configure: Regenerated.
654
f046147d
NA
6552019-07-30 Nick Alcock <nick.alcock@oracle.com>
656
657 * ctf-archive.c (ctf_arc_close): Call ctfi_bfd_close if set.
658 * ctf-open-bfd.c (ctf_bfdclose): Fix comment.
659
edc8bbe9
NA
6602019-07-30 Nick Alcock <nick.alcock@oracle.com>
661
662 * ctf-open-bfd.c (ctf_fdopen): Call bfd_set_cacheable.
663
7e97445a
NA
6642019-07-13 Nick Alcock <nick.alcock@oracle.com>
665
666 * ctf-impl.h (includes): Include <sys/param.h> here.
667
5ae6af75
NA
6682019-07-30 Nick Alcock <nick.alcock@oracle.com>
669
670 * ctf-open.c (flip_lbls): Eschew for-loop initial declarations.
671 (flip_objts): Likewise.
672 (flip_vars): Likewise.
673 (flip_types): Likewise.
674
1820745a
NA
6752019-07-30 Nick Alcock <nick.alcock@oracle.com>
676
677 * ctf-hash.c (ctf_hashtab_insert): Pass in the key and value
678 freeing functions: if set, free the key and value if the slot
679 already exists. Always reassign the key.
680 (ctf_dynhash_insert): Adjust call appropriately.
681 (ctf_hash_insert_type): Likewise.
682
5de9eada
NA
6832019-08-03 Nick Alcock <nick.alcock@oracle.com>
684
685 * ctf-create.c (ctf_add_type): Look up and use the forwarded-to
686 type kind. Allow forwards to unify with pre-existing structs/
687 unions/enums.
688
49ea9b45
NA
6892019-07-30 Nick Alcock <nick.alcock@oracle.com>
690
691 * ctf-impl.h (ctf_file_t) <ctf_link_cu_mappping>: New.
692 <ctf_link_memb_name_changer>: Likewise.
693 <ctf_link_memb_name_changer_arg>: Likewise.
694 * ctf-create.c (ctf_update): Update accordingly.
695 * ctf-open.c (ctf_file_close): Likewise.
696 * ctf-link.c (ctf_create_per_cu): Apply the cu mapping.
697 (ctf_link_add_cu_mapping): New.
698 (ctf_link_set_memb_name_changer): Likewise.
699 (ctf_change_parent_name): New.
700 (ctf_name_list_accum_cb_arg_t) <dynames>: New, storage for names
701 allocated by the caller's ctf_link_memb_name_changer.
702 <ndynames>: Likewise.
703 (ctf_accumulate_archive_names): Call the ctf_link_memb_name_changer.
704 (ctf_link_write): Likewise (for _CTF_SECTION only): also call
705 ctf_change_parent_name. Free any resulting names.
706
eabb7154
NA
7072019-07-13 Nick Alcock <nick.alcock@oracle.com>
708
709 * ctf-link.c (ctf_create_per_cu): New, refactored out of...
710 (ctf_link_one_type): ... here, with parent-name setting added.
711 (check_variable): New.
712 (ctf_link_one_variable): Likewise.
713 (ctf_link_one_input_archive_member): Call it.
714 * ctf-error.c (_ctf_errlist): Updated with new errors.
715
886453cb
NA
7162019-07-13 Nick Alcock <nick.alcock@oracle.com>
717
718 * ctf-impl.h (ctf_file_t): New field ctf_link_type_mapping.
719 (struct ctf_link_type_mapping_key): New.
720 (ctf_hash_type_mapping_key): Likewise.
721 (ctf_hash_eq_type_mapping_key): Likewise.
722 (ctf_add_type_mapping): Likewise.
723 (ctf_type_mapping): Likewise.
724 (ctf_dynhash_empty): Likewise.
725 * ctf-open.c (ctf_file_close): Update accordingly.
726 * ctf-create.c (ctf_update): Likewise.
727 (ctf_add_type): Populate the mapping.
728 * ctf-hash.c (ctf_hash_type_mapping_key): Hash a type mapping key.
729 (ctf_hash_eq_type_mapping_key): Check the key for equality.
730 (ctf_dynhash_insert): Fix comment typo.
731 (ctf_dynhash_empty): New.
732 * ctf-link.c (ctf_add_type_mapping): New.
733 (ctf_type_mapping): Likewise.
734 (empty_link_type_mapping): New.
735 (ctf_link_one_input_archive): Call it.
736
72c83edd
NA
7372019-07-13 Nick Alcock <nick.alcock@oracle.com>
738
739 * ctf-link.c: New file, linking of the string and type sections.
740 * Makefile.am (libctf_a_SOURCES): Add it.
741 * Makefile.in: Regenerate.
742
743 * ctf-impl.h (ctf_file_t): New fields ctf_link_inputs,
744 ctf_link_outputs.
745 * ctf-create.c (ctf_update): Update accordingly.
746 * ctf-open.c (ctf_file_close): Likewise.
747 * ctf-error.c (_ctf_errlist): Updated with new errors.
748
d18f9f16
NA
7492019-07-13 Nick Alcock <nick.alcock@oracle.com>
750
751 * ctf-dump.c (ctf_dump_funcs): Check the right error value.
752
b4f0e09c
NA
7532019-07-13 Nick Alcock <nick.alcock@oracle.com>
754
755 * ctf-dump.c (ctf_dump): Use ctf_type_iter_all to dump types, not
756 ctf_type_iter.
757 (ctf_dump_type): Pass down the flag from ctf_type_iter_all.
758 (ctf_dump_format_type): Add non-root-type { } notation.
759 Add root flag to prototype.
760 (ctf_dump_label): Adjust accordingly.
761 (ctf_dump_objts): Likewise.
762 (ctf_dump_var): Likewise.
763
3dde2c91
NA
7642019-07-13 Nick Alcock <nick.alcock@oracle.com>
765
766 * ctf-create.c (ctf_compress_write): Fix double-free.
767
5537f9b9
NA
7682019-07-13 Nick Alcock <nick.alcock@oracle.com>
769
770 * ctf-archive.c (ctf_arc_write): Split off, and reimplement in terms
771 of...
772 (ctf_arc_write_fd): ... this new function.
773 * ctf-create.c (ctf_write_mem): New.
774
d851ecd3
NA
7752019-07-13 Nick Alcock <nick.alcock@oracle.com>
776
777 * ctf-impl.h (ctf_str_atom_t) <csa_offset>: New field.
778 (ctf_file_t) <ctf_syn_ext_strtab>: Likewise.
779 (ctf_str_add_ref): Name the last arg.
780 (ctf_str_add_external) New.
781 (ctf_str_add_strraw_explicit): Likewise.
782 (ctf_simple_open_internal): Likewise.
783 (ctf_bufopen_internal): Likewise.
784
785 * ctf-string.c (ctf_strraw_explicit): Split from...
786 (ctf_strraw): ... here, with new support for ctf_syn_ext_strtab.
787 (ctf_str_add_ref_internal): Return the atom, not the
788 string.
789 (ctf_str_add): Adjust accordingly.
790 (ctf_str_add_ref): Likewise. Move up in the file.
791 (ctf_str_add_external): New: update the csa_offset.
792 (ctf_str_count_strtab): Only account for strings with no csa_offset
793 in the internal strtab length.
794 (ctf_str_write_strtab): If the csa_offset is set, update the
795 string's refs without writing the string out, and update the
796 ctf_syn_ext_strtab. Make OOM handling less ugly.
797 * ctf-create.c (struct ctf_sort_var_arg_cb): New.
798 (ctf_update): Handle failure to populate the strtab. Pass in the
799 new ctf_sort_var arg. Adjust for ctf_syn_ext_strtab addition.
800 Call ctf_simple_open_internal, not ctf_simple_open.
801 (ctf_sort_var): Call ctf_strraw_explicit rather than looking up
802 strings by hand.
803 * ctf-hash.c (ctf_hash_insert_type): Likewise (but using
804 ctf_strraw). Adjust to diagnose ECTF_STRTAB nonetheless.
805 * ctf-open.c (init_types): No longer filter out ECTF_STRTAB.
806 (ctf_file_close): Destroy the ctf_syn_ext_strtab.
807 (ctf_simple_open): Rename to, and reimplement as a wrapper around...
808 (ctf_simple_open_internal): ... this new function, which calls
809 ctf_bufopen_internal.
810 (ctf_bufopen): Rename to, and reimplement as a wrapper around...
811 (ctf_bufopen_internal): ... this new function, which sets
812 ctf_syn_ext_strtab.
813
0ac62312
NA
8142019-07-13 Nick Alcock <nick.alcock@oracle.com>
815
816 * ctf_types.c (ctf_type_iter_all): New.
817
2db912ba
NA
8182019-07-13 Nick Alcock <nick.alcock@oracle.com>
819
820 * ctf-open.c (init_symtab): Check for overflow against the right
821 section.
822 (upgrade_header): Set cth_objtidxoff, cth_funcidxoff to zero-length.
823 (upgrade_types_v1): Note that these sections are not checked.
824 (flip_header): Endian-swap the header fields.
825 (flip_ctf): Endian-swap the sections.
826 (flip_objts): Update comment.
827 (ctf_bufopen): Check header offsets and alignment for validity.
828
6d5944fc
NA
8292019-07-13 Nick Alcock <nick.alcock@oracle.com>
830
831 * ctf-open-bfd.c: Add <assert.h>.
832 (ctf_bfdopen_ctfsect): Open string and symbol tables using
833 techniques borrowed from bfd_elf_sym_name.
834 (ctf_new_archive_internal): Improve comment.
835 * ctf-archive.c (ctf_arc_close): Do not free the ctfi_strsect.
836 * ctf-open.c (ctf_bufopen): Allow opening with a string section but
837 no symbol section, but not vice versa.
838
9b32cba4
NA
8392019-07-08 Nick Alcock <nick.alcock@oracle.com>
840
841 * ctf-impl.h (ctf_file_t): New field ctf_openflags.
842 * ctf-open.c (ctf_bufopen): Set it. No longer dump header offsets.
843 * ctf-dump.c (dump_header): New function, dump the CTF header.
844 (ctf_dump): Call it.
845 (ctf_dump_header_strfield): New function.
846 (ctf_dump_header_sectfield): Likewise.
847
fd55eae8
NA
8482019-07-06 Nick Alcock <nick.alcock@oracle.com>
849
850 * ctf-impl.h (ctf_file_t): New fields ctf_header, ctf_dynbase,
851 ctf_cuname, ctf_dyncuname: ctf_base and ctf_buf are no longer const.
852 * ctf-open.c (ctf_set_base): Preserve the gap between ctf_buf and
853 ctf_base: do not assume that it is always sizeof (ctf_header_t).
854 Print out ctf_cuname: only print out ctf_parname if set.
855 (ctf_free_base): Removed, ctf_base is no longer freed: free
856 ctf_dynbase instead.
857 (ctf_set_version): Fix spacing.
858 (upgrade_header): New, in-place header upgrading.
859 (upgrade_types): Rename to...
860 (upgrade_types_v1): ... this. Free ctf_dynbase, not ctf_base. No
861 longer track old and new headers separately. No longer allow for
862 header sizes explicitly: squeeze the headers out on upgrade (they
863 are preserved in fp->ctf_header). Set ctf_dynbase, ctf_base and
864 ctf_buf explicitly. Use ctf_free, not ctf_free_base.
865 (upgrade_types): New, also handle ctf_parmax updating.
866 (flip_header): Flip ctf_cuname.
867 (flip_types): Flip BUF explicitly rather than deriving BUF from
868 BASE.
869 (ctf_bufopen): Store the header in fp->ctf_header. Correct minimum
870 required alignment of objtoff and funcoff. No longer store it in
871 the ctf_buf unless that buf is derived unmodified from the input.
872 Set ctf_dynbase where ctf_base is dynamically allocated. Drop locals
873 that duplicate fields in ctf_file: move allocation of ctf_file
874 further up instead. Call upgrade_header as needed. Move
875 version-specific ctf_parmax initialization into upgrade_types. More
876 concise error handling.
877 (ctf_file_close): No longer test for null pointers before freeing.
878 Free ctf_dyncuname, ctf_dynbase, and ctf_header. Do not call
879 ctf_free_base.
880 (ctf_cuname): New.
881 (ctf_cuname_set): New.
882 * ctf-create.c (ctf_update): Populate ctf_cuname.
883 (ctf_gzwrite): Write out the header explicitly. Remove obsolescent
884 comment.
885 (ctf_write): Likewise.
886 (ctf_compress_write): Get the header from ctf_header, not ctf_base.
887 Fix the compression length: fp->ctf_size never counted the CTF
888 header. Simplify the compress call accordingly.
889
a2230b5e
HPN
8902019-07-11 Hans-Peter Nilsson <hp@bitrange.com>
891
892 * ctf-endian.h: Don't assume htole64 and le64toh are always
893 present if HAVE_ENDIAN_H; also check if htole64 is defined.
894 [!WORDS_BIGENDIAN] (htole64, le64toh): Define as identity,
895 not bswap_identity_64.
896
fd361982
AM
8972019-09-18 Alan Modra <amodra@gmail.com>
898
899 * ctf-open-bfd.c: Update throughout for bfd section macro changes.
900
60391a25
PB
9012019-09-09 Phil Blundell <pb@pbcl.net>
902
903 binutils 2.33 branch created.
904
12a0b67d
NA
9052019-07-18 Nick Alcock <nick.alcock@oracle.com>
906
907 * ctf-types.c (ctf_type_aname_raw): New.
908 (ctf_func_type_info): Likewise.
909 (ctf_func_type_args): Likewise.
910 * ctf-error.c (_ctf_errlist): Fix description.
911 * ctf-lookup.c: Fix file description.
912
083114f8 9132019-06-28 Nick Alcock <nick.alcock@oracle.com>
f57cf0e3
NA
914
915 * ctf-create.c (ctf_create): Fix off-by-one error.
916
083114f8 9172019-06-28 Nick Alcock <nick.alcock@oracle.com>
f5e9c9bd
NA
918
919 * ctf-impl.h: (struct ctf_strs_writable): New, non-const version of
920 struct ctf_strs.
921 (struct ctf_dtdef): Note that dtd_data.ctt_name is unpopulated.
922 (struct ctf_str_atom): New, disambiguated single string.
923 (struct ctf_str_atom_ref): New, points to some other location that
924 references this string's offset.
925 (struct ctf_file): New members ctf_str_atoms and ctf_str_num_refs.
926 Remove member ctf_dtvstrlen: we no longer track the total strlen
927 as we add strings.
928 (ctf_str_create_atoms): Declare new function in ctf-string.c.
929 (ctf_str_free_atoms): Likewise.
930 (ctf_str_add): Likewise.
931 (ctf_str_add_ref): Likewise.
932 (ctf_str_rollback): Likewise.
933 (ctf_str_purge_refs): Likewise.
934 (ctf_str_write_strtab): Likewise.
935 (ctf_realloc): Declare new function in ctf-util.c.
936
937 * ctf-open.c (ctf_bufopen): Create the atoms table.
938 (ctf_file_close): Destroy it.
939 * ctf-create.c (ctf_update): Copy-and-free it on update. No longer
940 special-case the position of the parname string. Construct the
941 strtab by calling ctf_str_add_ref and ctf_str_write_strtab after the
942 rest of each buffer element is constructed, not via open-coding:
943 realloc the CTF buffer and append the strtab to it. No longer
944 maintain ctf_dtvstrlen. Sort the variable entry table later, after
945 strtab construction.
946 (ctf_copy_membnames): Remove: integrated into ctf_copy_{s,l,e}members.
947 (ctf_copy_smembers): Drop the string offset: call ctf_str_add_ref
948 after buffer element construction instead.
949 (ctf_copy_lmembers): Likewise.
950 (ctf_copy_emembers): Likewise.
951 (ctf_create): No longer maintain the ctf_dtvstrlen.
952 (ctf_dtd_delete): Likewise.
953 (ctf_dvd_delete): Likewise.
954 (ctf_add_generic): Likewise.
955 (ctf_add_enumerator): Likewise.
956 (ctf_add_member_offset): Likewise.
957 (ctf_add_variable): Likewise.
958 (membadd): Likewise.
959 * ctf-util.c (ctf_realloc): New, wrapper around realloc that aborts
960 if there are active ctf_str_num_refs.
961 (ctf_strraw): Move to ctf-string.c.
962 (ctf_strptr): Likewise.
963 * ctf-string.c: New file, strtab manipulation.
964
965 * Makefile.am (libctf_a_SOURCES): Add it.
966 * Makefile.in: Regenerate.
967
083114f8 9682019-06-28 Nick Alcock <nick.alcock@oracle.com>
9658dc39
NA
969
970 * ctf-impl.h (ctf_hash_iter_f): New.
971 (ctf_dynhash_iter): New declaration.
972 (ctf_dynhash_iter_remove): New declaration.
973 * ctf-hash.c (ctf_dynhash_iter): Define.
974 (ctf_dynhash_iter_remove): Likewise.
975 (ctf_hashtab_traverse): New.
976 (ctf_hashtab_traverse_remove): Likewise.
977 (struct ctf_traverse_cb_arg): Likewise.
978 (struct ctf_traverse_remove_cb_arg): Likewise.
979
083114f8 9802019-06-28 Nick Alcock <nick.alcock@oracle.com>
3e10cffc
NA
981
982 * ctf-hash.c (ctf_dynhash_remove): Call with a mocked-up element.
983
083114f8 9842019-06-28 Nick Alcock <nick.alcock@oracle.com>
c550e7ba
NA
985
986 * ctf-dump.c (ctf_dump_format_type): Prefix hex strings with 0x.
987 (ctf_dump_funcs): Likewise.
988
083114f8 9892019-06-19 Nick Alcock <nick.alcock@oracle.com>
cf02c44d
NA
990
991 * ctf-open-bfd.c: Add swap.h and ctf-endian.h.
992 (ctf_fdopen): Check for endian-swapped raw CTF magic, and
993 little-endian CTF archive magic. Do not check the CTF version:
994 ctf_simple_open does that in endian-safe ways. Do not dereference
995 null pointers on open failure.
996
083114f8 9972019-06-19 Nick Alcock <nick.alcock@oracle.com>
7cee1826
NA
998
999 * ctf-open.c (get_vbytes_common): Return the new slice size.
1000 (ctf_bufopen): Flip the endianness of the CTF-section header copy.
1001 Remember to copy in the CTF data when opening an uncompressed
1002 foreign-endian CTF file. Prune useless variable manipulation.
1003
083114f8 10042019-06-19 Nick Alcock <nick.alcock@oracle.com>
0b4fa56e
NA
1005
1006 * ctf-open.c (ctf_types): Fail when unidentified type kinds are
1007 seen.
1008
083114f8 10092019-06-19 Nick Alcock <nick.alcock@oracle.com>
364620bf
NA
1010
1011 * ctf-open.c (ctf_bufopen): Dump header offsets into the debugging
1012 output.
1013
083114f8 10142019-06-19 Nick Alcock <nick.alcock@oracle.com>
65365aa8
NA
1015
1016 * ctf-subr.c (_PAGESIZE): Remove.
1017 (ctf_data_alloc): Likewise.
1018 (ctf_data_free): Likewise.
1019 (ctf_data_protect): Likewise.
1020 * ctf-impl.h: Remove declarations.
1021 * ctf-create.c (ctf_update): No longer call ctf_data_protect: use
1022 ctf_free, not ctf_data_free.
1023 (ctf_compress_write): Use ctf_data_alloc, not ctf_alloc. Free
1024 the buffer again on compression error.
1025 * ctf-open.c (ctf_set_base): No longer track the size: call
1026 ctf_free, not ctf_data_free.
1027 (upgrade_types): Likewise. Call ctf_alloc, not ctf_data_alloc.
1028 (ctf_bufopen): Likewise. No longer call ctf_data_protect.
1029
083114f8 10302019-06-19 Nick Alcock <nick.alcock@oracle.com>
24865428
NA
1031
1032 * ctf-create.c (ctf_dtd_insert): Pass on error returns from
1033 ctf_dynhash_insert.
1034 (ctf_dvd_insert): Likewise.
1035 (ctf_add_generic): Likewise.
1036 (ctf_add_variable): Likewise.
1037 * ctf-impl.h: Adjust declarations.
1038
3a3a077c
AM
10392019-06-14 Alan Modra <amodra@gmail.com>
1040
1041 * configure: Regenerate.
1042
942d35f7
NA
10432019-06-06 Nick Alcock <nick.alcock@oracle.com>
1044
1045 * ctf-decls.h: Include <libiberty.h>.
1046 * ctf-lookup.c (ctf_lookup_by_name): Call xstrndup(), not strndup().
1047
595a4d43
NA
10482019-06-06 Nick Alcock <nick.alcock@oracle.com>
1049
1050 * ctf-dump.c (ctf_dump_format_type): Cast size_t's used in printf()s.
1051 (ctf_dump_objts): Likewise.
1052 (ctf_dump_funcs): Likewise.
1053 (ctf_dump_member): Likewise.
1054 (ctf_dump_str): Likewise.
1055
f5e73be1
NA
10562019-06-06 Nick Alcock <nick.alcock@oracle.com>
1057
1058 * ctf-archive.c (arc_mmap_header): Mark fd as potentially unused.
1059 * ctf-subr.c (ctf_data_protect): Mark both args as potentially unused.
1060
62d8e3b7
NA
10612019-06-05 Nick Alcock <nick.alcock@oracle.com>
1062
1063 * ctf-archive.c (ctf_arc_write): Eschew %zi format specifier.
1064 (ctf_arc_open_by_offset): Likewise.
1065 * ctf-create.c (ctf_add_type): Likewise.
1066
76fad999
TT
10672019-06-04 Tom Tromey <tromey@adacore.com>
1068
1069 * ctf-create.c (ctf_add_encoded, ctf_add_slice)
1070 (ctf_add_member_offset): Use CHAR_BIT, not NBBY.
1071
ad118caa
NA
10722019-06-04 Nick Alcock <nick.alcock@oracle.com>
1073
1074 * configure.ac: Check for O_CLOEXEC.
1075 * ctf-decls.h (O_CLOEXEC): Define (to 0), if need be.
1076 * config.h.in: Regenerate.
1077 * configure: Likewise.
1078
6b22174f
NA
10792019-06-04 Nick Alcock <nick.alcock@oracle.com>
1080
1081 * qsort_r.c: Rename to...
1082 * ctf-qsort_r.c: ... this.
1083 (_quicksort): Define to ctf_qsort_r.
1084 * ctf-decls.h (qsort_r): Remove.
1085 (ctf_qsort_r): Add.
1086 (struct ctf_qsort_arg): New, transport the real ARG and COMPAR.
1087 (ctf_qsort_compar_thunk): Rearrange the arguments to COMPAR.
1088 * Makefile.am (libctf_a_LIBADD): Remove.
1089 (libctf_a_SOURCES): New, add ctf-qsort_r.c.
1090 * ctf-archive.c (ctf_arc_write): Call ctf_qsort_r, not qsort_r.
1091 * ctf-create.c (ctf_update): Likewise.
1092 * configure.ac: Check for BSD versus GNU qsort_r signature.
1093 * Makefile.in: Regenerate.
1094 * config.h.in: Likewise.
1095 * configure: Likewise.
1096
941accce
NA
10972019-06-03 Nick Alcock <nick.alcock@oracle.com>
1098
1099 * ctf-dump.c (ctf_dump_funcs): Free in the right place.
1100
a0486bac
JM
11012019-05-29 Nick Alcock <nick.alcock@oracle.com>
1102
1103 * Makefile.am (ZLIB): New.
1104 (ZLIBINC): Likewise.
1105 (AM_CFLAGS): Use them.
1106 (libctf_a_LIBADD): New, for LIBOBJS.
1107 * configure.ac: Check for zlib, endian.h, and qsort_r.
1108 * ctf-endian.h: New, providing htole64 and le64toh.
1109 * swap.h: Code style fixes.
1110 (bswap_identity_64): New.
1111 * qsort_r.c: New, from gnulib (with one added #include).
1112 * ctf-decls.h: New, providing a conditional qsort_r declaration,
1113 and unconditional definitions of MIN and MAX.
1114 * ctf-impl.h: Use it. Do not use <sys/errno.h>.
1115 (ctf_set_errno): Now returns unsigned long.
1116 * ctf-util.c (ctf_set_errno): Adjust here too.
1117 * ctf-archive.c: Use ctf-endian.h.
1118 (ctf_arc_open_by_offset): Use memset, not bzero. Drop cts_type,
1119 cts_flags and cts_offset.
1120 (ctf_arc_write): Drop debugging dependent on the size of off_t.
1121 * ctf-create.c: Provide a definition of roundup if not defined.
1122 (ctf_create): Drop cts_type, cts_flags and cts_offset.
1123 (ctf_add_reftype): Do not check if type IDs are below zero.
1124 (ctf_add_slice): Likewise.
1125 (ctf_add_typedef): Likewise.
1126 (ctf_add_member_offset): Cast error-returning ssize_t's to size_t
1127 when known error-free. Drop CTF_ERR usage for functions returning
1128 int.
1129 (ctf_add_member_encoded): Drop CTF_ERR usage for functions returning
1130 int.
1131 (ctf_add_variable): Likewise.
1132 (enumcmp): Likewise.
1133 (enumadd): Likewise.
1134 (membcmp): Likewise.
1135 (ctf_add_type): Likewise. Cast error-returning ssize_t's to size_t
1136 when known error-free.
1137 * ctf-dump.c (ctf_is_slice): Drop CTF_ERR usage for functions
1138 returning int: use CTF_ERR for functions returning ctf_type_id.
1139 (ctf_dump_label): Likewise.
1140 (ctf_dump_objts): Likewise.
1141 * ctf-labels.c (ctf_label_topmost): Likewise.
1142 (ctf_label_iter): Likewise.
1143 (ctf_label_info): Likewise.
1144 * ctf-lookup.c (ctf_func_args): Likewise.
1145 * ctf-open.c (upgrade_types): Cast to size_t where appropriate.
1146 (ctf_bufopen): Likewise. Use zlib types as needed.
1147 * ctf-types.c (ctf_member_iter): Drop CTF_ERR usage for functions
1148 returning int.
1149 (ctf_enum_iter): Likewise.
1150 (ctf_type_size): Likewise.
1151 (ctf_type_align): Likewise. Cast to size_t where appropriate.
1152 (ctf_type_kind_unsliced): Likewise.
1153 (ctf_type_kind): Likewise.
1154 (ctf_type_encoding): Likewise.
1155 (ctf_member_info): Likewise.
1156 (ctf_array_info): Likewise.
1157 (ctf_enum_value): Likewise.
1158 (ctf_type_rvisit): Likewise.
1159 * ctf-open-bfd.c (ctf_bfdopen): Drop cts_type, cts_flags and
1160 cts_offset.
1161 (ctf_simple_open): Likewise.
1162 (ctf_bfdopen_ctfsect): Likewise. Set cts_size properly.
1163 * Makefile.in: Regenerate.
1164 * aclocal.m4: Likewise.
1165 * config.h: Likewise.
1166 * configure: Likewise.
1167
9698cf9b
NA
11682019-05-28 Nick Alcock <nick.alcock@oracle.com>
1169
1170 * configure.in: Check for bfd_section_from_elf_index.
1171 * configure: Regenerate.
1172 * config.h.in [HAVE_BFD_ELF]: Likewise.
1173 * libctf/ctf_open_bfd (ctf_bfdopen_ctfsect): Use it.
1174 abfd is potentially unused now.
1175
0e65dfba
NA
11762019-05-28 Nick Alcock <nick.alcock@oracle.com>
1177
1178 * Makefile.am: New.
1179 * Makefile.in: Regenerated.
1180 * config.h.in: Likewise.
1181 * aclocal.m4: Likewise.
1182 * configure: Likewise.
1183
a30b3e18
NA
11842019-05-28 Nick Alcock <nick.alcock@oracle.com>
1185
1186 * ctf-dump.c: New.
1187
6dbf2b73
NA
11882019-05-28 Nick Alcock <nick.alcock@oracle.com>
1189
1190 * ctf-labels.c: New.
1191
6c33b742
NA
11922019-05-28 Nick Alcock <nick.alcock@oracle.com>
1193
1194 * ctf-impl.h (_libctf_version): New declaration.
1195 * ctf-subr.c (_libctf_version): Define it.
1196 (ctf_version): New.
1197
c499eb68
NA
11982019-05-28 Nick Alcock <nick.alcock@oracle.com>
1199
1200 * ctf-create.c (enumcmp): New.
1201 (enumadd): Likewise.
1202 (membcmp): Likewise.
1203 (membadd): Likewise.
1204 (ctf_add_type): Likewise.
1205
b437bfe0
NA
12062019-05-28 Nick Alcock <nick.alcock@oracle.com>
1207
1208 * ctf-lookup.c (isqualifier): New.
1209 (ctf_lookup_by_name): Likewise.
1210 (struct ctf_lookup_var_key): Likewise.
1211 (ctf_lookup_var): Likewise.
1212 (ctf_lookup_variable): Likewise.
1213 (ctf_lookup_symbol_name): Likewise.
1214 (ctf_lookup_by_symbol): Likewise.
1215 (ctf_func_info): Likewise.
1216 (ctf_func_args): Likewise.
1217
316afdb1
NA
12182019-05-28 Nick Alcock <nick.alcock@oracle.com>
1219
1220 * ctf-decl.c: New file.
1221 * ctf-types.c: Likewise.
1222 * ctf-impl.h: New declarations.
1223
143dce84
NA
12242019-05-28 Nick Alcock <nick.alcock@oracle.com>
1225
1226 * ctf-open-bfd.c: New file.
1227 * ctf-open.c (ctf_close): New.
1228 * ctf-impl.h: Include bfd.h.
1229 (ctf_file): New members ctf_data_mmapped, ctf_data_mmapped_len.
1230 (ctf_archive_internal): New members ctfi_abfd, ctfi_data,
1231 ctfi_bfd_close.
1232 (ctf_bfdopen_ctfsect): New declaration.
1233 (_CTF_SECTION): likewise.
1234
9402cc59
NA
12352019-05-28 Nick Alcock <nick.alcock@oracle.com>
1236
1237 * ctf-archive.c: New.
1238 * ctf-impl.h (ctf_archive_internal): New type.
1239 (ctf_arc_open_internal): New declaration.
1240 (ctf_arc_bufopen): Likewise.
1241 (ctf_arc_close_internal): Likewise.
1242
72f33921
NA
12432019-05-28 Nick Alcock <nick.alcock@oracle.com>
1244
1245 * ctf-open.c: New file.
1246 * swap.h: Likewise.
1247
47d546f4
NA
12482019-05-28 Nick Alcock <nick.alcock@oracle.com>
1249
1250 * ctf-create.c: New file.
1251 * ctf-lookup.c: New file.
1252
a5be9bbe
NA
12532019-05-28 Nick Alcock <nick.alcock@oracle.com>
1254
1255 * ctf-impl.h: New definitions and declarations for type creation
1256 and lookup.
1257
c0754cdd
NA
12582019-05-28 Nick Alcock <nick.alcock@oracle.com>
1259
1260 * ctf-hash.c: New file.
1261 * ctf-impl.h: New declarations.
1262
479604f4
NA
12632019-05-28 Nick Alcock <nick.alcock@oracle.com>
1264
1265 * ctf-error.c: New file.
1266
94585e7f
NA
12672019-05-28 Nick Alcock <nick.alcock@oracle.com>
1268
1269 * ctf-util.c: New file.
1270 * elf.h: Likewise.
1271 * ctf-impl.h: Include it, and add declarations.
1272
60da9d95
NA
12732019-05-28 Nick Alcock <nick.alcock@oracle.com>
1274
1275 * ctf-impl.h: New file.
1276 * ctf-subr.c: New file.
1277
1278\f
1279Local Variables:
1280mode: change-log
1281left-margin: 8
1282fill-column: 76
1283version-control: never
1284End:
This page took 0.139061 seconds and 4 git commands to generate.