PR24689 again, string table corruption
[external/binutils.git] / libctf / ChangeLog
1 2019-06-19  Nick Alcock <nick.alcock@oracle.com>
2
3         * ctf-open-bfd.c: Add swap.h and ctf-endian.h.
4         (ctf_fdopen): Check for endian-swapped raw CTF magic, and
5         little-endian CTF archive magic.  Do not check the CTF version:
6         ctf_simple_open does that in endian-safe ways.  Do not dereference
7         null pointers on open failure.
8
9 2019-06-19  Nick Alcock <nick.alcock@oracle.com>
10
11         * ctf-open.c (get_vbytes_common): Return the new slice size.
12         (ctf_bufopen): Flip the endianness of the CTF-section header copy.
13         Remember to copy in the CTF data when opening an uncompressed
14         foreign-endian CTF file.  Prune useless variable manipulation.
15
16 2019-06-19  Nick Alcock <nick.alcock@oracle.com>
17
18         * ctf-open.c (ctf_types): Fail when unidentified type kinds are
19         seen.
20
21 2019-06-19  Nick Alcock <nick.alcock@oracle.com>
22
23         * ctf-open.c (ctf_bufopen): Dump header offsets into the debugging
24         output.
25
26 2019-06-19  Nick Alcock <nick.alcock@oracle.com>
27
28         * ctf-subr.c (_PAGESIZE): Remove.
29         (ctf_data_alloc): Likewise.
30         (ctf_data_free): Likewise.
31         (ctf_data_protect): Likewise.
32         * ctf-impl.h: Remove declarations.
33         * ctf-create.c (ctf_update): No longer call ctf_data_protect: use
34         ctf_free, not ctf_data_free.
35         (ctf_compress_write): Use ctf_data_alloc, not ctf_alloc.  Free
36         the buffer again on compression error.
37         * ctf-open.c (ctf_set_base): No longer track the size: call
38         ctf_free, not ctf_data_free.
39         (upgrade_types): Likewise.  Call ctf_alloc, not ctf_data_alloc.
40         (ctf_bufopen): Likewise.  No longer call ctf_data_protect.
41
42 2019-06-19  Nick Alcock <nick.alcock@oracle.com>
43
44         * ctf-create.c (ctf_dtd_insert): Pass on error returns from
45         ctf_dynhash_insert.
46         (ctf_dvd_insert): Likewise.
47         (ctf_add_generic): Likewise.
48         (ctf_add_variable): Likewise.
49         * ctf-impl.h: Adjust declarations.
50
51 2019-06-14  Alan Modra  <amodra@gmail.com>
52
53         * configure: Regenerate.
54
55 2019-06-06  Nick Alcock  <nick.alcock@oracle.com>
56
57         * ctf-decls.h: Include <libiberty.h>.
58         * ctf-lookup.c (ctf_lookup_by_name): Call xstrndup(), not strndup().
59
60 2019-06-06  Nick Alcock  <nick.alcock@oracle.com>
61
62         * ctf-dump.c (ctf_dump_format_type): Cast size_t's used in printf()s.
63         (ctf_dump_objts): Likewise.
64         (ctf_dump_funcs): Likewise.
65         (ctf_dump_member): Likewise.
66         (ctf_dump_str): Likewise.
67
68 2019-06-06  Nick Alcock  <nick.alcock@oracle.com>
69
70         * ctf-archive.c (arc_mmap_header): Mark fd as potentially unused.
71         * ctf-subr.c (ctf_data_protect): Mark both args as potentially unused.
72
73 2019-06-05  Nick Alcock  <nick.alcock@oracle.com>
74
75         * ctf-archive.c (ctf_arc_write): Eschew %zi format specifier.
76         (ctf_arc_open_by_offset): Likewise.
77         * ctf-create.c (ctf_add_type): Likewise.
78
79 2019-06-04  Tom Tromey  <tromey@adacore.com>
80
81         * ctf-create.c (ctf_add_encoded, ctf_add_slice)
82         (ctf_add_member_offset): Use CHAR_BIT, not NBBY.
83
84 2019-06-04  Nick Alcock  <nick.alcock@oracle.com>
85
86         * configure.ac: Check for O_CLOEXEC.
87         * ctf-decls.h (O_CLOEXEC): Define (to 0), if need be.
88         * config.h.in: Regenerate.
89         * configure: Likewise.
90
91 2019-06-04  Nick Alcock  <nick.alcock@oracle.com>
92
93         * qsort_r.c: Rename to...
94         * ctf-qsort_r.c: ... this.
95         (_quicksort): Define to ctf_qsort_r.
96         * ctf-decls.h (qsort_r): Remove.
97         (ctf_qsort_r): Add.
98         (struct ctf_qsort_arg): New, transport the real ARG and COMPAR.
99         (ctf_qsort_compar_thunk): Rearrange the arguments to COMPAR.
100         * Makefile.am (libctf_a_LIBADD): Remove.
101         (libctf_a_SOURCES): New, add ctf-qsort_r.c.
102         * ctf-archive.c (ctf_arc_write): Call ctf_qsort_r, not qsort_r.
103         * ctf-create.c (ctf_update): Likewise.
104         * configure.ac: Check for BSD versus GNU qsort_r signature.
105         * Makefile.in: Regenerate.
106         * config.h.in: Likewise.
107         * configure: Likewise.
108
109 2019-06-03  Nick Alcock  <nick.alcock@oracle.com>
110
111         * ctf-dump.c (ctf_dump_funcs): Free in the right place.
112
113 2019-05-29  Nick Alcock  <nick.alcock@oracle.com>
114
115         * Makefile.am (ZLIB): New.
116         (ZLIBINC): Likewise.
117         (AM_CFLAGS): Use them.
118         (libctf_a_LIBADD): New, for LIBOBJS.
119         * configure.ac: Check for zlib, endian.h, and qsort_r.
120         * ctf-endian.h: New, providing htole64 and le64toh.
121         * swap.h: Code style fixes.
122         (bswap_identity_64): New.
123         * qsort_r.c: New, from gnulib (with one added #include).
124         * ctf-decls.h: New, providing a conditional qsort_r declaration,
125         and unconditional definitions of MIN and MAX.
126         * ctf-impl.h: Use it.  Do not use <sys/errno.h>.
127         (ctf_set_errno): Now returns unsigned long.
128         * ctf-util.c (ctf_set_errno): Adjust here too.
129         * ctf-archive.c: Use ctf-endian.h.
130         (ctf_arc_open_by_offset): Use memset, not bzero.  Drop cts_type,
131         cts_flags and cts_offset.
132         (ctf_arc_write): Drop debugging dependent on the size of off_t.
133         * ctf-create.c: Provide a definition of roundup if not defined.
134         (ctf_create): Drop cts_type, cts_flags and cts_offset.
135         (ctf_add_reftype): Do not check if type IDs are below zero.
136         (ctf_add_slice): Likewise.
137         (ctf_add_typedef): Likewise.
138         (ctf_add_member_offset): Cast error-returning ssize_t's to size_t
139         when known error-free.  Drop CTF_ERR usage for functions returning
140         int.
141         (ctf_add_member_encoded): Drop CTF_ERR usage for functions returning
142         int.
143         (ctf_add_variable): Likewise.
144         (enumcmp): Likewise.
145         (enumadd): Likewise.
146         (membcmp): Likewise.
147         (ctf_add_type): Likewise.  Cast error-returning ssize_t's to size_t
148         when known error-free.
149         * ctf-dump.c (ctf_is_slice): Drop CTF_ERR usage for functions
150         returning int: use CTF_ERR for functions returning ctf_type_id.
151         (ctf_dump_label): Likewise.
152         (ctf_dump_objts): Likewise.
153         * ctf-labels.c (ctf_label_topmost): Likewise.
154         (ctf_label_iter): Likewise.
155         (ctf_label_info): Likewise.
156         * ctf-lookup.c (ctf_func_args): Likewise.
157         * ctf-open.c (upgrade_types): Cast to size_t where appropriate.
158         (ctf_bufopen): Likewise.  Use zlib types as needed.
159         * ctf-types.c (ctf_member_iter): Drop CTF_ERR usage for functions
160         returning int.
161         (ctf_enum_iter): Likewise.
162         (ctf_type_size): Likewise.
163         (ctf_type_align): Likewise.  Cast to size_t where appropriate.
164         (ctf_type_kind_unsliced): Likewise.
165         (ctf_type_kind): Likewise.
166         (ctf_type_encoding): Likewise.
167         (ctf_member_info): Likewise.
168         (ctf_array_info): Likewise.
169         (ctf_enum_value): Likewise.
170         (ctf_type_rvisit): Likewise.
171         * ctf-open-bfd.c (ctf_bfdopen): Drop cts_type, cts_flags and
172         cts_offset.
173         (ctf_simple_open): Likewise.
174         (ctf_bfdopen_ctfsect): Likewise.  Set cts_size properly.
175         * Makefile.in: Regenerate.
176         * aclocal.m4: Likewise.
177         * config.h: Likewise.
178         * configure: Likewise.
179
180 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
181
182         * configure.in: Check for bfd_section_from_elf_index.
183         * configure: Regenerate.
184         * config.h.in [HAVE_BFD_ELF]: Likewise.
185         * libctf/ctf_open_bfd (ctf_bfdopen_ctfsect): Use it.
186         abfd is potentially unused now.
187
188 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
189
190         * Makefile.am: New.
191         * Makefile.in: Regenerated.
192         * config.h.in: Likewise.
193         * aclocal.m4: Likewise.
194         * configure: Likewise.
195
196 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
197
198         * ctf-dump.c: New.
199
200 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
201
202         * ctf-labels.c: New.
203
204 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
205
206         * ctf-impl.h (_libctf_version): New declaration.
207         * ctf-subr.c (_libctf_version): Define it.
208         (ctf_version): New.
209
210 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
211
212         * ctf-create.c (enumcmp): New.
213         (enumadd): Likewise.
214         (membcmp): Likewise.
215         (membadd): Likewise.
216         (ctf_add_type): Likewise.
217
218 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
219
220         * ctf-lookup.c (isqualifier): New.
221         (ctf_lookup_by_name): Likewise.
222         (struct ctf_lookup_var_key): Likewise.
223         (ctf_lookup_var): Likewise.
224         (ctf_lookup_variable): Likewise.
225         (ctf_lookup_symbol_name): Likewise.
226         (ctf_lookup_by_symbol): Likewise.
227         (ctf_func_info): Likewise.
228         (ctf_func_args): Likewise.
229
230 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
231
232         * ctf-decl.c: New file.
233         * ctf-types.c: Likewise.
234         * ctf-impl.h: New declarations.
235
236 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
237
238         * ctf-open-bfd.c: New file.
239         * ctf-open.c (ctf_close): New.
240         * ctf-impl.h: Include bfd.h.
241         (ctf_file): New members ctf_data_mmapped, ctf_data_mmapped_len.
242         (ctf_archive_internal): New members ctfi_abfd, ctfi_data,
243         ctfi_bfd_close.
244         (ctf_bfdopen_ctfsect): New declaration.
245         (_CTF_SECTION): likewise.
246
247 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
248
249         * ctf-archive.c: New.
250         * ctf-impl.h (ctf_archive_internal): New type.
251         (ctf_arc_open_internal): New declaration.
252         (ctf_arc_bufopen): Likewise.
253         (ctf_arc_close_internal): Likewise.
254
255 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
256
257         * ctf-open.c: New file.
258         * swap.h: Likewise.
259
260 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
261
262         * ctf-create.c: New file.
263         * ctf-lookup.c: New file.
264
265 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
266
267         * ctf-impl.h: New definitions and declarations for type creation
268         and lookup.
269
270 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
271
272         * ctf-hash.c: New file.
273         * ctf-impl.h: New declarations.
274
275 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
276
277         * ctf-error.c: New file.
278
279 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
280
281         * ctf-util.c: New file.
282         * elf.h: Likewise.
283         * ctf-impl.h: Include it, and add declarations.
284
285 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
286
287         * ctf-impl.h: New file.
288         * ctf-subr.c: New file.
289
290 \f
291 Local Variables:
292 mode: change-log
293 left-margin: 8
294 fill-column: 76
295 version-control: never
296 End: