diff options
Diffstat (limited to 'usr/src/lib')
-rw-r--r-- | usr/src/lib/cfgadm_plugins/ccid/Makefile | 2 | ||||
-rw-r--r-- | usr/src/lib/cfgadm_plugins/ccid/sparc/Makefile | 20 | ||||
-rw-r--r-- | usr/src/lib/cfgadm_plugins/ccid/sparcv9/Makefile | 21 | ||||
-rw-r--r-- | usr/src/lib/libctf/common/ctf_dwarf.c | 40 |
4 files changed, 52 insertions, 31 deletions
diff --git a/usr/src/lib/cfgadm_plugins/ccid/Makefile b/usr/src/lib/cfgadm_plugins/ccid/Makefile index 7d4af31c7d..232f1ec3b5 100644 --- a/usr/src/lib/cfgadm_plugins/ccid/Makefile +++ b/usr/src/lib/cfgadm_plugins/ccid/Makefile @@ -27,7 +27,7 @@ include ../../Makefile.lib -$(INTEL_BLD)SUBDIRS = $(MACH) $(BUILD64) $(MACH64) +SUBDIRS = $(MACH) $(BUILD64) $(MACH64) all := TARGET= all clean := TARGET= clean diff --git a/usr/src/lib/cfgadm_plugins/ccid/sparc/Makefile b/usr/src/lib/cfgadm_plugins/ccid/sparc/Makefile new file mode 100644 index 0000000000..66d7a51776 --- /dev/null +++ b/usr/src/lib/cfgadm_plugins/ccid/sparc/Makefile @@ -0,0 +1,20 @@ +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright 2019, Joyent, Inc. +# + +include ../Makefile.com + +.KEEP_STATE: + +install: all $(ROOTLIBS) $(ROOTLINKS) diff --git a/usr/src/lib/cfgadm_plugins/ccid/sparcv9/Makefile b/usr/src/lib/cfgadm_plugins/ccid/sparcv9/Makefile new file mode 100644 index 0000000000..f2eb3c97a2 --- /dev/null +++ b/usr/src/lib/cfgadm_plugins/ccid/sparcv9/Makefile @@ -0,0 +1,21 @@ +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright 2019, Joyent, Inc. +# + +include ../Makefile.com +include ../../../Makefile.lib.64 + +.KEEP_STATE: + +install: all $(ROOTLIBS64) $(ROOTLINKS64) diff --git a/usr/src/lib/libctf/common/ctf_dwarf.c b/usr/src/lib/libctf/common/ctf_dwarf.c index 3079831715..cbe1661003 100644 --- a/usr/src/lib/libctf/common/ctf_dwarf.c +++ b/usr/src/lib/libctf/common/ctf_dwarf.c @@ -1751,40 +1751,12 @@ ctf_dwarf_create_reference(ctf_cu_t *cup, Dwarf_Die die, ctf_id_t *idp, return (ctf_dwmap_add(cup, *idp, die, B_FALSE)); } -/* - * Get the size of the type of a particular die. Note that this is a simple - * version that doesn't attempt to traverse further than expecting a single - * sized type reference (so no qualifiers etc.). Nor does it attempt to do as - * much as ctf_type_size() - which we cannot use here as that doesn't look up - * dynamic types, and we don't yet want to do a ctf_update(). - */ -static int -ctf_dwarf_get_type_size(ctf_cu_t *cup, Dwarf_Die die, size_t *sizep) -{ - const ctf_type_t *t; - Dwarf_Die tdie; - ctf_id_t tid; - int ret; - - if ((ret = ctf_dwarf_refdie(cup, die, DW_AT_type, &tdie)) != 0) - return (ret); - - if ((ret = ctf_dwarf_convert_type(cup, tdie, &tid, - CTF_ADD_NONROOT)) != 0) - return (ret); - - if ((t = ctf_dyn_lookup_by_id(cup->cu_ctfp, tid)) == NULL) - return (ENOENT); - - *sizep = ctf_get_ctt_size(cup->cu_ctfp, t, NULL, NULL); - return (0); -} - static int ctf_dwarf_create_enum(ctf_cu_t *cup, Dwarf_Die die, ctf_id_t *idp, int isroot) { size_t size = 0; Dwarf_Die child; + Dwarf_Unsigned dw; ctf_id_t id; char *name; int ret; @@ -1795,7 +1767,15 @@ ctf_dwarf_create_enum(ctf_cu_t *cup, Dwarf_Die die, ctf_id_t *idp, int isroot) if (ret == ENOENT) name = NULL; - (void) ctf_dwarf_get_type_size(cup, die, &size); + /* + * Enumerations may have a size associated with them, particularly if + * they're packed. Note, a Dwarf_Unsigned is larger than a size_t on an + * ILP32 system. + */ + if (ctf_dwarf_unsigned(cup, die, DW_AT_byte_size, &dw) == 0 && + dw < SIZE_MAX) { + size = (size_t)dw; + } id = ctf_add_enum(cup->cu_ctfp, isroot, name, size); ctf_dprintf("added enum %s (%d)\n", name, id); |