[PATCH 00/13] CTF dumper improvements, a lookup testsuite, and bugfixes

Nick Alcock nick.alcock@oracle.com
Fri Dec 18 19:51:34 GMT 2020


This patch series accumulates a bunch of related work, mostly bugfixes tied
together by the fact that I couldn't do them without a testsuite to test the
lookup side of libctf used by CTF consumers (the ctf_type_*, ctf_arc_* and
ctf_open API).  The dedup machinery used by the linker uses a lot of the
lookup code, but that's not enough to probe specific fixes.

There are also some improvements to the look-and-feel of the output from the
CTF dumper used by objdump and readelf, and additions to the information
dumped (notably, enumerands and their values are dumped now).

The only potentially contentious changes are an API change adding a flags
arg to ctf_member_next (whose API is still changeable since it hasn't been
in a release yet), and the banning with a new ECTF_INCOMPLETE error of
attempts to get the size or alignment of a forward and of attempts to make
arrays with forwards as elements.

The 'new testsuite' commit needs a little review, since it touches the top
level Makefile.def.  The testsuite also introduces new burdens on libctf's
build system, since, even on non-ELF platforms, it links test programs
against the built libctf and then runs them (on the host), so as a result
libctf now needs to be self-contained enough for linking with -lctf with
libtool to work.  (I've spotted and fixed several problems in this area, but
more may lurk.  They only affect make libctf-check, not building.)

I'll also be putting in one commit omitted here because it entirely consists
of changes to a past ChangeLog entry:

-       * libctf/ctf_open_bfd (ctf_bfdopen_ctfsect): Use it.
+       * ctf-open-bfd.c (ctf_bfdopen_ctfsect): Use it.


Because this involved build system changes, I tested it more than usual:
with builds and make check-libctf check-ld on x86_64-pc-linux-gnu,
sparc64-unknown-linux-gnu, x86_64-unknown-freebsd-12.2, and 64-bit Cygwin
native builds and crosses to mingw32 and mingw64 hosts and
x86_64-pc-linux-gnu targets; with --enable-targets=all, all combinations of
-enable/--disable-static and -shared, and --disable-nls. GDB currently
doesn't build with --disable-static but everything else seems happy.

The biggest hole in my test matrix right now is Mach-O, but that doesn't
seem to be easily visible remotely and I don't have any Apple hardware
myself.

Nick Alcock (13):
  libctf: do not print array declarators backwards
  libctf, ld: CTF dumper changes for consistency
  libctf, ld: more dumper improvements
  libctf, ld: prohibit doing things with forwards prohibited in C
  libctf, ld: dump enums: generally improve dump formatting
  libctf: rip out BFD_DEPENDENCIES / BFD_LIBADD
  libctf: new testsuite
  libctf: new test of enum lookups with the _next iterator
  libctf: warn about information loss because of unreleased format
    changes
  libctf, include: support unnamed structure members better
  libctf: remove outdated comment about parent dict importing
  libctf: fix lookups of pointers by name in parent dicts
  libctf, ld: fix formatting of forwards to unions and enums

-- 
2.29.2.250.g8336e49d6f.dirty



More information about the Binutils mailing list