git: 5d526e9361fe - stable/13 - libctf: Rip out CTFv1 support

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Mon, 21 Feb 2022 14:58:10 UTC
The branch stable/13 has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=5d526e9361fed45d5c875407acb6293c17cbd1b3

commit 5d526e9361fed45d5c875407acb6293c17cbd1b3
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2022-02-10 20:32:23 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-02-21 14:57:30 +0000

    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.
    
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit 7db423d69273644d3be2a65a48a67b9e0cfb0147)
---
 cddl/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 001cf5c59104..d64337a68bff 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));