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