[PATCH libctf 00/11] enumerator query API, plus some bugfixes
Nick Alcock
nick.alcock@oracle.com
Thu Jun 13 18:54:19 GMT 2024
This series is largely the addition of new query APIs for enumerators
(proposed on this list a few weeks ago, then radically rethought by
others into a much better design), plus a bunch of fixes for bugs
found in the process. We also improve the deduplicator to consider
enums to be conflicting types if they are distinct but have enumeration
constants in common, and adapt ctf_add_enumerator() to prohibit the
addition of such enumerators (which are invalid C anyway, so anything
trying to add them is probably buggy).
The most series of the bugs fixed at the same time is a strtab
corruption bug observed if you add enums or structure members to a dict
you opened with ctf_open(): such dicts were read-only until only a few
weeks ago, so this bug has probably been caught before it could do any
damage!
(There are also new tests for this stuff: in fact the new test for
the enumerator API trips most of these bugs itself.)
I'll push tomorrow if nobody has any comments.
Nick Alcock (11):
libctf: strtab corruption when strings are added to ctf_open()ed dicts
include: fix libctf ECTF_NOENUMNAM error message
libctf: doc: fix ctf_stype_t typedef string in spec
libctf: dedup: enums with overlapping enumerators are conflicting
libctf: don't leak enums if ctf_add_type fails
libctf: fix dict leak on archive-wide symbol lookup error path
libctf: suppress spurious failure of malloc-counting tests under
valgrind
libctf: prohibit addition of enums with overlapping enumerator
constants
libctf: make the ctf_next ctn_fp non-const
include: libctf: comment improvements
libctf, include: new functions for looking up enumerators
include/ctf-api.h | 59 +++++-
ld/testsuite/ld-ctf/enum-3.c | 3 +
ld/testsuite/ld-ctf/enum-4.c | 3 +
ld/testsuite/ld-ctf/overlapping-enums-2.d | 36 ++++
ld/testsuite/ld-ctf/overlapping-enums.d | 35 ++++
libctf/config.h.in | 3 +
libctf/configure | 2 +-
libctf/configure.ac | 2 +-
libctf/ctf-archive.c | 108 +++++++++++
libctf/ctf-create.c | 48 ++++-
libctf/ctf-dedup.c | 42 ++++-
libctf/ctf-hash.c | 6 +
libctf/ctf-impl.h | 28 +--
libctf/ctf-lookup.c | 145 +++++++++++++++
libctf/ctf-open.c | 134 ++++++++++++--
libctf/ctf-string.c | 2 +
libctf/ctf-util.c | 29 ++-
libctf/doc/ctf-spec.texi | 2 +-
libctf/libctf.ver | 7 +
libctf/testsuite/lib/ctf-lib.exp | 5 +
libctf/testsuite/libctf-lookup/enum-ctf-2.c | 6 +
.../libctf-lookup/enumerator-iteration.c | 168 ++++++++++++++++++
.../libctf-lookup/enumerator-iteration.lk | 17 ++
.../libctf-regression/open-error-free.c | 13 ++
24 files changed, 849 insertions(+), 54 deletions(-)
create mode 100644 ld/testsuite/ld-ctf/enum-3.c
create mode 100644 ld/testsuite/ld-ctf/enum-4.c
create mode 100644 ld/testsuite/ld-ctf/overlapping-enums-2.d
create mode 100644 ld/testsuite/ld-ctf/overlapping-enums.d
create mode 100644 libctf/testsuite/libctf-lookup/enum-ctf-2.c
create mode 100644 libctf/testsuite/libctf-lookup/enumerator-iteration.c
create mode 100644 libctf/testsuite/libctf-lookup/enumerator-iteration.lk
--
2.45.1.275.g567cb0950c
More information about the Binutils
mailing list