Skip to content

Commit

Permalink
libctf, dedup: add deduplicator
Browse files Browse the repository at this point in the history
This adds the core deduplicator that the ctf_link machinery calls
(possibly repeatedly) to link the CTF sections: it takes an array
of input ctf_file_t's and another array that indicates which entries in
the input array are parents of which other entries, and returns an array
of outputs.  The first output is always the ctf_file_t on which
ctf_link/ctf_dedup/etc was called: the other outputs are child dicts
that have the first output as their parent.

include/
	* ctf-api.h (CTF_LINK_SHARE_DUPLICATED): No longer unimplemented.
libctf/
	* ctf-impl.h (ctf_type_id_key): New, the key in the
	cd_id_to_file_t.
	(ctf_dedup): New, core deduplicator state.
	(ctf_file_t) <ctf_dedup>: New.
	<ctf_dedup_atoms>: New.
	<ctf_dedup_atoms_alloc>: New.
	(ctf_hash_type_id_key): New prototype.
	(ctf_hash_eq_type_id_key): Likewise.
	(ctf_dedup_atoms_init): Likewise.
	* ctf-hash.c (ctf_hash_eq_type_id_key): New.
	(ctf_dedup_atoms_init): Likewise.
	* ctf-create.c (ctf_serialize): Adjusted.
	(ctf_add_encoded): No longer static.
	(ctf_add_reftype): Likewise.
	* ctf-open.c (ctf_file_close): Destroy the
	ctf_dedup_atoms_alloc.
	* ctf-dedup.c: New file.
        * ctf-decls.h [!HAVE_DECL_STPCPY]: Add prototype.
	* configure.ac: Check for stpcpy.
	* Makefile.am: Add it.
	* Makefile.in: Regenerate.
        * config.h.in: Regenerate.
        * configure: Regenerate.
  • Loading branch information
nickalcock committed Jul 22, 2020
1 parent a9b9870 commit 0f0c11f
Show file tree
Hide file tree
Showing 14 changed files with 3,401 additions and 24 deletions.
4 changes: 4 additions & 0 deletions include/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2020-07-22 Nick Alcock <[email protected]>

* ctf-api.h (CTF_LINK_SHARE_DUPLICATED): No longer unimplemented.

2020-07-22 Nick Alcock <[email protected]>

* ctf-api.h (ctf_link_variable_filter_t): New.
Expand Down
2 changes: 1 addition & 1 deletion include/ctf-api.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ typedef struct ctf_link_sym
/* Share all types that are not in conflict. The default. */
#define CTF_LINK_SHARE_UNCONFLICTED 0x0

/* Share only types that are used by multiple inputs. Not implemented yet. */
/* Share only types that are used by multiple inputs. */
#define CTF_LINK_SHARE_DUPLICATED 0x1

/* Create empty outputs for all registered CU mappings even if no types are
Expand Down
26 changes: 26 additions & 0 deletions libctf/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
2020-07-22 Nick Alcock <[email protected]>

* ctf-impl.h (ctf_type_id_key): New, the key in the
cd_id_to_file_t.
(ctf_dedup): New, core deduplicator state.
(ctf_file_t) <ctf_dedup>: New.
<ctf_dedup_atoms>: New.
<ctf_dedup_atoms_alloc>: New.
(ctf_hash_type_id_key): New prototype.
(ctf_hash_eq_type_id_key): Likewise.
(ctf_dedup_atoms_init): Likewise.
* ctf-hash.c (ctf_hash_eq_type_id_key): New.
(ctf_dedup_atoms_init): Likewise.
* ctf-create.c (ctf_serialize): Adjusted.
(ctf_add_encoded): No longer static.
(ctf_add_reftype): Likewise.
* ctf-open.c (ctf_file_close): Destroy the
ctf_dedup_atoms_alloc.
* ctf-dedup.c: New file.
* ctf-decls.h [!HAVE_DECL_STPCPY]: Add prototype.
* configure.ac: Check for stpcpy.
* Makefile.am: Add it.
* Makefile.in: Regenerate.
* config.h.in: Regenerate.
* configure: Regenerate.

2020-07-22 Nick Alcock <[email protected]>

* configure.ac: Add --enable-libctf-hash-debugging.
Expand Down
5 changes: 3 additions & 2 deletions libctf/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ libctf_nobfd_la_LIBADD = @SHARED_LIBADD@ $(ZLIB)
libctf_nobfd_la_LDFLAGS = -version-info 0:0:0 @SHARED_LDFLAGS@ @VERSION_FLAGS@
libctf_nobfd_la_CPPFLAGS = $(AM_CPPFLAGS) -DNOBFD=1
libctf_nobfd_la_SOURCES = ctf-archive.c ctf-dump.c ctf-create.c ctf-decl.c ctf-error.c \
ctf-hash.c ctf-labels.c ctf-link.c ctf-lookup.c ctf-open.c \
ctf-sha1.c ctf-string.c ctf-subr.c ctf-types.c ctf-util.c
ctf-hash.c ctf-labels.c ctf-dedup.c ctf-link.c ctf-lookup.c \
ctf-open.c ctf-sha1.c ctf-string.c ctf-subr.c ctf-types.c \
ctf-util.c
if NEED_CTF_QSORT_R
libctf_nobfd_la_SOURCES += ctf-qsort_r.c
endif
Expand Down
52 changes: 34 additions & 18 deletions libctf/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -166,18 +166,18 @@ am__DEPENDENCIES_1 =
libctf_nobfd_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
am__libctf_nobfd_la_SOURCES_DIST = ctf-archive.c ctf-dump.c \
ctf-create.c ctf-decl.c ctf-error.c ctf-hash.c ctf-labels.c \
ctf-link.c ctf-lookup.c ctf-open.c ctf-sha1.c ctf-string.c \
ctf-subr.c ctf-types.c ctf-util.c ctf-qsort_r.c
ctf-dedup.c ctf-link.c ctf-lookup.c ctf-open.c ctf-sha1.c \
ctf-string.c ctf-subr.c ctf-types.c ctf-util.c ctf-qsort_r.c
@NEED_CTF_QSORT_R_TRUE@am__objects_1 = libctf_nobfd_la-ctf-qsort_r.lo
am_libctf_nobfd_la_OBJECTS = libctf_nobfd_la-ctf-archive.lo \
libctf_nobfd_la-ctf-dump.lo libctf_nobfd_la-ctf-create.lo \
libctf_nobfd_la-ctf-decl.lo libctf_nobfd_la-ctf-error.lo \
libctf_nobfd_la-ctf-hash.lo libctf_nobfd_la-ctf-labels.lo \
libctf_nobfd_la-ctf-link.lo libctf_nobfd_la-ctf-lookup.lo \
libctf_nobfd_la-ctf-open.lo libctf_nobfd_la-ctf-sha1.lo \
libctf_nobfd_la-ctf-string.lo libctf_nobfd_la-ctf-subr.lo \
libctf_nobfd_la-ctf-types.lo libctf_nobfd_la-ctf-util.lo \
$(am__objects_1)
libctf_nobfd_la-ctf-dedup.lo libctf_nobfd_la-ctf-link.lo \
libctf_nobfd_la-ctf-lookup.lo libctf_nobfd_la-ctf-open.lo \
libctf_nobfd_la-ctf-sha1.lo libctf_nobfd_la-ctf-string.lo \
libctf_nobfd_la-ctf-subr.lo libctf_nobfd_la-ctf-types.lo \
libctf_nobfd_la-ctf-util.lo $(am__objects_1)
libctf_nobfd_la_OBJECTS = $(am_libctf_nobfd_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
Expand All @@ -191,18 +191,18 @@ libctf_nobfd_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
@INSTALL_LIBBFD_TRUE@am_libctf_nobfd_la_rpath = -rpath $(libdir)
am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1)
am__libctf_la_SOURCES_DIST = ctf-archive.c ctf-dump.c ctf-create.c \
ctf-decl.c ctf-error.c ctf-hash.c ctf-labels.c ctf-link.c \
ctf-lookup.c ctf-open.c ctf-sha1.c ctf-string.c ctf-subr.c \
ctf-types.c ctf-util.c ctf-qsort_r.c ctf-open-bfd.c
ctf-decl.c ctf-error.c ctf-hash.c ctf-labels.c ctf-dedup.c \
ctf-link.c ctf-lookup.c ctf-open.c ctf-sha1.c ctf-string.c \
ctf-subr.c ctf-types.c ctf-util.c ctf-qsort_r.c ctf-open-bfd.c
@NEED_CTF_QSORT_R_TRUE@am__objects_2 = libctf_la-ctf-qsort_r.lo
am__objects_3 = libctf_la-ctf-archive.lo libctf_la-ctf-dump.lo \
libctf_la-ctf-create.lo libctf_la-ctf-decl.lo \
libctf_la-ctf-error.lo libctf_la-ctf-hash.lo \
libctf_la-ctf-labels.lo libctf_la-ctf-link.lo \
libctf_la-ctf-lookup.lo libctf_la-ctf-open.lo \
libctf_la-ctf-sha1.lo libctf_la-ctf-string.lo \
libctf_la-ctf-subr.lo libctf_la-ctf-types.lo \
libctf_la-ctf-util.lo $(am__objects_2)
libctf_la-ctf-labels.lo libctf_la-ctf-dedup.lo \
libctf_la-ctf-link.lo libctf_la-ctf-lookup.lo \
libctf_la-ctf-open.lo libctf_la-ctf-sha1.lo \
libctf_la-ctf-string.lo libctf_la-ctf-subr.lo \
libctf_la-ctf-types.lo libctf_la-ctf-util.lo $(am__objects_2)
am_libctf_la_OBJECTS = $(am__objects_3) libctf_la-ctf-open-bfd.lo
libctf_la_OBJECTS = $(am_libctf_la_OBJECTS)
libctf_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
Expand Down Expand Up @@ -457,9 +457,9 @@ libctf_nobfd_la_LIBADD = @SHARED_LIBADD@ $(ZLIB)
libctf_nobfd_la_LDFLAGS = -version-info 0:0:0 @SHARED_LDFLAGS@ @VERSION_FLAGS@
libctf_nobfd_la_CPPFLAGS = $(AM_CPPFLAGS) -DNOBFD=1
libctf_nobfd_la_SOURCES = ctf-archive.c ctf-dump.c ctf-create.c \
ctf-decl.c ctf-error.c ctf-hash.c ctf-labels.c ctf-link.c \
ctf-lookup.c ctf-open.c ctf-sha1.c ctf-string.c ctf-subr.c \
ctf-types.c ctf-util.c $(am__append_1)
ctf-decl.c ctf-error.c ctf-hash.c ctf-labels.c ctf-dedup.c \
ctf-link.c ctf-lookup.c ctf-open.c ctf-sha1.c ctf-string.c \
ctf-subr.c ctf-types.c ctf-util.c $(am__append_1)
libctf_la_LIBADD = @BFD_LIBADD@ $(libctf_nobfd_la_LIBADD)
libctf_la_CPPFLAGS = $(AM_CPPFLAGS) -DNOBFD=0
libctf_la_DEPENDENCIES = @BFD_DEPENDENCIES@
Expand Down Expand Up @@ -581,6 +581,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libctf_la-ctf-archive.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libctf_la-ctf-create.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libctf_la-ctf-decl.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libctf_la-ctf-dedup.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libctf_la-ctf-dump.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libctf_la-ctf-error.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libctf_la-ctf-hash.Plo@am__quote@
Expand All @@ -598,6 +599,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libctf_nobfd_la-ctf-archive.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libctf_nobfd_la-ctf-create.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libctf_nobfd_la-ctf-decl.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libctf_nobfd_la-ctf-dedup.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libctf_nobfd_la-ctf-dump.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libctf_nobfd_la-ctf-error.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libctf_nobfd_la-ctf-hash.Plo@am__quote@
Expand Down Expand Up @@ -682,6 +684,13 @@ libctf_nobfd_la-ctf-labels.lo: ctf-labels.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libctf_nobfd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libctf_nobfd_la-ctf-labels.lo `test -f 'ctf-labels.c' || echo '$(srcdir)/'`ctf-labels.c

libctf_nobfd_la-ctf-dedup.lo: ctf-dedup.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libctf_nobfd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libctf_nobfd_la-ctf-dedup.lo -MD -MP -MF $(DEPDIR)/libctf_nobfd_la-ctf-dedup.Tpo -c -o libctf_nobfd_la-ctf-dedup.lo `test -f 'ctf-dedup.c' || echo '$(srcdir)/'`ctf-dedup.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libctf_nobfd_la-ctf-dedup.Tpo $(DEPDIR)/libctf_nobfd_la-ctf-dedup.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ctf-dedup.c' object='libctf_nobfd_la-ctf-dedup.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libctf_nobfd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libctf_nobfd_la-ctf-dedup.lo `test -f 'ctf-dedup.c' || echo '$(srcdir)/'`ctf-dedup.c

libctf_nobfd_la-ctf-link.lo: ctf-link.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libctf_nobfd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libctf_nobfd_la-ctf-link.lo -MD -MP -MF $(DEPDIR)/libctf_nobfd_la-ctf-link.Tpo -c -o libctf_nobfd_la-ctf-link.lo `test -f 'ctf-link.c' || echo '$(srcdir)/'`ctf-link.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libctf_nobfd_la-ctf-link.Tpo $(DEPDIR)/libctf_nobfd_la-ctf-link.Plo
Expand Down Expand Up @@ -794,6 +803,13 @@ libctf_la-ctf-labels.lo: ctf-labels.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libctf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libctf_la-ctf-labels.lo `test -f 'ctf-labels.c' || echo '$(srcdir)/'`ctf-labels.c

libctf_la-ctf-dedup.lo: ctf-dedup.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libctf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libctf_la-ctf-dedup.lo -MD -MP -MF $(DEPDIR)/libctf_la-ctf-dedup.Tpo -c -o libctf_la-ctf-dedup.lo `test -f 'ctf-dedup.c' || echo '$(srcdir)/'`ctf-dedup.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libctf_la-ctf-dedup.Tpo $(DEPDIR)/libctf_la-ctf-dedup.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ctf-dedup.c' object='libctf_la-ctf-dedup.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libctf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libctf_la-ctf-dedup.lo `test -f 'ctf-dedup.c' || echo '$(srcdir)/'`ctf-dedup.c

libctf_la-ctf-link.lo: ctf-link.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libctf_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libctf_la-ctf-link.lo -MD -MP -MF $(DEPDIR)/libctf_la-ctf-link.Tpo -c -o libctf_la-ctf-link.lo `test -f 'ctf-link.c' || echo '$(srcdir)/'`ctf-link.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libctf_la-ctf-link.Tpo $(DEPDIR)/libctf_la-ctf-link.Plo
Expand Down
4 changes: 4 additions & 0 deletions libctf/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
don't. */
#undef HAVE_DECL_BSWAP_64

/* Define to 1 if you have the declaration of `stpcpy', and to 0 if you don't.
*/
#undef HAVE_DECL_STPCPY

/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you
don't. */
#undef HAVE_DECL_VASPRINTF
Expand Down
10 changes: 10 additions & 0 deletions libctf/configure
Original file line number Diff line number Diff line change
Expand Up @@ -13186,6 +13186,16 @@ fi
cat >>confdefs.h <<_ACEOF
#define HAVE_DECL_VASPRINTF $ac_have_decl
_ACEOF
ac_fn_c_check_decl "$LINENO" "stpcpy" "ac_cv_have_decl_stpcpy" "$ac_includes_default"
if test "x$ac_cv_have_decl_stpcpy" = xyes; then :
ac_have_decl=1
else
ac_have_decl=0
fi
cat >>confdefs.h <<_ACEOF
#define HAVE_DECL_STPCPY $ac_have_decl
_ACEOF
Expand Down
2 changes: 1 addition & 1 deletion libctf/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ AC_CHECK_FUNCS(pread)

dnl Check for bswap_{16,32,64}
AC_CHECK_DECLS([bswap_16, bswap_32, bswap_64], [], [], [[#include <byteswap.h>]])
AC_CHECK_DECLS([asprintf, vasprintf])
AC_CHECK_DECLS([asprintf, vasprintf, stpcpy])

dnl Check for qsort_r. (Taken from gnulib.)
AC_CHECK_FUNCS_ONCE([qsort_r])
Expand Down
10 changes: 8 additions & 2 deletions libctf/ctf-create.c
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,9 @@ ctf_serialize (ctf_file_t *fp)
nfp->ctf_link_variable_filter = fp->ctf_link_variable_filter;
nfp->ctf_link_variable_filter_arg = fp->ctf_link_variable_filter_arg;
nfp->ctf_link_flags = fp->ctf_link_flags;
nfp->ctf_dedup_atoms = fp->ctf_dedup_atoms;
nfp->ctf_dedup_atoms_alloc = fp->ctf_dedup_atoms_alloc;
memcpy (&nfp->ctf_dedup, &fp->ctf_dedup, sizeof (fp->ctf_dedup));

nfp->ctf_snapshot_lu = fp->ctf_snapshots;

Expand All @@ -571,11 +574,14 @@ ctf_serialize (ctf_file_t *fp)
fp->ctf_link_in_cu_mapping = NULL;
fp->ctf_link_out_cu_mapping = NULL;
fp->ctf_link_type_mapping = NULL;
fp->ctf_dedup_atoms = NULL;
fp->ctf_dedup_atoms_alloc = NULL;
fp->ctf_parent_unreffed = 1;

fp->ctf_dvhash = NULL;
memset (&fp->ctf_dvdefs, 0, sizeof (ctf_list_t));
memset (fp->ctf_lookups, 0, sizeof (fp->ctf_lookups));
memset (&fp->ctf_dedup, 0, sizeof (fp->ctf_dedup));
fp->ctf_structs.ctn_writable = NULL;
fp->ctf_unions.ctn_writable = NULL;
fp->ctf_enums.ctn_writable = NULL;
Expand Down Expand Up @@ -878,7 +884,7 @@ clp2 (size_t x)
return (x + 1);
}

static ctf_id_t
ctf_id_t
ctf_add_encoded (ctf_file_t *fp, uint32_t flag,
const char *name, const ctf_encoding_t *ep, uint32_t kind)
{
Expand All @@ -899,7 +905,7 @@ ctf_add_encoded (ctf_file_t *fp, uint32_t flag,
return type;
}

static ctf_id_t
ctf_id_t
ctf_add_reftype (ctf_file_t *fp, uint32_t flag, ctf_id_t ref, uint32_t kind)
{
ctf_dtdef_t *dtd;
Expand Down
4 changes: 4 additions & 0 deletions libctf/ctf-decls.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,8 @@ void ctf_qsort_r (void *base, size_t nmemb, size_t size,
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))

#if !HAVE_DECL_STPCPY
extern char *stpcpy (char *, const char *);
#endif

#endif /* _CTF_DECLS_H */
Loading

0 comments on commit 0f0c11f

Please sign in to comment.