summaryrefslogtreecommitdiff
path: root/usr/src/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/cmd')
-rw-r--r--usr/src/cmd/ast/libast/mapfile-vers36
-rw-r--r--usr/src/cmd/ast/libshell/mapfile-vers12
-rw-r--r--usr/src/cmd/pcieadm/pcieadm.c51
-rw-r--r--usr/src/cmd/pcieadm/pcieadm.h1
-rw-r--r--usr/src/cmd/pcieadm/pcieadm_cfgspace.c13
-rw-r--r--usr/src/cmd/sgs/libld/common/update.c22
-rw-r--r--usr/src/cmd/sgs/rtld/common/mapfile-vers22
-rw-r--r--usr/src/cmd/sgs/tools/SUNWonld-README1
-rw-r--r--usr/src/cmd/zfs/Makefile11
9 files changed, 133 insertions, 36 deletions
diff --git a/usr/src/cmd/ast/libast/mapfile-vers b/usr/src/cmd/ast/libast/mapfile-vers
index 1575e26ab6..4e48d9cf73 100644
--- a/usr/src/cmd/ast/libast/mapfile-vers
+++ b/usr/src/cmd/ast/libast/mapfile-vers
@@ -90,7 +90,13 @@ $elif _ELF32
_Sftable {
ASSERT = {
TYPE = OBJECT;
+ $if _x86
SIZE = 1192;
+ $elif _sparc
+ SIZE = 1248;
+ $else
+ $error Unknown architecture
+ $endif
};
};
_Vmextern {
@@ -1083,31 +1089,61 @@ $elif _ELF32
_Sfstderr {
ASSERT = {
TYPE = OBJECT;
+ $if _x86
SIZE = 104;
+ $elif _sparc
+ SIZE = 112;
+ $else
+ $error Unknown architecture
+ $endif
};
};
_Sfstdin {
ASSERT = {
TYPE = OBJECT;
+ $if _x86
SIZE = 104;
+ $elif _sparc
+ SIZE = 112;
+ $else
+ $error Unknown architecture
+ $endif
};
};
_Sfstdout {
ASSERT = {
TYPE = OBJECT;
+ $if _x86
SIZE = 104;
+ $elif _sparc
+ SIZE = 112;
+ $else
+ $error Unknown architecture
+ $endif
};
};
_Stak_data {
ASSERT = {
TYPE = OBJECT;
+ $if _x86
SIZE = 104;
+ $elif _sparc
+ SIZE = 112;
+ $else
+ $error Unknown architecture
+ $endif
};
};
_ast_conf_data {
ASSERT = {
TYPE = OBJECT;
+ $if _x86
SIZE = 23324;
+ $elif _sparc
+ SIZE = 27440;
+ $else
+ $error Unknown architecture
+ $endif
};
};
$else
diff --git a/usr/src/cmd/ast/libshell/mapfile-vers b/usr/src/cmd/ast/libshell/mapfile-vers
index 344f0697c1..9cfd543e9d 100644
--- a/usr/src/cmd/ast/libshell/mapfile-vers
+++ b/usr/src/cmd/ast/libshell/mapfile-vers
@@ -123,9 +123,21 @@ SYMBOL_VERSION SUNWprivate_1.1 {
# semi-private, needed for shcomp
$if _ELF64
+ $if _x86
sh { ASSERT = { TYPE = OBJECT; SIZE = 1888; }; };
+ $elif _sparc
+ sh { ASSERT = { TYPE = OBJECT; SIZE = 1920; }; };
+ $else
+ $error Unknown architecture
+ $endif
$elif _ELF32
+ $if _x86
sh { ASSERT = { TYPE = OBJECT; SIZE = 1216; }; };
+ $elif _sparc
+ sh { ASSERT = { TYPE = OBJECT; SIZE = 1224; }; };
+ $else
+ $error Unknown architecture
+ $endif
$else
$error unknown ELFCLASS
$endif
diff --git a/usr/src/cmd/pcieadm/pcieadm.c b/usr/src/cmd/pcieadm/pcieadm.c
index edcad6e4d8..f1af0da485 100644
--- a/usr/src/cmd/pcieadm/pcieadm.c
+++ b/usr/src/cmd/pcieadm/pcieadm.c
@@ -129,13 +129,49 @@ pcieadm_ofmt_errx(const char *fmt, ...)
verrx(EXIT_FAILURE, fmt, ap);
}
-boolean_t
+/*
+ * We determine if a node is PCI in a two step process. The first is to see if
+ * the node's name starts with pci, and has an additional character that
+ * indicates it's not the synthetic root of the tree. However, the node name
+ * changes for some classes of devices such as GPUs. As such, for those we try
+ * to look at the compatible property and see if we have a pciexclass or
+ * pciclass entry. We look specifically for the class to make sure that we don't
+ * fall for the synthetic nodes that have a compatible property of
+ * 'pciex_root_complex'.
+ *
+ * The compatible property is a single string that is actually a compressed
+ * string. That is, there are multiple strings concatenated together in a single
+ * pointer.
+ */
+static boolean_t
pcieadm_di_node_is_pci(di_node_t node)
{
const char *name;
+ char *compat;
+ int nents;
name = di_node_name(node);
- return (strncmp("pci", name, 3) == 0);
+ if (strncmp("pci", name, 3) == 0) {
+ return (name[3] != '\0');
+ }
+
+ nents = di_prop_lookup_strings(DDI_DEV_T_ANY, node, "compatible",
+ &compat);
+ if (nents <= 0) {
+ return (B_FALSE);
+ }
+
+ for (int i = 0; i < nents; i++) {
+ if (strncmp("pciclass,", compat, strlen("pciclass,")) == 0 ||
+ strncmp("pciexclass,", compat, strlen("pciexclass,")) ==
+ 0) {
+ return (B_TRUE);
+ }
+
+ compat += strlen(compat) + 1;
+ }
+
+ return (B_FALSE);
}
static int
@@ -147,15 +183,6 @@ pcieadm_di_walk_cb(di_node_t node, void *arg)
return (DI_WALK_CONTINUE);
}
- /*
- * We create synthetic nodes for the root of PCIe tree basically
- * functions as all the resources available for one or more bridges.
- * When we encounter that top-level node skip it.
- */
- if (strcmp("pci", di_node_name(node)) == 0) {
- return (DI_WALK_CONTINUE);
- }
-
return (walk->pdw_func(node, walk->pdw_arg));
}
@@ -216,7 +243,7 @@ pcieadm_find_dip_cb(di_node_t node, void *arg)
}
(void) snprintf(bdf, sizeof (bdf), "%x/%x/%x", PCI_REG_BUS_G(regs[0]),
PCI_REG_DEV_G(regs[0]), PCI_REG_FUNC_G(regs[0]));
- (void) snprintf(bdf, sizeof (bdf), "%02x/%02x/%02x",
+ (void) snprintf(altbdf, sizeof (altbdf), "%02x/%02x/%02x",
PCI_REG_BUS_G(regs[0]), PCI_REG_DEV_G(regs[0]),
PCI_REG_FUNC_G(regs[0]));
diff --git a/usr/src/cmd/pcieadm/pcieadm.h b/usr/src/cmd/pcieadm/pcieadm.h
index b5d44ef970..7ebdc148ca 100644
--- a/usr/src/cmd/pcieadm/pcieadm.h
+++ b/usr/src/cmd/pcieadm/pcieadm.h
@@ -71,7 +71,6 @@ extern void pcieadm_init_cfgspace_file(pcieadm_t *, const char *,
extern void pcieadm_fini_cfgspace_file(void *);
extern void pcieadm_find_nexus(pcieadm_t *);
extern void pcieadm_find_dip(pcieadm_t *, const char *);
-extern boolean_t pcieadm_di_node_is_pci(di_node_t);
/*
* Output related
diff --git a/usr/src/cmd/pcieadm/pcieadm_cfgspace.c b/usr/src/cmd/pcieadm/pcieadm_cfgspace.c
index 50d98c5ec9..32c4be06f4 100644
--- a/usr/src/cmd/pcieadm/pcieadm_cfgspace.c
+++ b/usr/src/cmd/pcieadm/pcieadm_cfgspace.c
@@ -4869,8 +4869,17 @@ pcieadm_save_cfgspace_cb(di_node_t devi, void *arg)
PCI_REG_BUS_G(regs[0]), PCI_REG_DEV_G(regs[0]),
PCI_REG_FUNC_G(regs[0]));
- if ((fd = openat(psc->psc_dirfd, fname, O_WRONLY | O_TRUNC | O_CREAT,
- 0666)) < 0) {
+ if (setppriv(PRIV_SET, PRIV_EFFECTIVE, psc->psc_pci->pia_priv_eff) !=
+ 0) {
+ err(EXIT_FAILURE, "failed to raise privileges");
+ }
+ fd = openat(psc->psc_dirfd, fname, O_WRONLY | O_TRUNC | O_CREAT, 0666);
+ if (setppriv(PRIV_SET, PRIV_EFFECTIVE, psc->psc_pci->pia_priv_min) !=
+ 0) {
+ err(EXIT_FAILURE, "failed to reduce privileges");
+ }
+
+ if (fd < 0) {
warn("failed to create output file %s", fname);
psc->psc_ret = EXIT_FAILURE;
return (DI_WALK_CONTINUE);
diff --git a/usr/src/cmd/sgs/libld/common/update.c b/usr/src/cmd/sgs/libld/common/update.c
index 94692ae22a..2bef6a18a8 100644
--- a/usr/src/cmd/sgs/libld/common/update.c
+++ b/usr/src/cmd/sgs/libld/common/update.c
@@ -3722,11 +3722,11 @@ check_mapfile_assertions(Ofl_desc *ofl)
ld_eprintf(ofl, ERR_FATAL,
MSG_INTL(MSG_ALIAS_NOTALIAS),
ma->ass_file,
- ma->ass_lineno,
+ EC_LINENO(ma->ass_lineno),
ma->ass_sdp->sd_name,
dup->aav_ass->ass_sdp->sd_name,
dup->aav_ass->ass_file,
- dup->aav_ass->ass_lineno);
+ EC_LINENO(dup->aav_ass->ass_lineno));
ret = S_ERROR;
} else {
avl_insert(&ass_avl, av, where);
@@ -3745,7 +3745,7 @@ check_mapfile_assertions(Ofl_desc *ofl)
Sym *sym = sdp->sd_sym;
ld_eprintf(ofl, ERR_FATAL, MSG_INTL(MSG_ASSFAIL_SCOPE),
- ma->ass_file, ma->ass_lineno,
+ ma->ass_file, EC_LINENO(ma->ass_lineno),
demangle(sdp->sd_name),
conv_sym_info_bind(ma->ass_bind, CONV_FMT_ALT_CFNP,
&inv_buf),
@@ -3762,7 +3762,7 @@ check_mapfile_assertions(Ofl_desc *ofl)
NULL, ofl)) == NULL) {
ld_eprintf(ofl, ERR_FATAL,
MSG_INTL(MSG_ALIAS_BADSYM),
- ma->ass_file, ma->ass_lineno,
+ ma->ass_file, EC_LINENO(ma->ass_lineno),
ma->ass_alias);
ret = S_ERROR;
} else {
@@ -3781,7 +3781,8 @@ check_mapfile_assertions(Ofl_desc *ofl)
SYM_ASSERT_ALIAS)) {
ld_eprintf(ofl, ERR_FATAL,
MSG_INTL(MSG_ALIAS_TOALIAS),
- ma->ass_file, ma->ass_lineno,
+ ma->ass_file,
+ EC_LINENO(ma->ass_lineno),
ma->ass_alias);
ret = S_ERROR;
}
@@ -3795,7 +3796,8 @@ check_mapfile_assertions(Ofl_desc *ofl)
ELF_ST_TYPE(sym->st_info))) {
ld_eprintf(ofl, ERR_FATAL,
MSG_INTL(MSG_ASSFAIL_ALIAS),
- ma->ass_file, ma->ass_lineno,
+ ma->ass_file,
+ EC_LINENO(ma->ass_lineno),
demangle(sdp->sd_name),
asdp->sd_name);
ret = S_ERROR;
@@ -3816,7 +3818,7 @@ check_mapfile_assertions(Ofl_desc *ofl)
if (ass_enabled(ma, SYM_ASSERT_SIZE) &&
(ma->ass_size != sdp->sd_sym->st_size)) {
ld_eprintf(ofl, ERR_FATAL, MSG_INTL(MSG_ASSFAIL_SIZE),
- ma->ass_file, ma->ass_lineno,
+ ma->ass_file, EC_LINENO(ma->ass_lineno),
demangle(sdp->sd_name),
ma->ass_size, (Lword)sdp->sd_sym->st_size);
ret = S_ERROR;
@@ -3827,7 +3829,7 @@ check_mapfile_assertions(Ofl_desc *ofl)
(sdp->sd_isc->is_shdr->sh_type == SHT_NOBITS)) {
ld_eprintf(ofl, ERR_FATAL,
MSG_INTL(MSG_ASSFAIL_BITS),
- ma->ass_file, ma->ass_lineno,
+ ma->ass_file, EC_LINENO(ma->ass_lineno),
demangle(sdp->sd_name));
ret = S_ERROR;
}
@@ -3835,7 +3837,7 @@ check_mapfile_assertions(Ofl_desc *ofl)
(sdp->sd_isc->is_shdr->sh_type != SHT_NOBITS)) {
ld_eprintf(ofl, ERR_FATAL,
MSG_INTL(MSG_ASSFAIL_NOBITS),
- ma->ass_file, ma->ass_lineno,
+ ma->ass_file, EC_LINENO(ma->ass_lineno),
demangle(sdp->sd_name));
ret = S_ERROR;
}
@@ -3847,7 +3849,7 @@ check_mapfile_assertions(Ofl_desc *ofl)
ld_eprintf(ofl, ERR_FATAL,
MSG_INTL(MSG_ASSFAIL_TYPE),
- ma->ass_file, ma->ass_lineno,
+ ma->ass_file, EC_LINENO(ma->ass_lineno),
demangle(sdp->sd_name),
conv_sym_info_type(ehdr->e_machine,
ma->ass_type, CONV_FMT_ALT_CFNP, &inv_buf),
diff --git a/usr/src/cmd/sgs/rtld/common/mapfile-vers b/usr/src/cmd/sgs/rtld/common/mapfile-vers
index c67b144f2c..5647f404c4 100644
--- a/usr/src/cmd/sgs/rtld/common/mapfile-vers
+++ b/usr/src/cmd/sgs/rtld/common/mapfile-vers
@@ -84,6 +84,12 @@ SYMBOL_VERSION SUNWprivate_1.3 {
$elif _x86 && _ELF64
SIZE = 80;
+ $elif _sparc && _ELF32
+
+ SIZE = 44;
+ $elif _sparc && _ELF64
+
+ SIZE = 80;
$else
$error Unknown platform
@@ -98,10 +104,10 @@ SYMBOL_VERSION SUNWprivate_1.3 {
lml_main {
ASSERT = {
TYPE = OBJECT;
- $if _x86 && _ELF32
+ $if _ELF32
SIZE = addrsize[41];
- $elif _x86 && _ELF64
+ $elif _ELF64
SIZE = addrsize[38];
$else
@@ -165,7 +171,13 @@ $if _ELF32
reloc32_table {
ASSERT = {
TYPE = OBJECT;
+ $if _x86
SIZE = addrsize[117];
+ $elif _sparc
+ SIZE = addrsize[264];
+ $else
+ $error Unknown architecture
+ $endif
};
};
$elif _ELF64
@@ -173,7 +185,13 @@ $elif _ELF64
reloc64_table {
ASSERT = {
TYPE = OBJECT;
+ $if _x86
SIZE = addrsize[68];
+ $elif _sparc
+ SIZE = addrsize[176];
+ $else
+ $error Unknown architecture
+ $endif
};
};
$else
diff --git a/usr/src/cmd/sgs/tools/SUNWonld-README b/usr/src/cmd/sgs/tools/SUNWonld-README
index 3ae424340c..2b98810bfd 100644
--- a/usr/src/cmd/sgs/tools/SUNWonld-README
+++ b/usr/src/cmd/sgs/tools/SUNWonld-README
@@ -1672,3 +1672,4 @@ Bugid Risk Synopsis
13481 ld(1) should skip GCC local aliases when building symsort sections
13684 ld aborts when input object has no file name
13487 want mapfile-based assertions about symbol properties
+13487 want mapfile-based assertions about symbol properties (fix SPARC)
diff --git a/usr/src/cmd/zfs/Makefile b/usr/src/cmd/zfs/Makefile
index 97642e44f9..6a227e5093 100644
--- a/usr/src/cmd/zfs/Makefile
+++ b/usr/src/cmd/zfs/Makefile
@@ -29,11 +29,11 @@
PROG= zfs
OBJS= zfs_main.o zfs_iter.o zfs_project.o
-SRCS= $(OBJS:%.o=%.c)
POFILES= zfs_main.po zfs_iter.po zfs_project.po
POFILE= zfs.po
include ../Makefile.cmd
+include ../Makefile.cmd.64
include ../Makefile.ctf
FSTYPE= zfs
@@ -50,15 +50,10 @@ INCS += -I$(SRC)/uts/common/fs/zfs
INCS += -I../../lib/libzutil/common
CSTD= $(CSTD_GNU99)
-C99LMODE= -Xc99=%all
-CPPFLAGS += -D_LARGEFILE64_SOURCE=1 -D_REENTRANT $(INCS)
+CPPFLAGS += -D_REENTRANT $(INCS)
$(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG
-# lint complains about unused _umem_* functions
-LINTFLAGS += -xerroff=E_NAME_DEF_NOT_USED2
-LINTFLAGS64 += -xerroff=E_NAME_DEF_NOT_USED2
-
ROOTUSRSBINLINKS = $(PROG:%=$(ROOTUSRSBIN)/%)
USRLIBFSTYPELINKS = $(LINKPROGS:%=$(USRLIBFSTYPE)/%)
ROOTETCFSTYPELINKS = $(LINKPROGS:%=$(ROOTETCFSTYPE)/%)
@@ -83,8 +78,6 @@ $(POFILE): $(POFILES)
clean:
$(RM) $(OBJS)
-lint: lint_SRCS
-
# Links from /usr/sbin to /sbin
$(ROOTUSRSBINLINKS):
-$(RM) $@; $(SYMLINK) ../../sbin/$(PROG) $@