Release 2.33.1
[external/binutils.git] / libctf / ChangeLog
1 2019-09-09  Phil Blundell  <pb@pbcl.net>
2
3         binutils 2.33 branch created.
4
5 2019-07-18  Nick Alcock  <nick.alcock@oracle.com>
6
7         * ctf-types.c (ctf_type_aname_raw): New.
8         (ctf_func_type_info): Likewise.
9         (ctf_func_type_args): Likewise.
10         * ctf-error.c (_ctf_errlist): Fix description.
11         * ctf-lookup.c: Fix file description.
12
13 2019-06-28  Nick Alcock <nick.alcock@oracle.com>
14
15         * ctf-create.c (ctf_create): Fix off-by-one error.
16
17 2019-06-28  Nick Alcock <nick.alcock@oracle.com>
18
19         * ctf-impl.h: (struct ctf_strs_writable): New, non-const version of
20         struct ctf_strs.
21         (struct ctf_dtdef): Note that dtd_data.ctt_name is unpopulated.
22         (struct ctf_str_atom): New, disambiguated single string.
23         (struct ctf_str_atom_ref): New, points to some other location that
24         references this string's offset.
25         (struct ctf_file): New members ctf_str_atoms and ctf_str_num_refs.
26         Remove member ctf_dtvstrlen: we no longer track the total strlen
27         as we add strings.
28         (ctf_str_create_atoms): Declare new function in ctf-string.c.
29         (ctf_str_free_atoms): Likewise.
30         (ctf_str_add): Likewise.
31         (ctf_str_add_ref): Likewise.
32         (ctf_str_rollback): Likewise.
33         (ctf_str_purge_refs): Likewise.
34         (ctf_str_write_strtab): Likewise.
35         (ctf_realloc): Declare new function in ctf-util.c.
36
37         * ctf-open.c (ctf_bufopen): Create the atoms table.
38         (ctf_file_close): Destroy it.
39         * ctf-create.c (ctf_update): Copy-and-free it on update.  No longer
40         special-case the position of the parname string.  Construct the
41         strtab by calling ctf_str_add_ref and ctf_str_write_strtab after the
42         rest of each buffer element is constructed, not via open-coding:
43         realloc the CTF buffer and append the strtab to it.  No longer
44         maintain ctf_dtvstrlen.  Sort the variable entry table later, after
45         strtab construction.
46         (ctf_copy_membnames): Remove: integrated into ctf_copy_{s,l,e}members.
47         (ctf_copy_smembers): Drop the string offset: call ctf_str_add_ref
48         after buffer element construction instead.
49         (ctf_copy_lmembers): Likewise.
50         (ctf_copy_emembers): Likewise.
51         (ctf_create): No longer maintain the ctf_dtvstrlen.
52         (ctf_dtd_delete): Likewise.
53         (ctf_dvd_delete): Likewise.
54         (ctf_add_generic): Likewise.
55         (ctf_add_enumerator): Likewise.
56         (ctf_add_member_offset): Likewise.
57         (ctf_add_variable): Likewise.
58         (membadd): Likewise.
59         * ctf-util.c (ctf_realloc): New, wrapper around realloc that aborts
60         if there are active ctf_str_num_refs.
61         (ctf_strraw): Move to ctf-string.c.
62         (ctf_strptr): Likewise.
63         * ctf-string.c: New file, strtab manipulation.
64
65         * Makefile.am (libctf_a_SOURCES): Add it.
66         * Makefile.in: Regenerate.
67
68 2019-06-28  Nick Alcock <nick.alcock@oracle.com>
69
70         * ctf-impl.h (ctf_hash_iter_f): New.
71         (ctf_dynhash_iter): New declaration.
72         (ctf_dynhash_iter_remove): New declaration.
73         * ctf-hash.c (ctf_dynhash_iter): Define.
74         (ctf_dynhash_iter_remove): Likewise.
75         (ctf_hashtab_traverse): New.
76         (ctf_hashtab_traverse_remove): Likewise.
77         (struct ctf_traverse_cb_arg): Likewise.
78         (struct ctf_traverse_remove_cb_arg): Likewise.
79
80 2019-06-28  Nick Alcock <nick.alcock@oracle.com>
81
82         * ctf-hash.c (ctf_dynhash_remove): Call with a mocked-up element.
83
84 2019-06-28  Nick Alcock <nick.alcock@oracle.com>
85
86         * ctf-dump.c (ctf_dump_format_type): Prefix hex strings with 0x.
87         (ctf_dump_funcs): Likewise.
88
89 2019-06-19  Nick Alcock <nick.alcock@oracle.com>
90
91         * ctf-open-bfd.c: Add swap.h and ctf-endian.h.
92         (ctf_fdopen): Check for endian-swapped raw CTF magic, and
93         little-endian CTF archive magic.  Do not check the CTF version:
94         ctf_simple_open does that in endian-safe ways.  Do not dereference
95         null pointers on open failure.
96
97 2019-06-19  Nick Alcock <nick.alcock@oracle.com>
98
99         * ctf-open.c (get_vbytes_common): Return the new slice size.
100         (ctf_bufopen): Flip the endianness of the CTF-section header copy.
101         Remember to copy in the CTF data when opening an uncompressed
102         foreign-endian CTF file.  Prune useless variable manipulation.
103
104 2019-06-19  Nick Alcock <nick.alcock@oracle.com>
105
106         * ctf-open.c (ctf_types): Fail when unidentified type kinds are
107         seen.
108
109 2019-06-19  Nick Alcock <nick.alcock@oracle.com>
110
111         * ctf-open.c (ctf_bufopen): Dump header offsets into the debugging
112         output.
113
114 2019-06-19  Nick Alcock <nick.alcock@oracle.com>
115
116         * ctf-subr.c (_PAGESIZE): Remove.
117         (ctf_data_alloc): Likewise.
118         (ctf_data_free): Likewise.
119         (ctf_data_protect): Likewise.
120         * ctf-impl.h: Remove declarations.
121         * ctf-create.c (ctf_update): No longer call ctf_data_protect: use
122         ctf_free, not ctf_data_free.
123         (ctf_compress_write): Use ctf_data_alloc, not ctf_alloc.  Free
124         the buffer again on compression error.
125         * ctf-open.c (ctf_set_base): No longer track the size: call
126         ctf_free, not ctf_data_free.
127         (upgrade_types): Likewise.  Call ctf_alloc, not ctf_data_alloc.
128         (ctf_bufopen): Likewise.  No longer call ctf_data_protect.
129
130 2019-06-19  Nick Alcock <nick.alcock@oracle.com>
131
132         * ctf-create.c (ctf_dtd_insert): Pass on error returns from
133         ctf_dynhash_insert.
134         (ctf_dvd_insert): Likewise.
135         (ctf_add_generic): Likewise.
136         (ctf_add_variable): Likewise.
137         * ctf-impl.h: Adjust declarations.
138
139 2019-06-14  Alan Modra  <amodra@gmail.com>
140
141         * configure: Regenerate.
142
143 2019-06-06  Nick Alcock  <nick.alcock@oracle.com>
144
145         * ctf-decls.h: Include <libiberty.h>.
146         * ctf-lookup.c (ctf_lookup_by_name): Call xstrndup(), not strndup().
147
148 2019-06-06  Nick Alcock  <nick.alcock@oracle.com>
149
150         * ctf-dump.c (ctf_dump_format_type): Cast size_t's used in printf()s.
151         (ctf_dump_objts): Likewise.
152         (ctf_dump_funcs): Likewise.
153         (ctf_dump_member): Likewise.
154         (ctf_dump_str): Likewise.
155
156 2019-06-06  Nick Alcock  <nick.alcock@oracle.com>
157
158         * ctf-archive.c (arc_mmap_header): Mark fd as potentially unused.
159         * ctf-subr.c (ctf_data_protect): Mark both args as potentially unused.
160
161 2019-06-05  Nick Alcock  <nick.alcock@oracle.com>
162
163         * ctf-archive.c (ctf_arc_write): Eschew %zi format specifier.
164         (ctf_arc_open_by_offset): Likewise.
165         * ctf-create.c (ctf_add_type): Likewise.
166
167 2019-06-04  Tom Tromey  <tromey@adacore.com>
168
169         * ctf-create.c (ctf_add_encoded, ctf_add_slice)
170         (ctf_add_member_offset): Use CHAR_BIT, not NBBY.
171
172 2019-06-04  Nick Alcock  <nick.alcock@oracle.com>
173
174         * configure.ac: Check for O_CLOEXEC.
175         * ctf-decls.h (O_CLOEXEC): Define (to 0), if need be.
176         * config.h.in: Regenerate.
177         * configure: Likewise.
178
179 2019-06-04  Nick Alcock  <nick.alcock@oracle.com>
180
181         * qsort_r.c: Rename to...
182         * ctf-qsort_r.c: ... this.
183         (_quicksort): Define to ctf_qsort_r.
184         * ctf-decls.h (qsort_r): Remove.
185         (ctf_qsort_r): Add.
186         (struct ctf_qsort_arg): New, transport the real ARG and COMPAR.
187         (ctf_qsort_compar_thunk): Rearrange the arguments to COMPAR.
188         * Makefile.am (libctf_a_LIBADD): Remove.
189         (libctf_a_SOURCES): New, add ctf-qsort_r.c.
190         * ctf-archive.c (ctf_arc_write): Call ctf_qsort_r, not qsort_r.
191         * ctf-create.c (ctf_update): Likewise.
192         * configure.ac: Check for BSD versus GNU qsort_r signature.
193         * Makefile.in: Regenerate.
194         * config.h.in: Likewise.
195         * configure: Likewise.
196
197 2019-06-03  Nick Alcock  <nick.alcock@oracle.com>
198
199         * ctf-dump.c (ctf_dump_funcs): Free in the right place.
200
201 2019-05-29  Nick Alcock  <nick.alcock@oracle.com>
202
203         * Makefile.am (ZLIB): New.
204         (ZLIBINC): Likewise.
205         (AM_CFLAGS): Use them.
206         (libctf_a_LIBADD): New, for LIBOBJS.
207         * configure.ac: Check for zlib, endian.h, and qsort_r.
208         * ctf-endian.h: New, providing htole64 and le64toh.
209         * swap.h: Code style fixes.
210         (bswap_identity_64): New.
211         * qsort_r.c: New, from gnulib (with one added #include).
212         * ctf-decls.h: New, providing a conditional qsort_r declaration,
213         and unconditional definitions of MIN and MAX.
214         * ctf-impl.h: Use it.  Do not use <sys/errno.h>.
215         (ctf_set_errno): Now returns unsigned long.
216         * ctf-util.c (ctf_set_errno): Adjust here too.
217         * ctf-archive.c: Use ctf-endian.h.
218         (ctf_arc_open_by_offset): Use memset, not bzero.  Drop cts_type,
219         cts_flags and cts_offset.
220         (ctf_arc_write): Drop debugging dependent on the size of off_t.
221         * ctf-create.c: Provide a definition of roundup if not defined.
222         (ctf_create): Drop cts_type, cts_flags and cts_offset.
223         (ctf_add_reftype): Do not check if type IDs are below zero.
224         (ctf_add_slice): Likewise.
225         (ctf_add_typedef): Likewise.
226         (ctf_add_member_offset): Cast error-returning ssize_t's to size_t
227         when known error-free.  Drop CTF_ERR usage for functions returning
228         int.
229         (ctf_add_member_encoded): Drop CTF_ERR usage for functions returning
230         int.
231         (ctf_add_variable): Likewise.
232         (enumcmp): Likewise.
233         (enumadd): Likewise.
234         (membcmp): Likewise.
235         (ctf_add_type): Likewise.  Cast error-returning ssize_t's to size_t
236         when known error-free.
237         * ctf-dump.c (ctf_is_slice): Drop CTF_ERR usage for functions
238         returning int: use CTF_ERR for functions returning ctf_type_id.
239         (ctf_dump_label): Likewise.
240         (ctf_dump_objts): Likewise.
241         * ctf-labels.c (ctf_label_topmost): Likewise.
242         (ctf_label_iter): Likewise.
243         (ctf_label_info): Likewise.
244         * ctf-lookup.c (ctf_func_args): Likewise.
245         * ctf-open.c (upgrade_types): Cast to size_t where appropriate.
246         (ctf_bufopen): Likewise.  Use zlib types as needed.
247         * ctf-types.c (ctf_member_iter): Drop CTF_ERR usage for functions
248         returning int.
249         (ctf_enum_iter): Likewise.
250         (ctf_type_size): Likewise.
251         (ctf_type_align): Likewise.  Cast to size_t where appropriate.
252         (ctf_type_kind_unsliced): Likewise.
253         (ctf_type_kind): Likewise.
254         (ctf_type_encoding): Likewise.
255         (ctf_member_info): Likewise.
256         (ctf_array_info): Likewise.
257         (ctf_enum_value): Likewise.
258         (ctf_type_rvisit): Likewise.
259         * ctf-open-bfd.c (ctf_bfdopen): Drop cts_type, cts_flags and
260         cts_offset.
261         (ctf_simple_open): Likewise.
262         (ctf_bfdopen_ctfsect): Likewise.  Set cts_size properly.
263         * Makefile.in: Regenerate.
264         * aclocal.m4: Likewise.
265         * config.h: Likewise.
266         * configure: Likewise.
267
268 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
269
270         * configure.in: Check for bfd_section_from_elf_index.
271         * configure: Regenerate.
272         * config.h.in [HAVE_BFD_ELF]: Likewise.
273         * libctf/ctf_open_bfd (ctf_bfdopen_ctfsect): Use it.
274         abfd is potentially unused now.
275
276 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
277
278         * Makefile.am: New.
279         * Makefile.in: Regenerated.
280         * config.h.in: Likewise.
281         * aclocal.m4: Likewise.
282         * configure: Likewise.
283
284 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
285
286         * ctf-dump.c: New.
287
288 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
289
290         * ctf-labels.c: New.
291
292 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
293
294         * ctf-impl.h (_libctf_version): New declaration.
295         * ctf-subr.c (_libctf_version): Define it.
296         (ctf_version): New.
297
298 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
299
300         * ctf-create.c (enumcmp): New.
301         (enumadd): Likewise.
302         (membcmp): Likewise.
303         (membadd): Likewise.
304         (ctf_add_type): Likewise.
305
306 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
307
308         * ctf-lookup.c (isqualifier): New.
309         (ctf_lookup_by_name): Likewise.
310         (struct ctf_lookup_var_key): Likewise.
311         (ctf_lookup_var): Likewise.
312         (ctf_lookup_variable): Likewise.
313         (ctf_lookup_symbol_name): Likewise.
314         (ctf_lookup_by_symbol): Likewise.
315         (ctf_func_info): Likewise.
316         (ctf_func_args): Likewise.
317
318 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
319
320         * ctf-decl.c: New file.
321         * ctf-types.c: Likewise.
322         * ctf-impl.h: New declarations.
323
324 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
325
326         * ctf-open-bfd.c: New file.
327         * ctf-open.c (ctf_close): New.
328         * ctf-impl.h: Include bfd.h.
329         (ctf_file): New members ctf_data_mmapped, ctf_data_mmapped_len.
330         (ctf_archive_internal): New members ctfi_abfd, ctfi_data,
331         ctfi_bfd_close.
332         (ctf_bfdopen_ctfsect): New declaration.
333         (_CTF_SECTION): likewise.
334
335 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
336
337         * ctf-archive.c: New.
338         * ctf-impl.h (ctf_archive_internal): New type.
339         (ctf_arc_open_internal): New declaration.
340         (ctf_arc_bufopen): Likewise.
341         (ctf_arc_close_internal): Likewise.
342
343 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
344
345         * ctf-open.c: New file.
346         * swap.h: Likewise.
347
348 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
349
350         * ctf-create.c: New file.
351         * ctf-lookup.c: New file.
352
353 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
354
355         * ctf-impl.h: New definitions and declarations for type creation
356         and lookup.
357
358 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
359
360         * ctf-hash.c: New file.
361         * ctf-impl.h: New declarations.
362
363 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
364
365         * ctf-error.c: New file.
366
367 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
368
369         * ctf-util.c: New file.
370         * elf.h: Likewise.
371         * ctf-impl.h: Include it, and add declarations.
372
373 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
374
375         * ctf-impl.h: New file.
376         * ctf-subr.c: New file.
377
378 \f
379 Local Variables:
380 mode: change-log
381 left-margin: 8
382 fill-column: 76
383 version-control: never
384 End: