aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2022-02-23 14:57:41 +0000
committerMark Johnston <markj@FreeBSD.org>2022-02-23 16:41:22 +0000
commit565518046c9e721ea6ff608d44f1e89d344e5e02 (patch)
treeab1f20c96d418a9db3b10a168843f56644047979
parent62d16ad37df7d9efb6e329c9e7ca1fc3975a1966 (diff)
downloadsrc-565518046c9e721ea6ff608d44f1e89d344e5e02.tar.gz
src-565518046c9e721ea6ff608d44f1e89d344e5e02.zip
libctf: Remove checks for CTFv1
Per commit 7db423d69273 ("libctf: Rip out CTFv1 support") this support is obsolete. MFC after: 1 week Sponsored by: The FreeBSD Foundation
-rw-r--r--cddl/contrib/opensolaris/common/ctf/ctf_open.c9
-rw-r--r--cddl/contrib/opensolaris/common/ctf/ctf_types.c12
2 files changed, 8 insertions, 13 deletions
diff --git a/cddl/contrib/opensolaris/common/ctf/ctf_open.c b/cddl/contrib/opensolaris/common/ctf/ctf_open.c
index d64337a68bff..5ab06890d7f1 100644
--- a/cddl/contrib/opensolaris/common/ctf/ctf_open.c
+++ b/cddl/contrib/opensolaris/common/ctf/ctf_open.c
@@ -229,8 +229,7 @@ init_types(ctf_file_t *fp, const ctf_header_t *cth)
break;
case CTF_K_STRUCT:
case CTF_K_UNION:
- if (fp->ctf_version == CTF_VERSION_1 ||
- size < CTF_LSTRUCT_THRESH) {
+ if (size < CTF_LSTRUCT_THRESH) {
ctf_member_t *mp = (ctf_member_t *)
((uintptr_t)tp + increment);
@@ -383,8 +382,7 @@ init_types(ctf_file_t *fp, const ctf_header_t *cth)
if (err != 0 && err != ECTF_STRTAB)
return (err);
- if (fp->ctf_version == CTF_VERSION_1 ||
- size < CTF_LSTRUCT_THRESH)
+ if (size < CTF_LSTRUCT_THRESH)
vbytes = sizeof (ctf_member_t) * vlen;
else {
vbytes = sizeof (ctf_lmember_t) * vlen;
@@ -399,8 +397,7 @@ init_types(ctf_file_t *fp, const ctf_header_t *cth)
if (err != 0 && err != ECTF_STRTAB)
return (err);
- if (fp->ctf_version == CTF_VERSION_1 ||
- size < CTF_LSTRUCT_THRESH)
+ if (size < CTF_LSTRUCT_THRESH)
vbytes = sizeof (ctf_member_t) * vlen;
else {
vbytes = sizeof (ctf_lmember_t) * vlen;
diff --git a/cddl/contrib/opensolaris/common/ctf/ctf_types.c b/cddl/contrib/opensolaris/common/ctf/ctf_types.c
index 21b061cd9356..5b6b07655d82 100644
--- a/cddl/contrib/opensolaris/common/ctf/ctf_types.c
+++ b/cddl/contrib/opensolaris/common/ctf/ctf_types.c
@@ -33,8 +33,7 @@ ctf_get_ctt_size(const ctf_file_t *fp, const ctf_type_t *tp, ssize_t *sizep,
{
ssize_t size, increment;
- if (fp->ctf_version > CTF_VERSION_1 &&
- tp->ctt_size == CTF_LSIZE_SENT) {
+ if (tp->ctt_size == CTF_LSIZE_SENT) {
size = CTF_TYPE_LSIZE(tp);
increment = sizeof (ctf_type_t);
} else {
@@ -75,7 +74,7 @@ ctf_member_iter(ctf_file_t *fp, ctf_id_t type, ctf_member_f *func, void *arg)
if (kind != CTF_K_STRUCT && kind != CTF_K_UNION)
return (ctf_set_errno(ofp, ECTF_NOTSOU));
- if (fp->ctf_version == CTF_VERSION_1 || size < CTF_LSTRUCT_THRESH) {
+ if (size < CTF_LSTRUCT_THRESH) {
const ctf_member_t *mp = (const ctf_member_t *)
((uintptr_t)tp + increment);
@@ -425,8 +424,7 @@ ctf_type_align(ctf_file_t *fp, ctf_id_t type)
if (LCTF_INFO_KIND(fp, tp->ctt_info) == CTF_K_STRUCT)
n = MIN(n, 1); /* only use first member for structs */
- if (fp->ctf_version == CTF_VERSION_1 ||
- size < CTF_LSTRUCT_THRESH) {
+ if (size < CTF_LSTRUCT_THRESH) {
const ctf_member_t *mp = vmp;
for (; n != 0; n--, mp++) {
ssize_t am = ctf_type_align(fp, mp->ctm_type);
@@ -665,7 +663,7 @@ _ctf_member_info(ctf_file_t *fp, ctf_id_t type, const char *name, ulong_t off,
if (kind != CTF_K_STRUCT && kind != CTF_K_UNION)
return (ctf_set_errno(ofp, ECTF_NOTSOU));
- if (fp->ctf_version == CTF_VERSION_1 || size < CTF_LSTRUCT_THRESH) {
+ if (size < CTF_LSTRUCT_THRESH) {
const ctf_member_t *mp = (const ctf_member_t *)
((uintptr_t)tp + increment);
@@ -849,7 +847,7 @@ ctf_type_rvisit(ctf_file_t *fp, ctf_id_t type, ctf_visit_f *func, void *arg,
(void) ctf_get_ctt_size(fp, tp, &size, &increment);
- if (fp->ctf_version == CTF_VERSION_1 || size < CTF_LSTRUCT_THRESH) {
+ if (size < CTF_LSTRUCT_THRESH) {
const ctf_member_t *mp = (const ctf_member_t *)
((uintptr_t)tp + increment);