From 7db423d69273644d3be2a65a48a67b9e0cfb0147 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Thu, 10 Feb 2022 15:32:23 -0500 Subject: [PATCH] libctf: Rip out CTFv1 support CTFv1 was obsolete before libctf was imported into FreeBSD, and ctfconvert/ctfmerge can emit only CTFv2. Make ctf.h a bit easier to maintain by ripping v1 support out. No functional change intended. MFC after: 1 week Sponsored by: The FreeBSD Foundation --- .../contrib/opensolaris/common/ctf/ctf_open.c | 36 +------------------ 1 file changed, 1 insertion(+), 35 deletions(-) diff --git a/cddl/contrib/opensolaris/common/ctf/ctf_open.c b/cddl/contrib/opensolaris/common/ctf/ctf_open.c index 001cf5c5910..d64337a68bf 100644 --- a/cddl/contrib/opensolaris/common/ctf/ctf_open.c +++ b/cddl/contrib/opensolaris/common/ctf/ctf_open.c @@ -44,36 +44,18 @@ const char _CTF_NULLSTR[] = ""; int _libctf_version = CTF_VERSION; /* library client version */ int _libctf_debug = 0; /* debugging messages enabled */ -static ushort_t -get_kind_v1(ushort_t info) -{ - return (CTF_INFO_KIND_V1(info)); -} - static ushort_t get_kind_v2(ushort_t info) { return (CTF_INFO_KIND(info)); } -static ushort_t -get_root_v1(ushort_t info) -{ - return (CTF_INFO_ISROOT_V1(info)); -} - static ushort_t get_root_v2(ushort_t info) { return (CTF_INFO_ISROOT(info)); } -static ushort_t -get_vlen_v1(ushort_t info) -{ - return (CTF_INFO_VLEN_V1(info)); -} - static ushort_t get_vlen_v2(ushort_t info) { @@ -82,7 +64,7 @@ get_vlen_v2(ushort_t info) static const ctf_fileops_t ctf_fileops[] = { { NULL, NULL }, - { get_kind_v1, get_root_v1, get_vlen_v1 }, + { NULL, NULL }, { get_kind_v2, get_root_v2, get_vlen_v2 }, }; @@ -588,22 +570,6 @@ ctf_bufopen(const ctf_sect_t *ctfsect, const ctf_sect_t *symsect, bcopy(ctfsect->cts_data, &hp, sizeof (hp)); hdrsz = sizeof (ctf_header_t); - } else if (pp->ctp_version == CTF_VERSION_1) { - const ctf_header_v1_t *h1p = - (const ctf_header_v1_t *)ctfsect->cts_data; - - if (ctfsect->cts_size < sizeof (ctf_header_v1_t)) - return (ctf_set_open_errno(errp, ECTF_NOCTFBUF)); - - bzero(&hp, sizeof (hp)); - hp.cth_preamble = h1p->cth_preamble; - hp.cth_objtoff = h1p->cth_objtoff; - hp.cth_funcoff = h1p->cth_funcoff; - hp.cth_typeoff = h1p->cth_typeoff; - hp.cth_stroff = h1p->cth_stroff; - hp.cth_strlen = h1p->cth_strlen; - - hdrsz = sizeof (ctf_header_v1_t); } else return (ctf_set_open_errno(errp, ECTF_CTFVERS));