libctf: fix use-after-free in function dumping
[external/binutils.git] / libctf / ChangeLog
1 2019-06-03  Nick Alcock  <nick.alcock@oracle.com>
2
3         * ctf-dump.c (ctf_dump_funcs): Free in the right place.
4
5 2019-05-29  Nick Alcock  <nick.alcock@oracle.com>
6
7         * Makefile.am (ZLIB): New.
8         (ZLIBINC): Likewise.
9         (AM_CFLAGS): Use them.
10         (libctf_a_LIBADD): New, for LIBOBJS.
11         * configure.ac: Check for zlib, endian.h, and qsort_r.
12         * ctf-endian.h: New, providing htole64 and le64toh.
13         * swap.h: Code style fixes.
14         (bswap_identity_64): New.
15         * qsort_r.c: New, from gnulib (with one added #include).
16         * ctf-decls.h: New, providing a conditional qsort_r declaration,
17         and unconditional definitions of MIN and MAX.
18         * ctf-impl.h: Use it.  Do not use <sys/errno.h>.
19         (ctf_set_errno): Now returns unsigned long.
20         * ctf-util.c (ctf_set_errno): Adjust here too.
21         * ctf-archive.c: Use ctf-endian.h.
22         (ctf_arc_open_by_offset): Use memset, not bzero.  Drop cts_type,
23         cts_flags and cts_offset.
24         (ctf_arc_write): Drop debugging dependent on the size of off_t.
25         * ctf-create.c: Provide a definition of roundup if not defined.
26         (ctf_create): Drop cts_type, cts_flags and cts_offset.
27         (ctf_add_reftype): Do not check if type IDs are below zero.
28         (ctf_add_slice): Likewise.
29         (ctf_add_typedef): Likewise.
30         (ctf_add_member_offset): Cast error-returning ssize_t's to size_t
31         when known error-free.  Drop CTF_ERR usage for functions returning
32         int.
33         (ctf_add_member_encoded): Drop CTF_ERR usage for functions returning
34         int.
35         (ctf_add_variable): Likewise.
36         (enumcmp): Likewise.
37         (enumadd): Likewise.
38         (membcmp): Likewise.
39         (ctf_add_type): Likewise.  Cast error-returning ssize_t's to size_t
40         when known error-free.
41         * ctf-dump.c (ctf_is_slice): Drop CTF_ERR usage for functions
42         returning int: use CTF_ERR for functions returning ctf_type_id.
43         (ctf_dump_label): Likewise.
44         (ctf_dump_objts): Likewise.
45         * ctf-labels.c (ctf_label_topmost): Likewise.
46         (ctf_label_iter): Likewise.
47         (ctf_label_info): Likewise.
48         * ctf-lookup.c (ctf_func_args): Likewise.
49         * ctf-open.c (upgrade_types): Cast to size_t where appropriate.
50         (ctf_bufopen): Likewise.  Use zlib types as needed.
51         * ctf-types.c (ctf_member_iter): Drop CTF_ERR usage for functions
52         returning int.
53         (ctf_enum_iter): Likewise.
54         (ctf_type_size): Likewise.
55         (ctf_type_align): Likewise.  Cast to size_t where appropriate.
56         (ctf_type_kind_unsliced): Likewise.
57         (ctf_type_kind): Likewise.
58         (ctf_type_encoding): Likewise.
59         (ctf_member_info): Likewise.
60         (ctf_array_info): Likewise.
61         (ctf_enum_value): Likewise.
62         (ctf_type_rvisit): Likewise.
63         * ctf-open-bfd.c (ctf_bfdopen): Drop cts_type, cts_flags and
64         cts_offset.
65         (ctf_simple_open): Likewise.
66         (ctf_bfdopen_ctfsect): Likewise.  Set cts_size properly.
67         * Makefile.in: Regenerate.
68         * aclocal.m4: Likewise.
69         * config.h: Likewise.
70         * configure: Likewise.
71
72 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
73
74         * configure.in: Check for bfd_section_from_elf_index.
75         * configure: Regenerate.
76         * config.h.in [HAVE_BFD_ELF]: Likewise.
77         * libctf/ctf_open_bfd (ctf_bfdopen_ctfsect): Use it.
78         abfd is potentially unused now.
79
80 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
81
82         * Makefile.am: New.
83         * Makefile.in: Regenerated.
84         * config.h.in: Likewise.
85         * aclocal.m4: Likewise.
86         * configure: Likewise.
87
88 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
89
90         * ctf-dump.c: New.
91
92 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
93
94         * ctf-labels.c: New.
95
96 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
97
98         * ctf-impl.h (_libctf_version): New declaration.
99         * ctf-subr.c (_libctf_version): Define it.
100         (ctf_version): New.
101
102 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
103
104         * ctf-create.c (enumcmp): New.
105         (enumadd): Likewise.
106         (membcmp): Likewise.
107         (membadd): Likewise.
108         (ctf_add_type): Likewise.
109
110 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
111
112         * ctf-lookup.c (isqualifier): New.
113         (ctf_lookup_by_name): Likewise.
114         (struct ctf_lookup_var_key): Likewise.
115         (ctf_lookup_var): Likewise.
116         (ctf_lookup_variable): Likewise.
117         (ctf_lookup_symbol_name): Likewise.
118         (ctf_lookup_by_symbol): Likewise.
119         (ctf_func_info): Likewise.
120         (ctf_func_args): Likewise.
121
122 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
123
124         * ctf-decl.c: New file.
125         * ctf-types.c: Likewise.
126         * ctf-impl.h: New declarations.
127
128 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
129
130         * ctf-open-bfd.c: New file.
131         * ctf-open.c (ctf_close): New.
132         * ctf-impl.h: Include bfd.h.
133         (ctf_file): New members ctf_data_mmapped, ctf_data_mmapped_len.
134         (ctf_archive_internal): New members ctfi_abfd, ctfi_data,
135         ctfi_bfd_close.
136         (ctf_bfdopen_ctfsect): New declaration.
137         (_CTF_SECTION): likewise.
138
139 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
140
141         * ctf-archive.c: New.
142         * ctf-impl.h (ctf_archive_internal): New type.
143         (ctf_arc_open_internal): New declaration.
144         (ctf_arc_bufopen): Likewise.
145         (ctf_arc_close_internal): Likewise.
146
147 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
148
149         * ctf-open.c: New file.
150         * swap.h: Likewise.
151
152 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
153
154         * ctf-create.c: New file.
155         * ctf-lookup.c: New file.
156
157 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
158
159         * ctf-impl.h: New definitions and declarations for type creation
160         and lookup.
161
162 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
163
164         * ctf-hash.c: New file.
165         * ctf-impl.h: New declarations.
166
167 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
168
169         * ctf-error.c: New file.
170
171 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
172
173         * ctf-util.c: New file.
174         * elf.h: Likewise.
175         * ctf-impl.h: Include it, and add declarations.
176
177 2019-05-28  Nick Alcock  <nick.alcock@oracle.com>
178
179         * ctf-impl.h: New file.
180         * ctf-subr.c: New file.
181
182 \f
183 Local Variables:
184 mode: change-log
185 left-margin: 8
186 fill-column: 76
187 version-control: never
188 End: