libctf: allow the header to change between versions
[deliverable/binutils-gdb.git] / libctf / ChangeLog
CommitLineData
fd55eae8
NA
12019-07-06 Nick Alcock <nick.alcock@oracle.com>
2
3 * ctf-impl.h (ctf_file_t): New fields ctf_header, ctf_dynbase,
4 ctf_cuname, ctf_dyncuname: ctf_base and ctf_buf are no longer const.
5 * ctf-open.c (ctf_set_base): Preserve the gap between ctf_buf and
6 ctf_base: do not assume that it is always sizeof (ctf_header_t).
7 Print out ctf_cuname: only print out ctf_parname if set.
8 (ctf_free_base): Removed, ctf_base is no longer freed: free
9 ctf_dynbase instead.
10 (ctf_set_version): Fix spacing.
11 (upgrade_header): New, in-place header upgrading.
12 (upgrade_types): Rename to...
13 (upgrade_types_v1): ... this. Free ctf_dynbase, not ctf_base. No
14 longer track old and new headers separately. No longer allow for
15 header sizes explicitly: squeeze the headers out on upgrade (they
16 are preserved in fp->ctf_header). Set ctf_dynbase, ctf_base and
17 ctf_buf explicitly. Use ctf_free, not ctf_free_base.
18 (upgrade_types): New, also handle ctf_parmax updating.
19 (flip_header): Flip ctf_cuname.
20 (flip_types): Flip BUF explicitly rather than deriving BUF from
21 BASE.
22 (ctf_bufopen): Store the header in fp->ctf_header. Correct minimum
23 required alignment of objtoff and funcoff. No longer store it in
24 the ctf_buf unless that buf is derived unmodified from the input.
25 Set ctf_dynbase where ctf_base is dynamically allocated. Drop locals
26 that duplicate fields in ctf_file: move allocation of ctf_file
27 further up instead. Call upgrade_header as needed. Move
28 version-specific ctf_parmax initialization into upgrade_types. More
29 concise error handling.
30 (ctf_file_close): No longer test for null pointers before freeing.
31 Free ctf_dyncuname, ctf_dynbase, and ctf_header. Do not call
32 ctf_free_base.
33 (ctf_cuname): New.
34 (ctf_cuname_set): New.
35 * ctf-create.c (ctf_update): Populate ctf_cuname.
36 (ctf_gzwrite): Write out the header explicitly. Remove obsolescent
37 comment.
38 (ctf_write): Likewise.
39 (ctf_compress_write): Get the header from ctf_header, not ctf_base.
40 Fix the compression length: fp->ctf_size never counted the CTF
41 header. Simplify the compress call accordingly.
42
a2230b5e
HPN
432019-07-11 Hans-Peter Nilsson <hp@bitrange.com>
44
45 * ctf-endian.h: Don't assume htole64 and le64toh are always
46 present if HAVE_ENDIAN_H; also check if htole64 is defined.
47 [!WORDS_BIGENDIAN] (htole64, le64toh): Define as identity,
48 not bswap_identity_64.
49
fd361982
AM
502019-09-18 Alan Modra <amodra@gmail.com>
51
52 * ctf-open-bfd.c: Update throughout for bfd section macro changes.
53
60391a25
PB
542019-09-09 Phil Blundell <pb@pbcl.net>
55
56 binutils 2.33 branch created.
57
12a0b67d
NA
582019-07-18 Nick Alcock <nick.alcock@oracle.com>
59
60 * ctf-types.c (ctf_type_aname_raw): New.
61 (ctf_func_type_info): Likewise.
62 (ctf_func_type_args): Likewise.
63 * ctf-error.c (_ctf_errlist): Fix description.
64 * ctf-lookup.c: Fix file description.
65
083114f8 662019-06-28 Nick Alcock <nick.alcock@oracle.com>
f57cf0e3
NA
67
68 * ctf-create.c (ctf_create): Fix off-by-one error.
69
083114f8 702019-06-28 Nick Alcock <nick.alcock@oracle.com>
f5e9c9bd
NA
71
72 * ctf-impl.h: (struct ctf_strs_writable): New, non-const version of
73 struct ctf_strs.
74 (struct ctf_dtdef): Note that dtd_data.ctt_name is unpopulated.
75 (struct ctf_str_atom): New, disambiguated single string.
76 (struct ctf_str_atom_ref): New, points to some other location that
77 references this string's offset.
78 (struct ctf_file): New members ctf_str_atoms and ctf_str_num_refs.
79 Remove member ctf_dtvstrlen: we no longer track the total strlen
80 as we add strings.
81 (ctf_str_create_atoms): Declare new function in ctf-string.c.
82 (ctf_str_free_atoms): Likewise.
83 (ctf_str_add): Likewise.
84 (ctf_str_add_ref): Likewise.
85 (ctf_str_rollback): Likewise.
86 (ctf_str_purge_refs): Likewise.
87 (ctf_str_write_strtab): Likewise.
88 (ctf_realloc): Declare new function in ctf-util.c.
89
90 * ctf-open.c (ctf_bufopen): Create the atoms table.
91 (ctf_file_close): Destroy it.
92 * ctf-create.c (ctf_update): Copy-and-free it on update. No longer
93 special-case the position of the parname string. Construct the
94 strtab by calling ctf_str_add_ref and ctf_str_write_strtab after the
95 rest of each buffer element is constructed, not via open-coding:
96 realloc the CTF buffer and append the strtab to it. No longer
97 maintain ctf_dtvstrlen. Sort the variable entry table later, after
98 strtab construction.
99 (ctf_copy_membnames): Remove: integrated into ctf_copy_{s,l,e}members.
100 (ctf_copy_smembers): Drop the string offset: call ctf_str_add_ref
101 after buffer element construction instead.
102 (ctf_copy_lmembers): Likewise.
103 (ctf_copy_emembers): Likewise.
104 (ctf_create): No longer maintain the ctf_dtvstrlen.
105 (ctf_dtd_delete): Likewise.
106 (ctf_dvd_delete): Likewise.
107 (ctf_add_generic): Likewise.
108 (ctf_add_enumerator): Likewise.
109 (ctf_add_member_offset): Likewise.
110 (ctf_add_variable): Likewise.
111 (membadd): Likewise.
112 * ctf-util.c (ctf_realloc): New, wrapper around realloc that aborts
113 if there are active ctf_str_num_refs.
114 (ctf_strraw): Move to ctf-string.c.
115 (ctf_strptr): Likewise.
116 * ctf-string.c: New file, strtab manipulation.
117
118 * Makefile.am (libctf_a_SOURCES): Add it.
119 * Makefile.in: Regenerate.
120
083114f8 1212019-06-28 Nick Alcock <nick.alcock@oracle.com>
9658dc39
NA
122
123 * ctf-impl.h (ctf_hash_iter_f): New.
124 (ctf_dynhash_iter): New declaration.
125 (ctf_dynhash_iter_remove): New declaration.
126 * ctf-hash.c (ctf_dynhash_iter): Define.
127 (ctf_dynhash_iter_remove): Likewise.
128 (ctf_hashtab_traverse): New.
129 (ctf_hashtab_traverse_remove): Likewise.
130 (struct ctf_traverse_cb_arg): Likewise.
131 (struct ctf_traverse_remove_cb_arg): Likewise.
132
083114f8 1332019-06-28 Nick Alcock <nick.alcock@oracle.com>
3e10cffc
NA
134
135 * ctf-hash.c (ctf_dynhash_remove): Call with a mocked-up element.
136
083114f8 1372019-06-28 Nick Alcock <nick.alcock@oracle.com>
c550e7ba
NA
138
139 * ctf-dump.c (ctf_dump_format_type): Prefix hex strings with 0x.
140 (ctf_dump_funcs): Likewise.
141
083114f8 1422019-06-19 Nick Alcock <nick.alcock@oracle.com>
cf02c44d
NA
143
144 * ctf-open-bfd.c: Add swap.h and ctf-endian.h.
145 (ctf_fdopen): Check for endian-swapped raw CTF magic, and
146 little-endian CTF archive magic. Do not check the CTF version:
147 ctf_simple_open does that in endian-safe ways. Do not dereference
148 null pointers on open failure.
149
083114f8 1502019-06-19 Nick Alcock <nick.alcock@oracle.com>
7cee1826
NA
151
152 * ctf-open.c (get_vbytes_common): Return the new slice size.
153 (ctf_bufopen): Flip the endianness of the CTF-section header copy.
154 Remember to copy in the CTF data when opening an uncompressed
155 foreign-endian CTF file. Prune useless variable manipulation.
156
083114f8 1572019-06-19 Nick Alcock <nick.alcock@oracle.com>
0b4fa56e
NA
158
159 * ctf-open.c (ctf_types): Fail when unidentified type kinds are
160 seen.
161
083114f8 1622019-06-19 Nick Alcock <nick.alcock@oracle.com>
364620bf
NA
163
164 * ctf-open.c (ctf_bufopen): Dump header offsets into the debugging
165 output.
166
083114f8 1672019-06-19 Nick Alcock <nick.alcock@oracle.com>
65365aa8
NA
168
169 * ctf-subr.c (_PAGESIZE): Remove.
170 (ctf_data_alloc): Likewise.
171 (ctf_data_free): Likewise.
172 (ctf_data_protect): Likewise.
173 * ctf-impl.h: Remove declarations.
174 * ctf-create.c (ctf_update): No longer call ctf_data_protect: use
175 ctf_free, not ctf_data_free.
176 (ctf_compress_write): Use ctf_data_alloc, not ctf_alloc. Free
177 the buffer again on compression error.
178 * ctf-open.c (ctf_set_base): No longer track the size: call
179 ctf_free, not ctf_data_free.
180 (upgrade_types): Likewise. Call ctf_alloc, not ctf_data_alloc.
181 (ctf_bufopen): Likewise. No longer call ctf_data_protect.
182
083114f8 1832019-06-19 Nick Alcock <nick.alcock@oracle.com>
24865428
NA
184
185 * ctf-create.c (ctf_dtd_insert): Pass on error returns from
186 ctf_dynhash_insert.
187 (ctf_dvd_insert): Likewise.
188 (ctf_add_generic): Likewise.
189 (ctf_add_variable): Likewise.
190 * ctf-impl.h: Adjust declarations.
191
3a3a077c
AM
1922019-06-14 Alan Modra <amodra@gmail.com>
193
194 * configure: Regenerate.
195
942d35f7
NA
1962019-06-06 Nick Alcock <nick.alcock@oracle.com>
197
198 * ctf-decls.h: Include <libiberty.h>.
199 * ctf-lookup.c (ctf_lookup_by_name): Call xstrndup(), not strndup().
200
595a4d43
NA
2012019-06-06 Nick Alcock <nick.alcock@oracle.com>
202
203 * ctf-dump.c (ctf_dump_format_type): Cast size_t's used in printf()s.
204 (ctf_dump_objts): Likewise.
205 (ctf_dump_funcs): Likewise.
206 (ctf_dump_member): Likewise.
207 (ctf_dump_str): Likewise.
208
f5e73be1
NA
2092019-06-06 Nick Alcock <nick.alcock@oracle.com>
210
211 * ctf-archive.c (arc_mmap_header): Mark fd as potentially unused.
212 * ctf-subr.c (ctf_data_protect): Mark both args as potentially unused.
213
62d8e3b7
NA
2142019-06-05 Nick Alcock <nick.alcock@oracle.com>
215
216 * ctf-archive.c (ctf_arc_write): Eschew %zi format specifier.
217 (ctf_arc_open_by_offset): Likewise.
218 * ctf-create.c (ctf_add_type): Likewise.
219
76fad999
TT
2202019-06-04 Tom Tromey <tromey@adacore.com>
221
222 * ctf-create.c (ctf_add_encoded, ctf_add_slice)
223 (ctf_add_member_offset): Use CHAR_BIT, not NBBY.
224
ad118caa
NA
2252019-06-04 Nick Alcock <nick.alcock@oracle.com>
226
227 * configure.ac: Check for O_CLOEXEC.
228 * ctf-decls.h (O_CLOEXEC): Define (to 0), if need be.
229 * config.h.in: Regenerate.
230 * configure: Likewise.
231
6b22174f
NA
2322019-06-04 Nick Alcock <nick.alcock@oracle.com>
233
234 * qsort_r.c: Rename to...
235 * ctf-qsort_r.c: ... this.
236 (_quicksort): Define to ctf_qsort_r.
237 * ctf-decls.h (qsort_r): Remove.
238 (ctf_qsort_r): Add.
239 (struct ctf_qsort_arg): New, transport the real ARG and COMPAR.
240 (ctf_qsort_compar_thunk): Rearrange the arguments to COMPAR.
241 * Makefile.am (libctf_a_LIBADD): Remove.
242 (libctf_a_SOURCES): New, add ctf-qsort_r.c.
243 * ctf-archive.c (ctf_arc_write): Call ctf_qsort_r, not qsort_r.
244 * ctf-create.c (ctf_update): Likewise.
245 * configure.ac: Check for BSD versus GNU qsort_r signature.
246 * Makefile.in: Regenerate.
247 * config.h.in: Likewise.
248 * configure: Likewise.
249
941accce
NA
2502019-06-03 Nick Alcock <nick.alcock@oracle.com>
251
252 * ctf-dump.c (ctf_dump_funcs): Free in the right place.
253
a0486bac
JM
2542019-05-29 Nick Alcock <nick.alcock@oracle.com>
255
256 * Makefile.am (ZLIB): New.
257 (ZLIBINC): Likewise.
258 (AM_CFLAGS): Use them.
259 (libctf_a_LIBADD): New, for LIBOBJS.
260 * configure.ac: Check for zlib, endian.h, and qsort_r.
261 * ctf-endian.h: New, providing htole64 and le64toh.
262 * swap.h: Code style fixes.
263 (bswap_identity_64): New.
264 * qsort_r.c: New, from gnulib (with one added #include).
265 * ctf-decls.h: New, providing a conditional qsort_r declaration,
266 and unconditional definitions of MIN and MAX.
267 * ctf-impl.h: Use it. Do not use <sys/errno.h>.
268 (ctf_set_errno): Now returns unsigned long.
269 * ctf-util.c (ctf_set_errno): Adjust here too.
270 * ctf-archive.c: Use ctf-endian.h.
271 (ctf_arc_open_by_offset): Use memset, not bzero. Drop cts_type,
272 cts_flags and cts_offset.
273 (ctf_arc_write): Drop debugging dependent on the size of off_t.
274 * ctf-create.c: Provide a definition of roundup if not defined.
275 (ctf_create): Drop cts_type, cts_flags and cts_offset.
276 (ctf_add_reftype): Do not check if type IDs are below zero.
277 (ctf_add_slice): Likewise.
278 (ctf_add_typedef): Likewise.
279 (ctf_add_member_offset): Cast error-returning ssize_t's to size_t
280 when known error-free. Drop CTF_ERR usage for functions returning
281 int.
282 (ctf_add_member_encoded): Drop CTF_ERR usage for functions returning
283 int.
284 (ctf_add_variable): Likewise.
285 (enumcmp): Likewise.
286 (enumadd): Likewise.
287 (membcmp): Likewise.
288 (ctf_add_type): Likewise. Cast error-returning ssize_t's to size_t
289 when known error-free.
290 * ctf-dump.c (ctf_is_slice): Drop CTF_ERR usage for functions
291 returning int: use CTF_ERR for functions returning ctf_type_id.
292 (ctf_dump_label): Likewise.
293 (ctf_dump_objts): Likewise.
294 * ctf-labels.c (ctf_label_topmost): Likewise.
295 (ctf_label_iter): Likewise.
296 (ctf_label_info): Likewise.
297 * ctf-lookup.c (ctf_func_args): Likewise.
298 * ctf-open.c (upgrade_types): Cast to size_t where appropriate.
299 (ctf_bufopen): Likewise. Use zlib types as needed.
300 * ctf-types.c (ctf_member_iter): Drop CTF_ERR usage for functions
301 returning int.
302 (ctf_enum_iter): Likewise.
303 (ctf_type_size): Likewise.
304 (ctf_type_align): Likewise. Cast to size_t where appropriate.
305 (ctf_type_kind_unsliced): Likewise.
306 (ctf_type_kind): Likewise.
307 (ctf_type_encoding): Likewise.
308 (ctf_member_info): Likewise.
309 (ctf_array_info): Likewise.
310 (ctf_enum_value): Likewise.
311 (ctf_type_rvisit): Likewise.
312 * ctf-open-bfd.c (ctf_bfdopen): Drop cts_type, cts_flags and
313 cts_offset.
314 (ctf_simple_open): Likewise.
315 (ctf_bfdopen_ctfsect): Likewise. Set cts_size properly.
316 * Makefile.in: Regenerate.
317 * aclocal.m4: Likewise.
318 * config.h: Likewise.
319 * configure: Likewise.
320
9698cf9b
NA
3212019-05-28 Nick Alcock <nick.alcock@oracle.com>
322
323 * configure.in: Check for bfd_section_from_elf_index.
324 * configure: Regenerate.
325 * config.h.in [HAVE_BFD_ELF]: Likewise.
326 * libctf/ctf_open_bfd (ctf_bfdopen_ctfsect): Use it.
327 abfd is potentially unused now.
328
0e65dfba
NA
3292019-05-28 Nick Alcock <nick.alcock@oracle.com>
330
331 * Makefile.am: New.
332 * Makefile.in: Regenerated.
333 * config.h.in: Likewise.
334 * aclocal.m4: Likewise.
335 * configure: Likewise.
336
a30b3e18
NA
3372019-05-28 Nick Alcock <nick.alcock@oracle.com>
338
339 * ctf-dump.c: New.
340
6dbf2b73
NA
3412019-05-28 Nick Alcock <nick.alcock@oracle.com>
342
343 * ctf-labels.c: New.
344
6c33b742
NA
3452019-05-28 Nick Alcock <nick.alcock@oracle.com>
346
347 * ctf-impl.h (_libctf_version): New declaration.
348 * ctf-subr.c (_libctf_version): Define it.
349 (ctf_version): New.
350
c499eb68
NA
3512019-05-28 Nick Alcock <nick.alcock@oracle.com>
352
353 * ctf-create.c (enumcmp): New.
354 (enumadd): Likewise.
355 (membcmp): Likewise.
356 (membadd): Likewise.
357 (ctf_add_type): Likewise.
358
b437bfe0
NA
3592019-05-28 Nick Alcock <nick.alcock@oracle.com>
360
361 * ctf-lookup.c (isqualifier): New.
362 (ctf_lookup_by_name): Likewise.
363 (struct ctf_lookup_var_key): Likewise.
364 (ctf_lookup_var): Likewise.
365 (ctf_lookup_variable): Likewise.
366 (ctf_lookup_symbol_name): Likewise.
367 (ctf_lookup_by_symbol): Likewise.
368 (ctf_func_info): Likewise.
369 (ctf_func_args): Likewise.
370
316afdb1
NA
3712019-05-28 Nick Alcock <nick.alcock@oracle.com>
372
373 * ctf-decl.c: New file.
374 * ctf-types.c: Likewise.
375 * ctf-impl.h: New declarations.
376
143dce84
NA
3772019-05-28 Nick Alcock <nick.alcock@oracle.com>
378
379 * ctf-open-bfd.c: New file.
380 * ctf-open.c (ctf_close): New.
381 * ctf-impl.h: Include bfd.h.
382 (ctf_file): New members ctf_data_mmapped, ctf_data_mmapped_len.
383 (ctf_archive_internal): New members ctfi_abfd, ctfi_data,
384 ctfi_bfd_close.
385 (ctf_bfdopen_ctfsect): New declaration.
386 (_CTF_SECTION): likewise.
387
9402cc59
NA
3882019-05-28 Nick Alcock <nick.alcock@oracle.com>
389
390 * ctf-archive.c: New.
391 * ctf-impl.h (ctf_archive_internal): New type.
392 (ctf_arc_open_internal): New declaration.
393 (ctf_arc_bufopen): Likewise.
394 (ctf_arc_close_internal): Likewise.
395
72f33921
NA
3962019-05-28 Nick Alcock <nick.alcock@oracle.com>
397
398 * ctf-open.c: New file.
399 * swap.h: Likewise.
400
47d546f4
NA
4012019-05-28 Nick Alcock <nick.alcock@oracle.com>
402
403 * ctf-create.c: New file.
404 * ctf-lookup.c: New file.
405
a5be9bbe
NA
4062019-05-28 Nick Alcock <nick.alcock@oracle.com>
407
408 * ctf-impl.h: New definitions and declarations for type creation
409 and lookup.
410
c0754cdd
NA
4112019-05-28 Nick Alcock <nick.alcock@oracle.com>
412
413 * ctf-hash.c: New file.
414 * ctf-impl.h: New declarations.
415
479604f4
NA
4162019-05-28 Nick Alcock <nick.alcock@oracle.com>
417
418 * ctf-error.c: New file.
419
94585e7f
NA
4202019-05-28 Nick Alcock <nick.alcock@oracle.com>
421
422 * ctf-util.c: New file.
423 * elf.h: Likewise.
424 * ctf-impl.h: Include it, and add declarations.
425
60da9d95
NA
4262019-05-28 Nick Alcock <nick.alcock@oracle.com>
427
428 * ctf-impl.h: New file.
429 * ctf-subr.c: New file.
430
431\f
432Local Variables:
433mode: change-log
434left-margin: 8
435fill-column: 76
436version-control: never
437End:
This page took 0.055605 seconds and 4 git commands to generate.