[PATCH 00/11] libctf: various portability fixes and small bugfixes

Nick Alcock nick.alcock@oracle.com
Mon Dec 16 22:54:00 GMT 2019


These deal with bug 25120 (a bunch of portability problems: elfcpp, used by
gold, contains the same problem so I fixed it there too), fix another bunch of
portability problems which appeared when binutils libctf hit the FreeBSD ports
tree, and fix a bunch of problems with forwards which emerged during the
development of the CTF-deduplicating linker and during ongoing testing of the
non-deduplicating linker.

It also finally gets --disable-libctf working (this bit is an older patch
that I simply never got around to pushing, and has been reviewed already:
it has a GDB portion which needed some changes and has been posted to
the GDB list already).

There's also one small feature addition: like objdump, readelf can now view .ctf
sections that contain CTF archives, and knows how the linker structures these
(with a .ctf member that is the parent of all the other members).  Since the
linker emits these whenever conflicting types with the same name are encountered
in a single program, without this capability there are lots of programs that
objdump --ctf can view but readelf --ctf=.ctf claims is a corrupted file.
This required a small API addition to libctf to open CTF archives from already-
read memory buffers while specifying string and symbol tables.

The libiberty and binutils bits outside the first patch in the series have not
appeared here before and need review.

Nick Alcock (11):
  binutils, ld: work with --disable-libctf
  libctf: create: non-root-visible types should not appear in name
    tables
  libctf: create: don't add forwards if the type added already exists
  libctf: create: ctf_add_type should hand back already-added non-SoUs
  libctf: create: forwards are always in the namespace of their referent
  libctf, binutils: support CTF archives like objdump
  libiberty, include, libctf: Use bsearch_r to avoid nonportable
    __thread
  libctf: work with compilers not supporting GNU C attributes
  libctf, elfcpp, gold: do not assume that <byteswap.h> contains bswap_*
  libctf: add some missing #includes.
  libctf: support platforms with separate libintl

 binutils/ChangeLog       |  35 ++++++++
 binutils/Makefile.am     |   5 ++
 binutils/Makefile.in     |   9 ++-
 binutils/aclocal.m4      |   1 +
 binutils/config.in       |   3 +
 binutils/configure       |  39 ++++++++-
 binutils/configure.ac    |   6 ++
 binutils/doc/Makefile.in |   1 +
 binutils/objdump.c       |  27 ++++++-
 binutils/readelf.c       | 118 +++++++++++++++++++--------
 elfcpp/ChangeLog         |  10 +++
 elfcpp/elfcpp_swap.h     |  16 ++--
 gold/ChangeLog           |   7 ++
 gold/config.in           |  12 +++
 gold/configure           | 127 ++++++++++++++++++-----------
 gold/configure.ac        |   3 +
 include/ChangeLog        |   9 +++
 include/ctf-api.h        |   4 +
 include/libiberty.h      |   7 ++
 ld/ChangeLog             |  30 +++++++
 ld/Makefile.am           |   4 +
 ld/Makefile.in           |   5 +-
 ld/aclocal.m4            |   1 +
 ld/config.in             |   3 +
 ld/configure             |  42 +++++++++-
 ld/configure.ac          |   9 +++
 ld/ldelfgen.c            |  14 ++++
 ld/ldlang.c              |  35 ++++++++
 libctf/ChangeLog         |  52 ++++++++++++
 libctf/Makefile.in       |  19 ++++-
 libctf/aclocal.m4        |   3 +-
 libctf/config.h.in       |  16 ++++
 libctf/configure         | 167 ++++++++++++++++++++++++++++++++++++++-
 libctf/configure.ac      |   4 +
 libctf/ctf-archive.c     |  93 ++++++++++++++++------
 libctf/ctf-create.c      |  49 ++++++++----
 libctf/ctf-impl.h        |  15 +++-
 libctf/ctf-open-bfd.c    |  69 ++--------------
 libctf/ctf-open.c        |  37 +++++++--
 libctf/libctf.ver        |   1 +
 libctf/swap.h            |  16 ++--
 libiberty/ChangeLog      |   8 ++
 libiberty/Makefile.in    |  12 ++-
 libiberty/bsearch_r.c    |  92 +++++++++++++++++++++
 44 files changed, 1016 insertions(+), 219 deletions(-)
 create mode 100644 libiberty/bsearch_r.c

-- 
2.24.1.242.gb57e918ca5



More information about the Binutils mailing list