6583742 ELF string conversion library needs to lose static writable buffers
authorab196087
Thu, 26 Jul 2007 08:45:42 -0700
changeset 4734 a4708faa3e85
parent 4733 1966c7fad027
child 4735 a8f42b34829b
6583742 ELF string conversion library needs to lose static writable buffers
usr/src/cmd/sgs/crle/common/print.c
usr/src/cmd/sgs/dump/common/dump.c
usr/src/cmd/sgs/elfdump/common/elfdump.c
usr/src/cmd/sgs/include/conv.h
usr/src/cmd/sgs/libconv/common/_conv.h
usr/src/cmd/sgs/libconv/common/cap.c
usr/src/cmd/sgs/libconv/common/config.c
usr/src/cmd/sgs/libconv/common/data.c
usr/src/cmd/sgs/libconv/common/deftag.c
usr/src/cmd/sgs/libconv/common/dl.c
usr/src/cmd/sgs/libconv/common/dwarf_ehe.c
usr/src/cmd/sgs/libconv/common/dynamic.c
usr/src/cmd/sgs/libconv/common/elf.c
usr/src/cmd/sgs/libconv/common/globals.c
usr/src/cmd/sgs/libconv/common/group.c
usr/src/cmd/sgs/libconv/common/llib-lconv
usr/src/cmd/sgs/libconv/common/phdr.c
usr/src/cmd/sgs/libconv/common/relocate.c
usr/src/cmd/sgs/libconv/common/relocate_amd64.c
usr/src/cmd/sgs/libconv/common/relocate_i386.c
usr/src/cmd/sgs/libconv/common/relocate_sparc.c
usr/src/cmd/sgs/libconv/common/sections.c
usr/src/cmd/sgs/libconv/common/segments.c
usr/src/cmd/sgs/libconv/common/symbols.c
usr/src/cmd/sgs/libconv/common/symbols_sparc.c
usr/src/cmd/sgs/libconv/common/version.c
usr/src/cmd/sgs/libld/common/args.c
usr/src/cmd/sgs/libld/common/files.c
usr/src/cmd/sgs/libld/common/ldlibs.c
usr/src/cmd/sgs/libld/common/libs.c
usr/src/cmd/sgs/libld/common/machrel.amd.c
usr/src/cmd/sgs/libld/common/machrel.intel.c
usr/src/cmd/sgs/libld/common/machrel.sparc.c
usr/src/cmd/sgs/libld/common/machsym.sparc.c
usr/src/cmd/sgs/libld/common/relocate.c
usr/src/cmd/sgs/libld/common/resolve.c
usr/src/cmd/sgs/libld/common/syms.c
usr/src/cmd/sgs/liblddbg/common/bindings.c
usr/src/cmd/sgs/liblddbg/common/cap.c
usr/src/cmd/sgs/liblddbg/common/dynamic.c
usr/src/cmd/sgs/liblddbg/common/elf.c
usr/src/cmd/sgs/liblddbg/common/entry.c
usr/src/cmd/sgs/liblddbg/common/files.c
usr/src/cmd/sgs/liblddbg/common/got.c
usr/src/cmd/sgs/liblddbg/common/map.c
usr/src/cmd/sgs/liblddbg/common/phdr.c
usr/src/cmd/sgs/liblddbg/common/relocate.c
usr/src/cmd/sgs/liblddbg/common/segments.c
usr/src/cmd/sgs/liblddbg/common/shdr.c
usr/src/cmd/sgs/liblddbg/common/syms.c
usr/src/cmd/sgs/liblddbg/common/tls.c
usr/src/cmd/sgs/liblddbg/common/util.c
usr/src/cmd/sgs/packages/common/SUNWonld-README
usr/src/cmd/sgs/rtld/amd64/amd64_elf.c
usr/src/cmd/sgs/rtld/common/analyze.c
usr/src/cmd/sgs/rtld/common/cap.c
usr/src/cmd/sgs/rtld/common/elf.c
usr/src/cmd/sgs/rtld/common/setup.c
usr/src/cmd/sgs/rtld/i386/i386_elf.c
usr/src/cmd/sgs/rtld/mdbmod/common/rtld.c
usr/src/cmd/sgs/rtld/sparc/common_sparc.c
usr/src/cmd/sgs/rtld/sparc/sparc_elf.c
usr/src/cmd/sgs/rtld/sparcv9/sparc_elf.c
usr/src/uts/common/krtld/reloc.h
--- a/usr/src/cmd/sgs/crle/common/print.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/crle/common/print.c	Thu Jul 26 08:45:42 2007 -0700
@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 #pragma ident	"%Z%%M%	%I%	%E% SMI"
@@ -211,6 +211,8 @@
 static INSCFG_RET
 scanconfig(Crle_desc * crle, Addr addr, int c_class)
 {
+	Conv_inv_buf_t 		inv_buf1, inv_buf2, inv_buf3, inv_buf4;
+	Conv_dl_flag_buf_t	dl_flag_buf;
 	Rtc_id		*id;
 	Rtc_head	*head;
 	Rtc_dir		*dirtbl;
@@ -251,7 +253,7 @@
 	/* 64-bit program with an existing 32-bit file? Abort. */
 	if (!(head->ch_cnflags & RTC_HDR_64)) {
 		(void) fprintf(stderr, MSG_INTL(MSG_ARG_CLASS),
-			crle->c_name, crle->c_confil);
+		    crle->c_name, crle->c_confil);
 		return (INSCFG_RET_FAIL);
 	}
 #else
@@ -265,7 +267,7 @@
 	 */
 	if (c_class != ELFCLASS32) {
 		(void) fprintf(stderr, MSG_INTL(MSG_ARG_CLASS),
-			crle->c_name, crle->c_confil);
+		    crle->c_name, crle->c_confil);
 		return (INSCFG_RET_FAIL);
 	}
 #endif
@@ -284,10 +286,13 @@
 		if ((id->id_data != M_DATA) || (id->id_machine != M_MACH)) {
 			(void) fprintf(stderr, MSG_INTL(MSG_ARG_WRONGARCH),
 			    crle->c_name, crle->c_confil,
-			    conv_ehdr_data(id->id_data, CONV_FMT_ALTFILE),
-			    conv_ehdr_mach(id->id_machine, CONV_FMT_ALTFILE),
-			    conv_ehdr_data(M_DATA, CONV_FMT_ALTFILE),
-			    conv_ehdr_mach(M_MACH, CONV_FMT_ALTFILE));
+			    conv_ehdr_data(id->id_data, CONV_FMT_ALTFILE,
+			    &inv_buf1),
+			    conv_ehdr_mach(id->id_machine, CONV_FMT_ALTFILE,
+			    &inv_buf2),
+			    conv_ehdr_data(M_DATA, CONV_FMT_ALTFILE, &inv_buf3),
+			    conv_ehdr_mach(M_MACH, CONV_FMT_ALTFILE,
+			    &inv_buf4));
 			return (INSCFG_RET_FAIL);
 		}
 	}
@@ -312,13 +317,13 @@
 	if (head->ch_version > RTC_VER_CURRENT) {
 		if (crle->c_flags & CRLE_UPDATE) {
 			(void) fprintf(stderr, MSG_INTL(MSG_ARG_UPDATEVER),
-				crle->c_name, crle->c_confil,
-				(int)head->ch_version, RTC_VER_CURRENT);
+			    crle->c_name, crle->c_confil,
+			    (int)head->ch_version, RTC_VER_CURRENT);
 			return (INSCFG_RET_FAIL);
 		} else {
 			(void) fprintf(stderr, MSG_INTL(MSG_ARG_PRINTVER),
-				crle->c_name, crle->c_confil,
-				(int)head->ch_version, RTC_VER_CURRENT);
+			    crle->c_name, crle->c_confil,
+			    (int)head->ch_version, RTC_VER_CURRENT);
 		}
 	}
 
@@ -349,7 +354,7 @@
 		const char	*fmt;
 
 		if (head->ch_dlflags)
-			fmt = conv_dl_flag(head->ch_dlflags, 0);
+			fmt = conv_dl_flag(head->ch_dlflags, 0, &dl_flag_buf);
 		else
 			fmt = MSG_ORIG(MSG_STR_EMPTY);
 
@@ -360,10 +365,13 @@
 		 * If the file has an id block, show the information
 		 */
 		if (id)
-		    (void) printf(MSG_INTL(MSG_DMP_PLATFORM),
-			conv_ehdr_class(id->id_class, CONV_FMT_ALTFILE),
-			conv_ehdr_data(id->id_data, CONV_FMT_ALTFILE),
-			conv_ehdr_mach(id->id_machine, CONV_FMT_ALTFILE));
+			(void) printf(MSG_INTL(MSG_DMP_PLATFORM),
+			    conv_ehdr_class(id->id_class, CONV_FMT_ALTFILE,
+			    &inv_buf1),
+			    conv_ehdr_data(id->id_data, CONV_FMT_ALTFILE,
+			    &inv_buf2),
+			    conv_ehdr_mach(id->id_machine, CONV_FMT_ALTFILE,
+			    &inv_buf3));
 
 		/*
 		 * Construct the original command line argument.
@@ -380,7 +388,8 @@
 		if (head->ch_dlflags &&
 		    (head->ch_dlflags != RTLD_REL_RELATIVE)) {
 			(void) snprintf(_cmd, PATH_MAX, MSG_ORIG(MSG_CMD_FLAGS),
-			    conv_dl_flag(head->ch_dlflags, CONV_FMT_ALTCRLE));
+			    conv_dl_flag(head->ch_dlflags, CONV_FMT_ALTCRLE,
+			    &dl_flag_buf));
 			cmd = strcpy(alloca(strlen(_cmd) + 1), _cmd);
 			if (list_append(&cmdline, cmd) == 0)
 				return (INSCFG_RET_FAIL);
@@ -706,10 +715,10 @@
 
 			/* LINTED */
 			fltrtbl = (Rtc_fltr *)
-				(CAST_PTRINT(char *, head->ch_fltr) + addr);
+			    (CAST_PTRINT(char *, head->ch_fltr) + addr);
 			/* LINTED */
 			fltetbl = (Rtc_flte *)
-				(CAST_PTRINT(char *, head->ch_flte) + addr);
+			    (CAST_PTRINT(char *, head->ch_flte) + addr);
 
 			(void) printf(MSG_INTL(MSG_FLT_TITLE));
 
@@ -744,9 +753,9 @@
 	 */
 	if (head->ch_resbgn && ((crle->c_flags & CRLE_UPDATE) == 0))
 		(void) printf(MSG_INTL(MSG_DMP_RESV),
-			(u_longlong_t)head->ch_resbgn,
-			(u_longlong_t)head->ch_resend,
-			(u_longlong_t)(head->ch_resend - head->ch_resbgn));
+		    (u_longlong_t)head->ch_resbgn,
+		    (u_longlong_t)head->ch_resend,
+		    (u_longlong_t)(head->ch_resend - head->ch_resbgn));
 
 	/*
 	 * If there's no hash table there's nothing else to process.
@@ -952,9 +961,10 @@
 	 * Scan the hash buckets looking for valid entries.
 	 */
 	for (ndx = 0; ndx < bkts; ndx++, hash++) {
-		Rtc_obj		*obj;
-		const char	*str;
-		Word		_ndx;
+		Conv_config_obj_buf_t	config_obj_buf;
+		Rtc_obj			*obj;
+		const char		*str;
+		Word			_ndx;
 
 		if (*hash == 0)
 			continue;
@@ -963,7 +973,7 @@
 		str = strtbl + obj->co_name;
 
 		(void) printf(MSG_INTL(MSG_DMP_HASHENT_1), obj->co_id, ndx,
-			str, conv_config_obj(obj->co_flags));
+		    str, conv_config_obj(obj->co_flags, &config_obj_buf));
 
 		/*
 		 * Determine whether there are other objects chained to this
@@ -974,7 +984,8 @@
 			str = strtbl + obj->co_name;
 
 			(void) printf(MSG_INTL(MSG_DMP_HASHENT_2), obj->co_id,
-			    str, conv_config_obj(obj->co_flags));
+			    str, conv_config_obj(obj->co_flags,
+			    &config_obj_buf));
 		}
 	}
 	(void) printf(MSG_ORIG(MSG_STR_NL));
@@ -991,6 +1002,7 @@
 	Addr		addr;
 	struct stat	status;
 	const char	*caller = crle->c_name, *file = crle->c_confil;
+	Conv_inv_buf_t	inv_buf1, inv_buf2, inv_buf3;
 
 	/*
 	 * Open the configuration file, determine its size and map it in.
@@ -1039,12 +1051,12 @@
 				 */
 				(void) printf(MSG_INTL(MSG_DEF_NOCONF), file);
 				(void) printf(MSG_INTL(MSG_DMP_PLATFORM),
-					conv_ehdr_class(M_CLASS,
-						CONV_FMT_ALTFILE),
-					conv_ehdr_data(M_DATA,
-						CONV_FMT_ALTFILE),
-					conv_ehdr_mach(M_MACH,
-						CONV_FMT_ALTFILE));
+				    conv_ehdr_class(M_CLASS,
+				    CONV_FMT_ALTFILE, &inv_buf1),
+				    conv_ehdr_data(M_DATA,
+				    CONV_FMT_ALTFILE, &inv_buf2),
+				    conv_ehdr_mach(M_MACH,
+				    CONV_FMT_ALTFILE, &inv_buf3));
 
 
 				if (crle->c_flags & CRLE_AOUT) {
--- a/usr/src/cmd/sgs/dump/common/dump.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/dump/common/dump.c	Thu Jul 26 08:45:42 2007 -0700
@@ -205,8 +205,8 @@
 				*high = (int)atol(w);
 			else {
 				(void) fprintf(stderr,
-					"%s: too many arguments - %s ignored\n",
-					prog_name, w);
+				    "%s: too many arguments - %s ignored\n",
+				    prog_name, w);
 				return;
 			}
 		s = NULL;
@@ -242,7 +242,7 @@
 		topath = temp[1];
 		path = strtab + (topath*sizeof (long));
 		(void) strncpy((char *)buf, (char *)path,
-			(total - topath)*sizeof (long));
+		    (total - topath)*sizeof (long));
 		(void) fprintf(stdout, "%s\n", buf);
 		strtab += total*sizeof (long);
 		section_size -= (total*sizeof (long));
@@ -333,7 +333,7 @@
 		}
 		(void) gelf_getsym(sym_data, symid, &sym);
 		sym_name = (char *)elf_strptr(elf_file,
-			reloc_symtab->p_shdr.sh_link, sym.st_name);
+		    reloc_symtab->p_shdr.sh_link, sym.st_name);
 		if (sym_name == NULL)
 			sym_name = (char *)UNKNOWN;
 		if (r_flag && rn_flag) {
@@ -362,13 +362,15 @@
 		if (!v_flag) {
 			(void) printf("%-22d%-18d", symid, type);
 		} else {
+			Conv_inv_buf_t	inv_buf;
+
 			if (strlen(sym_name)) {
 				size_t len = strlen(sym_name) + 1;
 				char tmpstr[10];
 				if (len > 22) {
 					(void) sprintf(tmpstr, "%%-%ds",
-						/* LINTED */
-						(int)len);
+					    /* LINTED */
+					    (int)len);
 					/*LINTED: E_SEC_PRINTF_VAR_FMT*/
 					(void) printf(tmpstr, sym_name);
 				} else
@@ -377,8 +379,8 @@
 				(void) printf("%-22d", symid);
 			}
 			(void) printf("%-20s",
-				conv_reloc_type(p_ehdr->e_machine,
-				type, DUMP_CONVFMT));
+			    conv_reloc_type(p_ehdr->e_machine,
+			    type, DUMP_CONVFMT, &inv_buf));
 		}
 		(void) printf("%lld\n", EC_SXWORD(rela.r_addend));
 		ndx++;
@@ -436,7 +438,7 @@
 		}
 		(void) gelf_getsym(sym_data, symid, &sym);
 		sym_name = (char *)elf_strptr(elf_file,
-			reloc_symtab->p_shdr.sh_link, sym.st_name);
+		    reloc_symtab->p_shdr.sh_link, sym.st_name);
 		if (sym_name == NULL)
 			sym_name = (char *)UNKNOWN;
 		if (r_flag && rn_flag) {
@@ -464,14 +466,16 @@
 		if (!v_flag) {
 			(void) printf("%-20d%-18d", symid, type);
 		} else {
+			Conv_inv_buf_t	inv_buf;
+
 			if (strlen(sym_name))
 				(void) printf("%-20s", sym_name);
 			else {
 				(void) printf("%-20d", sym.st_name);
 			}
 			(void) printf("%-20s",
-				conv_reloc_type(p_ehdr->e_machine,
-				type, DUMP_CONVFMT));
+			    conv_reloc_type(p_ehdr->e_machine,
+			    type, DUMP_CONVFMT, &inv_buf));
 		}
 		(void) printf("\n");
 		ndx++;
@@ -525,6 +529,8 @@
 	int adj = 0;		/* field adjustment for elf64 */
 	Elf32_Word	*symshndx = 0;
 	unsigned int	nosymshndx = 0;
+	Conv_inv_buf_t	inv_buf;
+
 
 	if (gelf_getclass(elf_file) == ELFCLASS64)
 		adj = 8;
@@ -587,7 +593,8 @@
 			 *  to be consistent with output from elfdump(1).
 			 */
 			(void) printf("%-*s", 12 + adj,
-			    conv_sym_SPARC_value(sym.st_value, DUMP_CONVFMT));
+			    conv_sym_SPARC_value(sym.st_value,
+			    DUMP_CONVFMT, &inv_buf));
 		} else {
 			(void) printf("0x%-*llx", 10 + adj,
 			    EC_ADDR(sym.st_value));
@@ -602,15 +609,16 @@
 			GElf_Ehdr p_ehdr;
 			(void) gelf_getehdr(elf_file, &p_ehdr);
 			(void) printf("%s\t",
-				conv_sym_info_type(p_ehdr.e_machine, type,
-				DUMP_CONVFMT));
+			    conv_sym_info_type(p_ehdr.e_machine, type,
+			    DUMP_CONVFMT, &inv_buf));
 			(void) printf("%s",
-				conv_sym_info_bind(bind, DUMP_CONVFMT));
+			    conv_sym_info_bind(bind, DUMP_CONVFMT, &inv_buf));
 			(void) printf("\t  %d\t", EC_WORD(sym.st_other));
 
-			if (specsec) {
-				(void) printf("%s", conv_sym_shndx(shndx));
-			} else
+			if (specsec)
+				(void) printf("%s",
+				    conv_sym_shndx(shndx, &inv_buf));
+			else
 				(void) printf("%d", EC_WORD(shndx));
 			(void) printf("\t");
 		}
@@ -621,13 +629,12 @@
 		else
 			if (C_flag)
 				sym_name = demangled_name(
-					(char *)elf_strptr(elf_file,
-					p_symtab->p_shdr.sh_link,
-					sym.st_name));
+				    (char *)elf_strptr(elf_file,
+				    p_symtab->p_shdr.sh_link,
+				    sym.st_name));
 		else
 			sym_name = (char *)elf_strptr(elf_file,
-				p_symtab->p_shdr.sh_link,
-				sym.st_name);
+			    p_symtab->p_shdr.sh_link, sym.st_name);
 		if (sym_name == NULL)
 			sym_name = (char *)UNKNOWN;
 		(void) printf("%s\n", sym_name);
@@ -663,12 +670,14 @@
 		(void) printf("[%d]\t", index++);
 		if (!v_flag) {
 			(void) printf("%u\t%llu\t",
-			EC_WORD(p->p_shdr.sh_type),
-			EC_XWORD(p->p_shdr.sh_flags));
+			    EC_WORD(p->p_shdr.sh_type),
+			    EC_XWORD(p->p_shdr.sh_flags));
 		} else {
+			Conv_inv_buf_t inv_buf;
+
 			/*LINTED: E_SEC_PRINTF_VAR_FMT*/
 			(void) printf(conv_sec_type(p_ehdr.e_machine,
-				p->p_shdr.sh_type, DUMP_CONVFMT));
+			    p->p_shdr.sh_type, DUMP_CONVFMT, &inv_buf));
 			(void) printf("    ");
 
 			if (p->p_shdr.sh_flags & SHF_WRITE)
@@ -693,17 +702,17 @@
 
 		}
 		(void) printf("%-#*llx%-#*llx%-#*llx%s%s\n",
-			field, EC_ADDR(p->p_shdr.sh_addr),
-			field, EC_OFF(p->p_shdr.sh_offset),
-			field, EC_XWORD(p->p_shdr.sh_size),
-			/* compatibility:  tab for elf32 */
-			(field == 13) ? "\t" : " ", p->scn_name);
+		    field, EC_ADDR(p->p_shdr.sh_addr),
+		    field, EC_OFF(p->p_shdr.sh_offset),
+		    field, EC_XWORD(p->p_shdr.sh_size),
+		    /* compatibility:  tab for elf32 */
+		    (field == 13) ? "\t" : " ", p->scn_name);
 
 		(void) printf("\t%u\t%u\t%-#*llx%-#*llx\n\n",
-			EC_WORD(p->p_shdr.sh_link),
-			EC_WORD(p->p_shdr.sh_info),
-			field, EC_XWORD(p->p_shdr.sh_addralign),
-			field, EC_XWORD(p->p_shdr.sh_entsize));
+		    EC_WORD(p->p_shdr.sh_link),
+		    EC_WORD(p->p_shdr.sh_info),
+		    field, EC_XWORD(p->p_shdr.sh_addralign),
+		    field, EC_XWORD(p->p_shdr.sh_entsize));
 	}
 }
 
@@ -720,21 +729,21 @@
 {
 	if (((size_t)low > bound) || (low <= 0)) {
 		(void) fprintf(stderr,
-			"%s: %s: number out of range, %d\n",
-			prog_name, filename, low);
+		    "%s: %s: number out of range, %d\n",
+		    prog_name, filename, low);
 		return (-1);
 	}
 	if (((size_t)hi > bound) || (hi < 0)) {
 		(void) fprintf(stderr,
-			"%s: %s: number out of range, %d\n",
-			prog_name, filename, hi);
-			return (-1);
+		    "%s: %s: number out of range, %d\n",
+		    prog_name, filename, hi);
+		return (-1);
 	}
 
 	if (hi && (low > hi)) {
 		(void) fprintf(stderr,
-			"%s: %s: invalid range, %d,%d\n",
-			prog_name, filename, low, hi);
+		    "%s: %s: invalid range, %d,%d\n",
+		    prog_name, filename, low, hi);
 		return (-1);
 	}
 	if (hi)
@@ -788,8 +797,8 @@
 
 	if (elf_getshnum(elf_file, &shnum) == 0) {
 		(void) fprintf(stderr,
-			"%s: %s: elf_getshnum failed: %s\n",
-			prog_name, filename, elf_errmsg(-1));
+		    "%s: %s: elf_getshnum failed: %s\n",
+		    prog_name, filename, elf_errmsg(-1));
 		return;
 	}
 
@@ -797,10 +806,10 @@
 	    /* LINTED */
 	    (p_scns->p_shdr.sh_link >= (GElf_Word)shnum)) {
 		(void) fprintf(stderr, "%s: %s: invalid sh_link field: "
-			"section #: %d sh_link: %d\n",
-			/* LINTED */
-			prog_name, filename, (int)elf_ndxscn(p_scns->p_sd),
-			(int)p_scns->p_shdr.sh_link);
+		    "section #: %d sh_link: %d\n",
+		    /* LINTED */
+		    prog_name, filename, (int)elf_ndxscn(p_scns->p_sd),
+		    (int)p_scns->p_shdr.sh_link);
 		return;
 	}
 	head_scns += (p_scns->p_shdr.sh_link -1);
@@ -849,16 +858,16 @@
 		if (n_flag) {
 			rn_flag = 1;
 			print_rela(elf_file, p_scns, rel_data, sym_data, p_ehdr,
-				reloc_size, sym_size, filename, reloc_symtab);
+			    reloc_size, sym_size, filename, reloc_symtab);
 		}
 		if (d_flag) {
 			rn_flag = 0;
 			print_rela(elf_file, p_scns, rel_data, sym_data, p_ehdr,
-				reloc_size, sym_size, filename, reloc_symtab);
+			    reloc_size, sym_size, filename, reloc_symtab);
 		}
 		if (!n_flag && !d_flag)
 			print_rela(elf_file, p_scns, rel_data, sym_data, p_ehdr,
-				reloc_size, sym_size, filename, reloc_symtab);
+			    reloc_size, sym_size, filename, reloc_symtab);
 	} else {
 		if (p_scns->p_shdr.sh_type == SHT_REL) {
 			if (!n_flag && r_flag)
@@ -877,19 +886,19 @@
 			if (n_flag) {
 				rn_flag = 1;
 				print_rel(elf_file, p_scns, rel_data, sym_data,
-					p_ehdr, reloc_size, sym_size,
-					filename, reloc_symtab);
+				    p_ehdr, reloc_size, sym_size,
+				    filename, reloc_symtab);
 			}
 			if (d_flag) {
 				rn_flag = 0;
 				print_rel(elf_file, p_scns, rel_data, sym_data,
-					p_ehdr, reloc_size, sym_size,
-					filename, reloc_symtab);
+				    p_ehdr, reloc_size, sym_size,
+				    filename, reloc_symtab);
 			}
 			if (!n_flag && !d_flag)
 				print_rel(elf_file, p_scns, rel_data, sym_data,
-					p_ehdr, reloc_size, sym_size,
-					filename, reloc_symtab);
+				    p_ehdr, reloc_size, sym_size,
+				    filename, reloc_symtab);
 		}
 	}
 	p_scns++;
@@ -1018,7 +1027,7 @@
 "\n              ***** SYMBOL TABLE INFORMATION *****\n");
 					(void) printf(
 "[Index]  %-*s%-*sType\tBind\tOther\tShndx\tName",
-			    12 + adj, "Value", 9 + adj, "Size");
+					    12 + adj, "Value", 9 + adj, "Size");
 				}
 				(void) printf("\n%s:\n", p_symtab->scn_name);
 				print_symtab(elf_file, p_symtab, sym_data,
@@ -1027,7 +1036,7 @@
 		}   /* end for */
 		if (!found_it) {
 			(void) fprintf(stderr, "%s: %s: %s not found\n",
-			prog_name, filename, name);
+			    prog_name, filename, name);
 		}
 	} else if (T_flag) {
 		T_num = check_range(T_low, T_hi, count, filename);
@@ -1110,9 +1119,17 @@
 
 		(void) gelf_getdyn(dyn_data, ii++, &p_dyn);
 		while (p_dyn.d_tag != DT_NULL) {
+			union {
+				Conv_inv_buf_t		inv;
+				Conv_dyn_flag_buf_t	dyn_flag;
+				Conv_dyn_flag1_buf_t	dyn_flag1;
+				Conv_dyn_feature1_buf_t	dyn_feature1;
+				Conv_dyn_posflag1_buf_t	dyn_posflag1;
+			} conv_buf;
+
 			(void) printf("[%d]\t%-15.15s ", index++,
-				conv_dyn_tag(p_dyn.d_tag, p_ehdr.e_machine,
-				DUMP_CONVFMT));
+			    conv_dyn_tag(p_dyn.d_tag, p_ehdr.e_machine,
+			    DUMP_CONVFMT, &conv_buf.inv));
 
 			/*
 			 * It would be nice to use a table driven loop
@@ -1155,7 +1172,7 @@
 			case DT_VERDEFNUM:
 			case DT_VERNEED:
 				(void) printf(pdyn_Fmtptr,
-					EC_ADDR(p_dyn.d_un.d_ptr));
+				    EC_ADDR(p_dyn.d_un.d_ptr));
 				break;
 
 			/*
@@ -1175,13 +1192,13 @@
 			case DT_FILTER:
 				if (v_flag) {	/* Look up the string */
 					str = (char *)elf_strptr(elf_file, link,
-						p_dyn.d_un.d_ptr);
+					    p_dyn.d_un.d_ptr);
 					if (!(str && *str))
 						str = (char *)UNKNOWN;
 					(void) printf("%s", str);
 				} else {	/* Show the address */
 					(void) printf(pdyn_Fmtptr,
-						EC_ADDR(p_dyn.d_un.d_ptr));
+					    EC_ADDR(p_dyn.d_un.d_ptr));
 				}
 				break;
 
@@ -1211,7 +1228,7 @@
 			case DT_SUNW_TLSSORTSZ:
 			case DT_SUNW_STRPAD:
 				(void) printf(pdyn_Fmtptr,
-					EC_XWORD(p_dyn.d_un.d_val));
+				    EC_XWORD(p_dyn.d_un.d_val));
 				break;
 
 			/*
@@ -1226,22 +1243,26 @@
 					switch (p_dyn.d_tag) {
 					case DT_FLAGS:
 						str = conv_dyn_flag(
-							p_dyn.d_un.d_val,
-							DUMP_CONVFMT);
-					break;
+						    p_dyn.d_un.d_val,
+						    DUMP_CONVFMT,
+						    &conv_buf.dyn_flag);
+						break;
 					case DT_FEATURE_1:
 						str = conv_dyn_feature1(
-							p_dyn.d_un.d_val,
-							DUMP_CONVFMT);
+						    p_dyn.d_un.d_val,
+						    DUMP_CONVFMT,
+						    &conv_buf.dyn_feature1);
 						break;
 					case DT_POSFLAG_1:
 						str = conv_dyn_posflag1(
-							p_dyn.d_un.d_val,
-							DUMP_CONVFMT);
+						    p_dyn.d_un.d_val,
+						    DUMP_CONVFMT,
+						    &conv_buf.dyn_posflag1);
 						break;
 					case DT_FLAGS_1:
 						str = conv_dyn_flag1(
-							p_dyn.d_un.d_val);
+						    p_dyn.d_un.d_val,
+						    &conv_buf.dyn_flag1);
 						break;
 					}
 				}
@@ -1249,7 +1270,7 @@
 					(void) printf("%s", str);
 				} else {	/* Numeric form */
 					(void) printf(pdyn_Fmtptr,
-						EC_ADDR(p_dyn.d_un.d_ptr));
+					    EC_ADDR(p_dyn.d_un.d_ptr));
 				}
 				break;
 
@@ -1258,8 +1279,8 @@
 			 */
 			case DT_DEPRECATED_SPARC_REGISTER:
 				(void) printf(pdyn_Fmtptr
-					"  (deprecated value)",
-					EC_XWORD(p_dyn.d_un.d_val));
+				    "  (deprecated value)",
+				    EC_XWORD(p_dyn.d_un.d_val));
 				break;
 
 			/* Ignored items */
@@ -1332,42 +1353,43 @@
 
 	if (!v_flag) {
 		(void) printf("%-*d%-11d%-*d%-12d%d\n",
-			field, elf_head_p->e_ident[4],
-			elf_head_p->e_ident[5],
-			field, (int)elf_head_p->e_type,
-			(int)elf_head_p->e_machine,
-			elf_head_p->e_version);
+		    field, elf_head_p->e_ident[4], elf_head_p->e_ident[5],
+		    field, (int)elf_head_p->e_type, (int)elf_head_p->e_machine,
+		    elf_head_p->e_version);
 	} else {
+		Conv_inv_buf_t	inv_buf;
+
 		(void) printf("%-*s", field,
-			conv_ehdr_class(class, DUMP_CONVFMT));
+		    conv_ehdr_class(class, DUMP_CONVFMT, &inv_buf));
 		(void) printf("%-11s",
-			conv_ehdr_data(elf_head_p->e_ident[5], DUMP_CONVFMT));
+		    conv_ehdr_data(elf_head_p->e_ident[5], DUMP_CONVFMT,
+		    &inv_buf));
 		(void) printf("%-*s", field,
-			conv_ehdr_type(elf_head_p->e_type, DUMP_CONVFMT));
+		    conv_ehdr_type(elf_head_p->e_type, DUMP_CONVFMT, &inv_buf));
 		(void) printf("%-12s",
-			conv_ehdr_mach(elf_head_p->e_machine, DUMP_CONVFMT));
+		    conv_ehdr_mach(elf_head_p->e_machine, DUMP_CONVFMT,
+		    &inv_buf));
 		(void) printf("%s\n",
-			conv_ehdr_vers(elf_head_p->e_version, DUMP_CONVFMT));
+		    conv_ehdr_vers(elf_head_p->e_version, DUMP_CONVFMT,
+		    &inv_buf));
 	}
 	(void) printf("%-#*llx%-#11llx%-#*llx%-#12x%#x\n",
-		field, EC_ADDR(elf_head_p->e_entry),
-		EC_OFF(elf_head_p->e_phoff),
-		field, EC_OFF(elf_head_p->e_shoff),
-		EC_WORD(elf_head_p->e_flags),
-		EC_WORD(elf_head_p->e_ehsize));
+	    field, EC_ADDR(elf_head_p->e_entry), EC_OFF(elf_head_p->e_phoff),
+	    field, EC_OFF(elf_head_p->e_shoff), EC_WORD(elf_head_p->e_flags),
+	    EC_WORD(elf_head_p->e_ehsize));
 	if (!v_flag || (elf_head_p->e_shstrndx != SHN_XINDEX)) {
 		(void) printf("%-#*x%-11u%-#*x%-12u%u\n",
-			field, EC_WORD(elf_head_p->e_phentsize),
-			EC_WORD(elf_head_p->e_phnum),
-			field, EC_WORD(elf_head_p->e_shentsize),
-			EC_WORD(elf_head_p->e_shnum),
-			EC_WORD(elf_head_p->e_shstrndx));
+		    field, EC_WORD(elf_head_p->e_phentsize),
+		    EC_WORD(elf_head_p->e_phnum),
+		    field, EC_WORD(elf_head_p->e_shentsize),
+		    EC_WORD(elf_head_p->e_shnum),
+		    EC_WORD(elf_head_p->e_shstrndx));
 	} else {
 		(void) printf("%-#*x%-11u%-#*x%-12uXINDEX\n",
-			field, EC_WORD(elf_head_p->e_phentsize),
-			EC_WORD(elf_head_p->e_phnum),
-			field, EC_WORD(elf_head_p->e_shentsize),
-			EC_WORD(elf_head_p->e_shnum));
+		    field, EC_WORD(elf_head_p->e_phentsize),
+		    EC_WORD(elf_head_p->e_phnum),
+		    field, EC_WORD(elf_head_p->e_shentsize),
+		    EC_WORD(elf_head_p->e_shnum));
 	}
 	if ((elf_head_p->e_shnum == 0) && (elf_head_p->e_shoff > 0)) {
 		Elf_Scn		*scn;
@@ -1392,32 +1414,32 @@
 		}
 		if ((scn = elf_getscn(elf_file, 0)) == NULL) {
 			(void) fprintf(stderr,
-				"%s: %s: elf_getscn failed: %s\n",
-				prog_name, filename, elf_errmsg(-1));
+			    "%s: %s: elf_getscn failed: %s\n",
+			    prog_name, filename, elf_errmsg(-1));
 			return (NULL);
 		}
 		if (gelf_getshdr(scn, &shdr0) == 0) {
 			(void) fprintf(stderr,
-				"%s: %s: gelf_getshdr: %s\n",
-				prog_name, filename, elf_errmsg(-1));
+			    "%s: %s: gelf_getshdr: %s\n",
+			    prog_name, filename, elf_errmsg(-1));
 			return (NULL);
 		}
 		(void) printf("[0]\t%u\t%llu\t", EC_WORD(shdr0.sh_type),
-			EC_XWORD(shdr0.sh_flags));
+		    EC_XWORD(shdr0.sh_flags));
 
 		(void) printf("%-#*llx %-#*llx%-*llu%s%-*u\n",
-			field, EC_ADDR(shdr0.sh_addr),
-			field, EC_OFF(shdr0.sh_offset),
-			field, EC_XWORD(shdr0.sh_size),
-			/* compatibility:  tab for elf32 */
-			((field == 13) ? "\t" : "  "),
-			field, EC_WORD(shdr0.sh_name));
+		    field, EC_ADDR(shdr0.sh_addr),
+		    field, EC_OFF(shdr0.sh_offset),
+		    field, EC_XWORD(shdr0.sh_size),
+		    /* compatibility:  tab for elf32 */
+		    ((field == 13) ? "\t" : "  "),
+		    field, EC_WORD(shdr0.sh_name));
 
 		(void) printf("\t%u\t%u\t%-#*llx %-#*llx\n",
-			EC_WORD(shdr0.sh_link),
-			EC_WORD(shdr0.sh_info),
-			field, EC_XWORD(shdr0.sh_addralign),
-			field, EC_XWORD(shdr0.sh_entsize));
+		    EC_WORD(shdr0.sh_link),
+		    EC_WORD(shdr0.sh_info),
+		    field, EC_XWORD(shdr0.sh_addralign),
+		    field, EC_XWORD(shdr0.sh_entsize));
 	}
 	(void) printf("\n");
 
@@ -1518,13 +1540,13 @@
 			else {
 				found_it = 1;
 				print_section(elf_file, p_ehdr,
-					n_range, 1, filename);
+				    n_range, 1, filename);
 			}
 		}
 
 		if (!found_it) {
 			(void) fprintf(stderr, "%s: %s: %s not found\n",
-				prog_name, filename, name);
+			    prog_name, filename, name);
 		}
 	} /* end n_flag */
 
@@ -1590,7 +1612,7 @@
 
 		if (!found_it) {
 			(void) fprintf(stderr, "%s: %s: %s not found\n",
-				prog_name, filename, name);
+			    prog_name, filename, name);
 		}
 	} /* end n_flag */
 
@@ -1635,20 +1657,20 @@
 
 	if (elf_getshnum(elf_file, &shnum) == 0) {
 		(void) fprintf(stderr,
-			"%s: %s: elf_getshnum failed: %s\n",
-			prog_name, filename, elf_errmsg(-1));
+		    "%s: %s: elf_getshnum failed: %s\n",
+		    prog_name, filename, elf_errmsg(-1));
 		return;
 	}
 	if (elf_getshstrndx(elf_file, &shstrndx) == 0) {
 		(void) fprintf(stderr,
-			"%s: %s: elf_getshstrndx failed: %s\n",
-			prog_name, filename, elf_errmsg(-1));
+		    "%s: %s: elf_getshstrndx failed: %s\n",
+		    prog_name, filename, elf_errmsg(-1));
 		return;
 	}
 
 	if ((buffer = calloc(shnum, sizeof (SCNTAB))) == NULL) {
 		(void) fprintf(stderr, "%s: %s: cannot calloc space\n",
-			prog_name, filename);
+		    prog_name, filename);
 		return;
 	}
 	/* LINTED */
@@ -1662,11 +1684,12 @@
 	while ((scn = elf_nextscn(elf_file, scn)) != 0) {
 		if ((gelf_getshdr(scn, &buffer->p_shdr)) == 0) {
 			(void) fprintf(stderr,
-			"%s: %s: %s\n", prog_name, filename, elf_errmsg(-1));
+			    "%s: %s: %s\n", prog_name, filename,
+			    elf_errmsg(-1));
 			return;
 		}
-		s_name = (char *)elf_strptr(elf_file,
-			shstrndx, buffer->p_shdr.sh_name);
+		s_name = (char *)
+		    elf_strptr(elf_file, shstrndx, buffer->p_shdr.sh_name);
 		buffer->scn_name = s_name ? s_name : (char *)UNKNOWN;
 		buffer->p_sd   =  scn;
 
@@ -1694,14 +1717,14 @@
 	}
 	if (r_flag) {
 		dump_reloc_table(elf_file, elf_head_p,
-			p_scns, num_scns, filename);
+		    p_scns, num_scns, filename);
 	}
 	if (L_flag) {
 		dump_dynamic(elf_file, p_scns, num_scns, filename);
 	}
 	if (s_flag) {
 		dump_section(elf_file, elf_head_p, p_scns,
-			num_scns, filename);
+		    num_scns, filename);
 	}
 }
 
@@ -1736,12 +1759,12 @@
 		here = elf_getbase(elf_file);
 		if ((lseek(fd, here, 0)) != here) {
 			(void) fprintf(stderr,
-			"%s: %s: could not lseek\n", prog_name, filename);
+			    "%s: %s: could not lseek\n", prog_name, filename);
 		}
 
 		if ((read(fd, STL_entry->strings, p_ar->ar_size)) == -1) {
 			(void) fprintf(stderr,
-			"%s: %s: could not read\n", prog_name, filename);
+			    "%s: %s: could not read\n", prog_name, filename);
 		}
 	}
 	return (STabList);
@@ -1774,7 +1797,8 @@
 		p_ar = elf_getarhdr(arf);
 		if (p_ar == NULL) {
 			(void) fprintf(stderr,
-			"%s: %s: %s\n", prog_name, filename, elf_errmsg(-1));
+			    "%s: %s: %s\n", prog_name, filename,
+			    elf_errmsg(-1));
 			continue;
 		}
 		if (strcmp(p_ar->ar_name, "/") == 0) {
@@ -1782,15 +1806,14 @@
 				ar_sym_read(elf_file, filename);
 		} else if (strcmp(p_ar->ar_name, "//") == 0) {
 			StringTableList = load_arstring_table(
-				StringTableList, fd, arf, p_ar,
-				filename);
+			    StringTableList, fd, arf, p_ar, filename);
 			cmd = elf_next(arf);
 			(void) elf_end(arf);
 			continue;
 		} else {
 			if (a_flag) {
 				(void) printf("%s[%s]:\n", filename,
-					p_ar->ar_name);
+				    p_ar->ar_name);
 				if (!p_flag && title == 0) {
 					if (!v_flag)
 						(void) printf(
@@ -1805,12 +1828,10 @@
 				if (!v_flag) {
 					(void) printf(
 "\t0x%.8lx  %6d  %6d  0%.6ho  0x%.8lx  %-s\n\n",
-						p_ar->ar_date,
-						(int)p_ar->ar_uid,
-						(int)p_ar->ar_gid,
-						(int)p_ar->ar_mode,
-						p_ar->ar_size,
-						p_ar->ar_name);
+					    p_ar->ar_date, (int)p_ar->ar_uid,
+					    (int)p_ar->ar_gid,
+					    (int)p_ar->ar_mode,
+					    p_ar->ar_size, p_ar->ar_name);
 				} else {
 					if ((strftime(buf, DATESIZE,
 					    "%b %d %H:%M:%S %Y",
@@ -1821,13 +1842,11 @@
 						exit(1);
 					}
 					(void) printf(
-					"\t%s %6d %6d 0%.6ho 0x%.8lx %-s\n\n",
-						buf,
-						(int)p_ar->ar_uid,
-						(int)p_ar->ar_gid,
-						(int)p_ar->ar_mode,
-						p_ar->ar_size,
-						p_ar->ar_name);
+"\t%s %6d %6d 0%.6ho 0x%.8lx %-s\n\n",
+					    buf, (int)p_ar->ar_uid,
+					    (int)p_ar->ar_gid,
+					    (int)p_ar->ar_mode,
+					    p_ar->ar_size, p_ar->ar_name);
 				}
 			}
 		}
@@ -1838,7 +1857,7 @@
 	err = elf_errno();
 	if (err != 0) {
 		(void) fprintf(stderr,
-		"%s: %s: %s\n", prog_name, filename, elf_errmsg(err));
+		    "%s: %s: %s\n", prog_name, filename, elf_errmsg(err));
 	}
 }
 
@@ -1863,13 +1882,12 @@
 
 		p_ar = elf_getarhdr(arf);
 		if (p_ar == NULL) {
-			(void) fprintf(stderr,
-				"%s: %s: %s\n",
-				prog_name, filename, elf_errmsg(-1));
+			(void) fprintf(stderr, "%s: %s: %s\n",
+			    prog_name, filename, elf_errmsg(-1));
 			return;
 		}
 		if ((strcmp(p_ar->ar_name, "/") == 0) ||
-			(strcmp(p_ar->ar_name, "//") == 0)) {
+		    (strcmp(p_ar->ar_name, "//") == 0)) {
 			cmd = elf_next(arf);
 			(void) elf_end(arf);
 			continue;
@@ -1887,13 +1905,12 @@
 				return;
 			if (o_flag)
 				dump_exec_header(arf,
-					(unsigned)elf_head.e_phnum, fullname);
+				    (unsigned)elf_head.e_phnum, fullname);
 			if (x_flag)
 				dump_section_table(arf, &elf_head, fullname);
 		} else {
-			(void) fprintf(stderr,
-				"%s: %s: invalid file type\n",
-				prog_name, fullname);
+			(void) fprintf(stderr, "%s: %s: invalid file type\n",
+			    prog_name, fullname);
 			cmd = elf_next(arf);
 			(void) elf_end(arf);
 			continue;
--- a/usr/src/cmd/sgs/elfdump/common/elfdump.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/elfdump/common/elfdump.c	Thu Jul 26 08:45:42 2007 -0700
@@ -433,6 +433,7 @@
 unwind(Cache *cache, Word shnum, Word phnum, Ehdr *ehdr, const char *file,
     Elf *elf)
 {
+	Conv_dwarf_ehe_buf_t	dwarf_ehe_buf;
 	Word	cnt;
 	Phdr	*uphdr = 0;
 
@@ -484,7 +485,6 @@
 		if ((uphdr && (shdr->sh_addr == uphdr->p_vaddr)) ||
 		    (strncmp(_cache->c_name, MSG_ORIG(MSG_SCN_FRMHDR),
 		    MSG_SCN_FRMHDR_SIZE) == 0)) {
-
 			dbg_print(0, MSG_ORIG(MSG_UNW_FRMHDR));
 			ndx = 0;
 
@@ -499,15 +499,17 @@
 			    ehdr->e_ident, shdr->sh_addr + ndx);
 
 			dbg_print(0, MSG_ORIG(MSG_UNW_FRPTRENC),
-			    conv_dwarf_ehe(frame_ptr_enc), EC_XWORD(frame_ptr));
+			    conv_dwarf_ehe(frame_ptr_enc, &dwarf_ehe_buf),
+			    EC_XWORD(frame_ptr));
 
 			fde_cnt = dwarf_ehe_extract(data, &ndx, fde_cnt_enc,
 			    ehdr->e_ident, shdr->sh_addr + ndx);
 
 			dbg_print(0, MSG_ORIG(MSG_UNW_FDCNENC),
-			    conv_dwarf_ehe(fde_cnt_enc), EC_XWORD(fde_cnt));
+			    conv_dwarf_ehe(fde_cnt_enc, &dwarf_ehe_buf),
+			    EC_XWORD(fde_cnt));
 			dbg_print(0, MSG_ORIG(MSG_UNW_TABENC),
-			    conv_dwarf_ehe(table_enc));
+			    conv_dwarf_ehe(table_enc, &dwarf_ehe_buf));
 			dbg_print(0, MSG_ORIG(MSG_UNW_BINSRTAB1));
 			dbg_print(0, MSG_ORIG(MSG_UNW_BINSRTAB2));
 
@@ -606,7 +608,8 @@
 						dbg_print(0,
 						    MSG_ORIG(MSG_UNW_CIEAXPERS),
 						    ciePflag,
-						    conv_dwarf_ehe(ciePflag),
+						    conv_dwarf_ehe(ciePflag,
+						    &dwarf_ehe_buf),
 						    EC_XWORD(persVal));
 						break;
 					case 'R':
@@ -614,7 +617,8 @@
 						ndx += 1;
 						dbg_print(0,
 						    MSG_ORIG(MSG_UNW_CIEAXCENC),
-						    val, conv_dwarf_ehe(val));
+						    val, conv_dwarf_ehe(val,
+						    &dwarf_ehe_buf));
 						cieRflag = val;
 						break;
 					case 'L':
@@ -622,7 +626,8 @@
 						ndx += 1;
 						dbg_print(0,
 						    MSG_ORIG(MSG_UNW_CIEAXLSDA),
-						    val, conv_dwarf_ehe(val));
+						    val, conv_dwarf_ehe(val,
+						    &dwarf_ehe_buf));
 						cieLflag = val;
 						break;
 					default:
@@ -1447,6 +1452,7 @@
 	uchar_t		type;
 	Shdr		*tshdr;
 	Word		shndx;
+	Conv_inv_buf_t	inv_buf;
 
 	/* Ensure symbol index is in range */
 	if (symndx >= state->symn) {
@@ -1480,7 +1486,7 @@
 		 * The section names are not available, so all we can
 		 * do is to display them in numeric form.
 		 */
-		sec = conv_sym_shndx(sym->st_shndx);
+		sec = conv_sym_shndx(sym->st_shndx, &inv_buf);
 	} else if ((sym->st_shndx < SHN_LORESERVE) &&
 	    (sym->st_shndx < state->shnum)) {
 		shndx = sym->st_shndx;
@@ -1669,6 +1675,7 @@
 	Word		*ndx;
 	Word		ndxn;
 	int		output_cnt = 0;
+	Conv_inv_buf_t	inv_buf;
 
 	for (sortsecndx = 1; sortsecndx < shnum; sortsecndx++) {
 
@@ -1733,7 +1740,7 @@
 		default:
 			(void) fprintf(stderr, MSG_INTL(MSG_ERR_BADNDXSEC),
 			    file, sortcache->c_name, conv_sec_type(
-			    ehdr->e_machine, symshdr->sh_type, 0));
+			    ehdr->e_machine, symshdr->sh_type, 0, &inv_buf));
 			continue;
 		}
 
@@ -1806,6 +1813,7 @@
 		Cache		*_cache = &cache[cnt];
 		Shdr		*shdr = _cache->c_shdr;
 		char		*relname = _cache->c_name;
+		Conv_inv_buf_t	inv_buf;
 
 		if (((type = shdr->sh_type) != SHT_RELA) &&
 		    (type != SHT_REL))
@@ -1909,7 +1917,8 @@
 				if (badrel) {
 					(void) fprintf(stderr,
 					    MSG_INTL(MSG_ERR_BADREL1), file,
-					    conv_reloc_type(mach, reltype, 0));
+					    conv_reloc_type(mach, reltype,
+					    0, &inv_buf));
 				}
 			}
 
@@ -1961,6 +1970,12 @@
 		Elf_dyn_title(0);
 
 		for (ndx = 0; ndx < numdyn; dyn++, ndx++) {
+			union {
+				Conv_dyn_flag_buf_t	flag;
+				Conv_dyn_flag1_buf_t	flag1;
+				Conv_dyn_posflag1_buf_t	posflag1;
+				Conv_dyn_feature1_buf_t	feature1;
+			} c_buf;
 			const char	*name;
 
 			/*
@@ -2004,16 +2019,20 @@
 				break;
 
 			case DT_FLAGS:
-				name = conv_dyn_flag(dyn->d_un.d_val, 0);
+				name = conv_dyn_flag(dyn->d_un.d_val,
+				    0, &c_buf.flag);
 				break;
 			case DT_FLAGS_1:
-				name = conv_dyn_flag1(dyn->d_un.d_val);
+				name = conv_dyn_flag1(dyn->d_un.d_val,
+				    &c_buf.flag1);
 				break;
 			case DT_POSFLAG_1:
-				name = conv_dyn_posflag1(dyn->d_un.d_val, 0);
+				name = conv_dyn_posflag1(dyn->d_un.d_val, 0,
+				    &c_buf.posflag1);
 				break;
 			case DT_FEATURE_1:
-				name = conv_dyn_feature1(dyn->d_un.d_val, 0);
+				name = conv_dyn_feature1(dyn->d_un.d_val, 0,
+				    &c_buf.feature1);
 				break;
 			case DT_DEPRECATED_SPARC_REGISTER:
 				name = MSG_INTL(MSG_STR_DEPRECATED);
@@ -3184,7 +3203,8 @@
 	 * Print the program headers.
 	 */
 	if ((flags & FLG_PHDR) && (phnum != 0)) {
-		Phdr *phdr;
+		Conv_inv_buf_t	inv_buf;
+		Phdr		*phdr;
 
 		if ((phdr = elf_getphdr(elf)) == NULL) {
 			failure(file, MSG_ORIG(MSG_ELF_GETPHDR));
@@ -3193,7 +3213,7 @@
 
 		for (ndx = 0; ndx < phnum; phdr++, ndx++) {
 			if (!match(0, conv_phdr_type(ehdr->e_machine,
-			    phdr->p_type, CONV_FMT_ALTFILE), ndx))
+			    phdr->p_type, CONV_FMT_ALTFILE, &inv_buf), ndx))
 				continue;
 
 			dbg_print(0, MSG_ORIG(MSG_STR_EMPTY));
--- a/usr/src/cmd/sgs/include/conv.h	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/include/conv.h	Thu Jul 26 08:45:42 2007 -0700
@@ -64,25 +64,453 @@
 #define	CONF_FEATMSK	0xffff00
 
 /*
+ * Buffer types:
+ *
+ * Many of the routines in this module require the user to supply a
+ * buffer into which the desired strings may be written. These are
+ * all arrays of characters, and might be defined as simple arrays
+ * of char. The problem with that approach is that when such an array
+ * is passed to a function, the C language considers it to have the
+ * type (char *), without any regard to its length. Not all of our
+ * buffers have the same length, and we want to ensure that the compiler
+ * will refuse to compile code that passes the wrong type of buffer to
+ * a given routine. The solution is to define the buffers as unions
+ * that contain the needed array, and then to pass the given union
+ * by address. The compiler will catch attempts to pass the wrong type
+ * of pointer, and the size of a structure/union is implicit in its type.
+ *
+ * A nice side effect of this approach is that we can use a union with
+ * multiple buffers to handle the cases where a given routine needs
+ * more than one type of buffer. The end result is a single buffer large
+ * enough to handle any of the subcases, but no larger.
+ */
+
+/*
+ * Size of buffer used by conv_invalid_val():
+ *
  * Various values that can't be matched to a symbolic definition are converted
- * to a numeric string.  Each function that may require this fallback maintains
- * its own static string buffer, as many conversion routines may be called for
- * one final diagnostic.  See conv_invalid_val().
+ * to a numeric string.
+ *
+ * The buffer size reflects the maximum number of digits needed to
+ * display an integer as text, plus a trailing null, and with room for
+ * a leading "0x" if hexidecimal display is selected.
+ */
+#define	CONV32_INV_BUFSIZE	12
+typedef union {
+	char			buf[CONV32_INV_BUFSIZE];
+} Conv32_inv_buf_t;
+
+#define	CONV64_INV_BUFSIZE	22
+typedef union {
+	char			buf[CONV64_INV_BUFSIZE];
+} Conv64_inv_buf_t;
+
+
+
+/* conv_ehdr_flags() */
+#define	CONF_EHDR_FLAGS_BASE_BUFSIZE	69
+#define	CONV32_EHDR_FLAGS_BUFSIZE	\
+	(CONF_EHDR_FLAGS_BASE_BUFSIZE + CONV32_INV_BUFSIZE)
+typedef union {
+	Conv32_inv_buf_t	inv_buf;
+	char			buf[CONV32_EHDR_FLAGS_BUFSIZE];
+} Conv32_ehdr_flags_buf_t;
+
+#define	CONV64_EHDR_FLAGS_BUFSIZE	\
+	(CONF_EHDR_FLAGS_BASE_BUFSIZE + CONV64_INV_BUFSIZE)
+typedef union {
+	Conv64_inv_buf_t	inv_buf;
+	char			buf[CONV64_EHDR_FLAGS_BUFSIZE];
+} Conv64_ehdr_flags_buf_t;
+
+
+/* conv_reject_desc() */
+typedef union {
+	Conv32_inv_buf_t	inv_buf;
+	Conv32_ehdr_flags_buf_t	flags_buf;
+} Conv32_reject_desc_buf_t;
+
+typedef union {
+	Conv64_inv_buf_t	inv_buf;
+	Conv64_ehdr_flags_buf_t	flags_buf;
+} Conv64_reject_desc_buf_t;
+
+
+/*
+ * conv_cap_val_hw1()
+ *
+ * This size is based on the maximum number of hardware capabilities
+ * that exist.  See common/elfcap.
+ */
+#define	CONV_CAP_VAL_HW1_BUFSIZE	195
+
+typedef union {
+	Conv32_inv_buf_t	inv_buf;
+	char			buf[CONV_CAP_VAL_HW1_BUFSIZE];
+} Conv32_cap_val_hw1_buf_t;
+
+typedef union {
+	Conv64_inv_buf_t	inv_buf;
+	char			buf[CONV_CAP_VAL_HW1_BUFSIZE];
+} Conv64_cap_val_hw1_buf_t;
+
+
+/*
+ * conv_cap_val_sf1()
  *
- * The string size reflects the largest possible decimal number plus a trailing
- * null.  Typically however, values are hex with a leading "0x".
+ * This size is based on the maximum number of software capabilities
+ * that exist.  See common/elfcap.
+ */
+#define	CONV_CAP_VAL_SF1_BUFSIZE	45
+
+typedef union {
+	Conv32_inv_buf_t	inv_buf;
+	char			buf[CONV_CAP_VAL_SF1_BUFSIZE];
+} Conv32_cap_val_sf1_buf_t;
+
+typedef union {
+	Conv64_inv_buf_t	inv_buf;
+	char			buf[CONV_CAP_VAL_SF1_BUFSIZE];
+} Conv64_cap_val_sf1_buf_t;
+
+
+
+/* conv_cap_val_buf() */
+typedef union {
+	Conv32_inv_buf_t		inv_buf;
+	Conv32_cap_val_hw1_buf_t	cap_val_hw1_buf;
+	Conv32_cap_val_sf1_buf_t	cap_val_sf1_buf;
+} Conv32_cap_val_buf_t;
+
+typedef union {
+	Conv64_inv_buf_t		inv_buf;
+	Conv64_cap_val_hw1_buf_t	cap_val_hw1_buf;
+	Conv64_cap_val_sf1_buf_t	cap_val_sf1_buf;
+} Conv64_cap_val_buf_t;
+
+
+/* conv_config_feat() */
+#define	CONV_CONFIG_FEAT_BUFSIZE	195
+
+typedef union {
+	Conv32_inv_buf_t	inv_buf;
+	char			buf[CONV_CONFIG_FEAT_BUFSIZE];
+} Conv32_config_feat_buf_t;
+
+typedef union {
+	Conv64_inv_buf_t	inv_buf;
+	char			buf[CONV_CONFIG_FEAT_BUFSIZE];
+} Conv64_config_feat_buf_t;
+
+
+/* conv_config_obj() */
+#define	CONV_CONFIG_OBJ_BUFSIZE		154
+
+typedef union {
+	Conv32_inv_buf_t	inv_buf;
+	char			buf[CONV_CONFIG_OBJ_BUFSIZE];
+} Conv32_config_obj_buf_t;
+
+typedef union {
+	Conv64_inv_buf_t	inv_buf;
+	char			buf[CONV_CONFIG_OBJ_BUFSIZE];
+} Conv64_config_obj_buf_t;
+
+
+/* conv_dl_mode() */
+#define	CONV_DL_MODE_BUFSIZE		122
+
+typedef union {
+	Conv32_inv_buf_t	inv_buf;
+	char			buf[CONV_DL_MODE_BUFSIZE];
+} Conv32_dl_mode_buf_t;
+
+typedef union {
+	Conv64_inv_buf_t	inv_buf;
+	char			buf[CONV_DL_MODE_BUFSIZE];
+} Conv64_dl_mode_buf_t;
+
+
+/* conv_dl_flag() */
+#define	CONV_DL_FLAG_BUFSIZE		195
+
+typedef union {
+	Conv32_inv_buf_t	inv_buf;
+	char			buf[CONV_DL_FLAG_BUFSIZE];
+} Conv32_dl_flag_buf_t;
+
+typedef union {
+	Conv64_inv_buf_t	inv_buf;
+	char			buf[CONV_DL_FLAG_BUFSIZE];
+} Conv64_dl_flag_buf_t;
+
+
+/* conv_grphdl_flags() */
+#define	CONV_GRPHDL_FLAGS_BUFSIZE	80
+
+typedef union {
+	Conv32_inv_buf_t	inv_buf;
+	char			buf[CONV_GRPHDL_FLAGS_BUFSIZE];
+} Conv32_grphdl_flags_buf_t;
+
+typedef union {
+	Conv64_inv_buf_t	inv_buf;
+	char			buf[CONV_GRPHDL_FLAGS_BUFSIZE];
+} Conv64_grphdl_flags_buf_t;
+
+
+/* conv_grpdesc_flags() */
+#define	CONV_GRPDESC_FLAGS_BUFSIZE	80
+
+typedef union {
+	Conv32_inv_buf_t	inv_buf;
+	char			buf[CONV_GRPDESC_FLAGS_BUFSIZE];
+} Conv32_grpdesc_flags_buf_t;
+
+typedef union {
+	Conv64_inv_buf_t	inv_buf;
+	char			buf[CONV_GRPDESC_FLAGS_BUFSIZE];
+} Conv64_grpdesc_flags_buf_t;
+
+
+/* conv_seg_flags() */
+#define	CONV_SEG_FLAGS_BUFSIZE		186
+
+typedef union {
+	Conv32_inv_buf_t	inv_buf;
+	char			buf[CONV_SEG_FLAGS_BUFSIZE];
+} Conv32_seg_flags_buf_t;
+
+typedef union {
+	Conv64_inv_buf_t	inv_buf;
+	char			buf[CONV_SEG_FLAGS_BUFSIZE];
+} Conv64_seg_flags_buf_t;
+
+
+/* conv_dyn_posflag1() */
+#define	CONF_DYN_POSFLAG1_BASE_BUFSIZE	23
+#define	CONV32_DYN_POSFLAG1_BUFSIZE	\
+	(CONF_DYN_POSFLAG1_BASE_BUFSIZE + CONV32_INV_BUFSIZE)
+typedef union {
+	Conv32_inv_buf_t	inv_buf;
+	char			buf[CONV32_DYN_POSFLAG1_BUFSIZE];
+} Conv32_dyn_posflag1_buf_t;
+
+#define	CONV64_DYN_POSFLAG1_BUFSIZE	\
+	(CONF_DYN_POSFLAG1_BASE_BUFSIZE + CONV64_INV_BUFSIZE)
+typedef union {
+	Conv64_inv_buf_t	inv_buf;
+	char			buf[CONV64_DYN_POSFLAG1_BUFSIZE];
+} Conv64_dyn_posflag1_buf_t;
+
+
+/* conv_dyn_flag() */
+#define	CONF_DYN_FLAG_BASE_BUFSIZE	48
+#define	CONV32_DYN_FLAG_BUFSIZE	\
+	(CONF_DYN_FLAG_BASE_BUFSIZE + CONV32_INV_BUFSIZE)
+typedef union {
+	Conv32_inv_buf_t	inv_buf;
+	char			buf[CONV32_DYN_FLAG_BUFSIZE];
+} Conv32_dyn_flag_buf_t;
+
+#define	CONV64_DYN_FLAG_BUFSIZE	\
+	(CONF_DYN_FLAG_BASE_BUFSIZE + CONV64_INV_BUFSIZE)
+typedef union {
+	Conv64_inv_buf_t	inv_buf;
+	char			buf[CONV64_DYN_FLAG_BUFSIZE];
+} Conv64_dyn_flag_buf_t;
+
+
+/* conv_dyn_flag1() */
+#define	CONF_DYN_FLAG1_BASE_BUFSIZE	223
+#define	CONV32_DYN_FLAG1_BUFSIZE	\
+	(CONF_DYN_FLAG1_BASE_BUFSIZE + CONV32_INV_BUFSIZE)
+typedef union {
+	Conv32_inv_buf_t	inv_buf;
+	char			buf[CONV32_DYN_FLAG1_BUFSIZE];
+} Conv32_dyn_flag1_buf_t;
+
+#define	CONV64_DYN_FLAG1_BUFSIZE	\
+	(CONF_DYN_FLAG1_BASE_BUFSIZE + CONV64_INV_BUFSIZE)
+typedef union {
+	Conv64_inv_buf_t	inv_buf;
+	char			buf[CONV64_DYN_FLAG1_BUFSIZE];
+} Conv64_dyn_flag1_buf_t;
+
+
+/* conv_dyn_feature1() */
+#define	CONF_DYN_FEATURE1_BASE_BUFSIZE	20
+#define	CONV32_DYN_FEATURE1_BUFSIZE	\
+	(CONF_DYN_FEATURE1_BASE_BUFSIZE + CONV32_INV_BUFSIZE)
+typedef union {
+	Conv32_inv_buf_t	inv_buf;
+	char			buf[CONV32_DYN_FEATURE1_BUFSIZE];
+} Conv32_dyn_feature1_buf_t;
+
+#define	CONV64_DYN_FEATURE1_BUFSIZE	\
+	(CONF_DYN_FEATURE1_BASE_BUFSIZE + CONV64_INV_BUFSIZE)
+typedef union {
+	Conv64_inv_buf_t	inv_buf;
+	char			buf[CONV64_DYN_FEATURE1_BUFSIZE];
+} Conv64_dyn_feature1_buf_t;
+
+
+/* conv_bnd_type() */
+#define	CONF_BND_TYPE_BASE_BUFSIZE	29
+#define	CONV32_BND_TYPE_BUFSIZE	\
+	(CONF_BND_TYPE_BASE_BUFSIZE + CONV32_INV_BUFSIZE)
+typedef union {
+	Conv32_inv_buf_t	inv_buf;
+	char			buf[CONV32_BND_TYPE_BUFSIZE];
+} Conv32_bnd_type_buf_t;
+
+#define	CONV64_BND_TYPE_BUFSIZE	\
+	(CONF_BND_TYPE_BASE_BUFSIZE + CONV64_INV_BUFSIZE)
+typedef union {
+	Conv64_inv_buf_t	inv_buf;
+	char			buf[CONV64_BND_TYPE_BUFSIZE];
+} Conv64_bnd_type_buf_t;
+
+
+/* conv_bnd_obj() */
+#define	CONF_BND_OBJ_BASE_BUFSIZE	38
+#define	CONV32_BND_OBJ_BUFSIZE	\
+	(CONF_BND_OBJ_BASE_BUFSIZE + CONV32_INV_BUFSIZE)
+typedef union {
+	Conv32_inv_buf_t	inv_buf;
+	char			buf[CONV32_BND_OBJ_BUFSIZE];
+} Conv32_bnd_obj_buf_t;
+
+#define	CONV64_BND_OBJ_BUFSIZE	\
+	(CONF_BND_OBJ_BASE_BUFSIZE + CONV64_INV_BUFSIZE)
+typedef union {
+	Conv64_inv_buf_t	inv_buf;
+	char			buf[CONV64_BND_OBJ_BUFSIZE];
+} Conv64_bnd_obj_buf_t;
+
+
+/* conv_phdr_flags() */
+#define	CONF_PHDR_FLAGS_BASE_BUFSIZE	35
+#define	CONV32_PHDR_FLAGS_BUFSIZE	\
+	(CONF_PHDR_FLAGS_BASE_BUFSIZE + CONV32_INV_BUFSIZE)
+typedef union {
+	Conv32_inv_buf_t	inv_buf;
+	char			buf[CONV32_PHDR_FLAGS_BUFSIZE];
+} Conv32_phdr_flags_buf_t;
+
+#define	CONV64_PHDR_FLAGS_BUFSIZE	\
+	(CONF_PHDR_FLAGS_BASE_BUFSIZE + CONV64_INV_BUFSIZE)
+typedef union {
+	Conv64_inv_buf_t	inv_buf;
+	char			buf[CONV64_PHDR_FLAGS_BUFSIZE];
+} Conv64_phdr_flags_buf_t;
+
+
+/* conv_sec_flags() */
+#define	CONF_SEC_FLAGS_BASE_BUFSIZE	168
+#define	CONV32_SEC_FLAGS_BUFSIZE	\
+	(CONF_SEC_FLAGS_BASE_BUFSIZE + CONV32_INV_BUFSIZE)
+typedef union {
+	Conv32_inv_buf_t	inv_buf;
+	char			buf[CONV32_SEC_FLAGS_BUFSIZE];
+} Conv32_sec_flags_buf_t;
+
+#define	CONV64_SEC_FLAGS_BUFSIZE	\
+	(CONF_SEC_FLAGS_BASE_BUFSIZE + CONV64_INV_BUFSIZE)
+typedef union {
+	Conv64_inv_buf_t	inv_buf;
+	char			buf[CONV64_SEC_FLAGS_BUFSIZE];
+} Conv64_sec_flags_buf_t;
+
+
+/* conv_dwarf_ehe() */
+#define	CONV_DWARF_EHE_BUFSIZE		33
+typedef union {
+	Conv32_inv_buf_t	inv_buf;
+	char			buf[CONV_DWARF_EHE_BUFSIZE];
+} Conv32_dwarf_ehe_buf_t;
+typedef union {
+	Conv64_inv_buf_t	inv_buf;
+	char			buf[CONV_DWARF_EHE_BUFSIZE];
+} Conv64_dwarf_ehe_buf_t;
+
+
+
+/*
+ * Generic names for class specific buffer types above
  */
 #if	defined(_ELF64)
-#define	CONV_INV_STRSIZE	22
+#define	CONV_INV_BUFSIZE		CONV64_INV_BUFSIZE
+#define	CONV_EHDR_FLAGS_BUFSIZE		CONV64_EHDR_FLAGS_BUFSIZE
+#define	CONV_DYN_POSFLAG1_BUFSIZE	CONV64_DYN_POSFLAG1_BUFSIZE
+#define	CONV_DYN_FLAG_BUFSIZE		CONV64_DYN_FLAG_BUFSIZE
+#define	CONV_DYN_FLAG1_BUFSIZE		CONV64_DYN_FLAG1_BUFSIZE
+#define	CONV_DYN_FEATURE1_BUFSIZE	CONV64_DYN_FEATURE1_BUFSIZE
+#define	CONV_BND_TYPE_BUFSIZE		CONV64_BND_TYPE_BUFSIZE
+#define	CONV_BND_OBJ_BUFSIZE		CONV64_BND_OBJ_BUFSIZE
+#define	CONV_PHDR_FLAGS_BUFSIZE		CONV64_PHDR_FLAGS_BUFSIZE
+#define	CONV_SEC_FLAGS_BUFSIZE		CONV64_SEC_FLAGS_BUFSIZE
+
+#define	Conv_inv_buf_t			Conv64_inv_buf_t
+#define	Conv_ehdr_flags_buf_t		Conv64_ehdr_flags_buf_t
+#define	Conv_reject_desc_buf_t		Conv64_reject_desc_buf_t
+#define	Conv_cap_val_hw1_buf_t		Conv64_cap_val_hw1_buf_t
+#define	Conv_cap_val_sf1_buf_t		Conv64_cap_val_sf1_buf_t
+#define	Conv_cap_val_buf_t		Conv64_cap_val_buf_t
+#define	Conv_config_feat_buf_t		Conv64_config_feat_buf_t
+#define	Conv_config_obj_buf_t		Conv64_config_obj_buf_t
+#define	Conv_dl_mode_buf_t		Conv64_dl_mode_buf_t
+#define	Conv_dl_flag_buf_t		Conv64_dl_flag_buf_t
+#define	Conv_grphdl_flags_buf_t		Conv64_grphdl_flags_buf_t
+#define	Conv_grpdesc_flags_buf_t	Conv64_grpdesc_flags_buf_t
+#define	Conv_seg_flags_buf_t		Conv64_seg_flags_buf_t
+#define	Conv_dyn_posflag1_buf_t		Conv64_dyn_posflag1_buf_t
+#define	Conv_dyn_flag_buf_t		Conv64_dyn_flag_buf_t
+#define	Conv_dyn_flag1_buf_t		Conv64_dyn_flag1_buf_t
+#define	Conv_dyn_feature1_buf_t		Conv64_dyn_feature1_buf_t
+#define	Conv_bnd_type_buf_t		Conv64_bnd_type_buf_t
+#define	Conv_bnd_obj_buf_t		Conv64_bnd_obj_buf_t
+#define	Conv_phdr_flags_buf_t		Conv64_phdr_flags_buf_t
+#define	Conv_sec_flags_buf_t		Conv64_sec_flags_buf_t
+#define	Conv_dwarf_ehe_buf_t		Conv64_dwarf_ehe_buf_t
 #else
-#define	CONV_INV_STRSIZE	12
+#define	CONV_INV_BUFSIZE		CONV32_INV_BUFSIZE
+#define	CONV_EHDR_FLAGS_BUFSIZE		CONV32_EHDR_FLAGS_BUFSIZE
+#define	CONV_DYN_POSFLAG1_BUFSIZE	CONV32_DYN_POSFLAG1_BUFSIZE
+#define	CONV_DYN_FLAG_BUFSIZE		CONV32_DYN_FLAG_BUFSIZE
+#define	CONV_DYN_FLAG1_BUFSIZE		CONV32_DYN_FLAG1_BUFSIZE
+#define	CONV_DYN_FEATURE1_BUFSIZE	CONV32_DYN_FEATURE1_BUFSIZE
+#define	CONV_BND_TYPE_BUFSIZE		CONV32_BND_TYPE_BUFSIZE
+#define	CONV_BND_OBJ_BUFSIZE		CONV32_BND_OBJ_BUFSIZE
+#define	CONV_PHDR_FLAGS_BUFSIZE		CONV32_PHDR_FLAGS_BUFSIZE
+#define	CONV_SEC_FLAGS_BUFSIZE		CONV32_SEC_FLAGS_BUFSIZE
+
+#define	Conv_inv_buf_t			Conv32_inv_buf_t
+#define	Conv_ehdr_flags_buf_t		Conv32_ehdr_flags_buf_t
+#define	Conv_reject_desc_buf_t		Conv32_reject_desc_buf_t
+#define	Conv_cap_val_hw1_buf_t		Conv32_cap_val_hw1_buf_t
+#define	Conv_cap_val_sf1_buf_t		Conv32_cap_val_sf1_buf_t
+#define	Conv_cap_val_buf_t		Conv32_cap_val_buf_t
+#define	Conv_config_feat_buf_t		Conv32_config_feat_buf_t
+#define	Conv_config_obj_buf_t		Conv32_config_obj_buf_t
+#define	Conv_dl_mode_buf_t		Conv32_dl_mode_buf_t
+#define	Conv_dl_flag_buf_t		Conv32_dl_flag_buf_t
+#define	Conv_grphdl_flags_buf_t		Conv32_grphdl_flags_buf_t
+#define	Conv_grpdesc_flags_buf_t	Conv32_grpdesc_flags_buf_t
+#define	Conv_seg_flags_buf_t		Conv32_seg_flags_buf_t
+#define	Conv_dyn_posflag1_buf_t		Conv32_dyn_posflag1_buf_t
+#define	Conv_dyn_flag_buf_t		Conv32_dyn_flag_buf_t
+#define	Conv_dyn_flag1_buf_t		Conv32_dyn_flag1_buf_t
+#define	Conv_dyn_feature1_buf_t		Conv32_dyn_feature1_buf_t
+#define	Conv_bnd_type_buf_t		Conv32_bnd_type_buf_t
+#define	Conv_bnd_obj_buf_t		Conv32_bnd_obj_buf_t
+#define	Conv_phdr_flags_buf_t		Conv32_phdr_flags_buf_t
+#define	Conv_sec_flags_buf_t		Conv32_sec_flags_buf_t
+#define	Conv_dwarf_ehe_buf_t		Conv32_dwarf_ehe_buf_t
 #endif
 
-/*
- * Some libconv routines require the caller to supply the buffer used by
- * conv_invalid_val().
- */
-typedef char Conv_inv_buf_t[CONV_INV_STRSIZE];
+
+
 
 /*
  * Flags that alter standard formatting for conversion routines.
@@ -155,25 +583,26 @@
  * Define all generic interfaces.
  */
 extern	uchar_t		conv_check_native(char **, char **);
-extern	const char	*conv_config_feat(int);
-extern	const char	*conv_config_obj(ushort_t);
+extern	const char	*conv_config_feat(int, Conv_config_feat_buf_t *);
+extern	const char	*conv_config_obj(ushort_t, Conv_config_obj_buf_t *);
 extern	const char	*conv_config_upm(const char *, const char *,
 			    const char *, size_t);
-extern	const char	*conv_def_tag(Symref);
+extern	const char	*conv_def_tag(Symref, Conv_inv_buf_t *);
 extern	const char	*conv_demangle_name(const char *);
-extern	const char	*conv_dl_flag(int, int);
-extern	const char	*conv_dl_mode(int, int);
-extern	const char	*conv_dwarf_ehe(uint_t);
-extern	const char	*conv_elfdata_type(Elf_Type);
-extern	const char	*conv_grphdl_flags(uint_t);
-extern	const char	*conv_grpdesc_flags(uint_t);
+extern	const char	*conv_dl_flag(int, int, Conv_dl_flag_buf_t *);
+extern	const char	*conv_dl_mode(int, int, Conv_dl_mode_buf_t *);
+extern	const char	*conv_dwarf_ehe(uint_t, Conv_dwarf_ehe_buf_t *);
+extern	const char	*conv_elfdata_type(Elf_Type, Conv_inv_buf_t *);
+extern	const char	*conv_grphdl_flags(uint_t, Conv_grphdl_flags_buf_t *);
+extern	const char	*conv_grpdesc_flags(uint_t, Conv_grpdesc_flags_buf_t *);
 extern	Isa_desc	*conv_isalist(void);
 extern	const char	*conv_lddstub(int);
-extern	const char	*conv_seg_flags(Half);
+extern	const char	*conv_seg_flags(Half, Conv_seg_flags_buf_t *);
 extern	int		conv_sys_eclass();
 extern	Uts_desc	*conv_uts(void);
 extern	const char	*conv_ver_flags(Half);
-extern	const char	*conv_ver_index(Versym, int);
+extern	const char	*conv_ver_index(Versym, int, Conv_inv_buf_t *);
+
 
 /*
  * Define all class specific routines.
@@ -203,6 +632,7 @@
 #define	conv_phdr_type		conv64_phdr_type
 #define	conv_reject_desc	conv64_reject_desc
 #define	conv_reloc_type		conv64_reloc_type
+#define	conv_reloc_type_static	conv64_reloc_type_static
 #define	conv_reloc_386_type	conv64_reloc_386_type
 #define	conv_reloc_amd64_type	conv64_reloc_amd64_type
 #define	conv_reloc_SPARC_type	conv64_reloc_SPARC_type
@@ -240,6 +670,7 @@
 #define	conv_phdr_type		conv32_phdr_type
 #define	conv_reject_desc	conv32_reject_desc
 #define	conv_reloc_type		conv32_reloc_type
+#define	conv_reloc_type_static	conv32_reloc_type_static
 #define	conv_reloc_386_type	conv32_reloc_386_type
 #define	conv_reloc_amd64_type	conv32_reloc_amd64_type
 #define	conv_reloc_SPARC_type	conv32_reloc_SPARC_type
@@ -254,42 +685,48 @@
 #define	conv_sym_SPARC_value	conv32_sym_SPARC_value
 #endif
 
-extern	const char	*conv_bnd_obj(uint_t);
-extern	const char	*conv_bnd_type(uint_t);
-extern	const char	*conv_cap_tag(Xword);
-extern	const char	*conv_cap_val(Xword, Xword, Half);
-extern	const char	*conv_cap_val_hw1(Xword, Half);
-extern	const char	*conv_cap_val_sf1(Xword, Half);
-extern	const char	*conv_dyn_flag1(Xword);
-extern	const char	*conv_dyn_flag(Xword, int);
-extern	const char	*conv_dyn_posflag1(Xword, int);
-extern	const char	*conv_dyn_tag(Xword, Half, int);
-extern	const char	*conv_dyn_feature1(Xword, int);
-extern	const char	*conv_ehdr_class(uchar_t, int);
-extern	const char	*conv_ehdr_data(uchar_t, int);
-extern	const char	*conv_ehdr_flags(Half, Word);
-extern	const char	*conv_ehdr_mach(Half, int);
-extern	const char	*conv_ehdr_osabi(uchar_t, int);
-extern	const char	*conv_ehdr_type(Half, int);
-extern	const char	*conv_ehdr_vers(Word, int);
+extern	const char	*conv_bnd_obj(uint_t, Conv_bnd_obj_buf_t *);
+extern	const char	*conv_bnd_type(uint_t, Conv_bnd_type_buf_t *);
+extern	const char	*conv_cap_tag(Xword, Conv_inv_buf_t *);
+extern	const char	*conv_cap_val(Xword, Xword, Half, Conv_cap_val_buf_t *);
+extern	const char	*conv_cap_val_hw1(Xword, Half,
+			    Conv_cap_val_hw1_buf_t *);
+extern	const char	*conv_cap_val_sf1(Xword, Half,
+			    Conv_cap_val_sf1_buf_t *);
+extern	const char	*conv_dyn_flag1(Xword, Conv_dyn_flag1_buf_t *);
+extern	const char	*conv_dyn_flag(Xword, int, Conv_dyn_flag_buf_t *);
+extern	const char	*conv_dyn_posflag1(Xword, int,
+			    Conv_dyn_posflag1_buf_t *);
+extern	const char	*conv_dyn_tag(Xword, Half, int, Conv_inv_buf_t *);
+extern	const char	*conv_dyn_feature1(Xword, int,
+			    Conv_dyn_feature1_buf_t *);
+extern	const char	*conv_ehdr_class(uchar_t, int, Conv_inv_buf_t *);
+extern	const char	*conv_ehdr_data(uchar_t, int, Conv_inv_buf_t *);
+extern	const char	*conv_ehdr_flags(Half, Word, Conv_ehdr_flags_buf_t *);
+extern	const char	*conv_ehdr_mach(Half, int, Conv_inv_buf_t *);
+extern	const char	*conv_ehdr_osabi(uchar_t, int, Conv_inv_buf_t *);
+extern	const char	*conv_ehdr_type(Half, int, Conv_inv_buf_t *);
+extern	const char	*conv_ehdr_vers(Word, int, Conv_inv_buf_t *);
 extern	int		conv_expn_field(CONV_EXPN_FIELD_ARG *);
-extern	const char	*conv_invalid_val(char *, size_t, Xword, int);
-extern	const char	*conv_phdr_flags(Word);
-extern	const char	*conv_phdr_type(Half, Word, int);
-extern	const char	*conv_reject_desc(Rej_desc *);
-extern	const char	*conv_reloc_type(Half, Word, int);
-extern	const char	*conv_reloc_386_type(Word, int);
-extern	const char	*conv_reloc_amd64_type(Word, int);
-extern	const char	*conv_reloc_SPARC_type(Word, int);
-extern	const char	*conv_sec_flags(Xword);
-extern	const char	*conv_sec_linkinfo(Word, Xword, Conv_inv_buf_t);
-extern	const char	*conv_sec_type(Half, Word, int);
-extern	const char	*conv_sym_info_bind(uchar_t, int);
-extern	const char	*conv_sym_info_type(Half, uchar_t, int);
-extern	const char	*conv_sym_shndx(Half);
-extern	const char	*conv_sym_other(uchar_t);
-extern	const char	*conv_sym_value(Half, uchar_t, Addr);
-extern	const char	*conv_sym_SPARC_value(Addr, int);
+extern	const char	*conv_invalid_val(Conv_inv_buf_t *, Xword, int);
+extern	const char	*conv_phdr_flags(Word, Conv_phdr_flags_buf_t *);
+extern	const char	*conv_phdr_type(Half, Word, int, Conv_inv_buf_t *);
+extern	const char	*conv_reject_desc(Rej_desc *, Conv_reject_desc_buf_t *);
+extern	const char	*conv_reloc_type(Half, Word, int, Conv_inv_buf_t *);
+extern	const char	*conv_reloc_type_static(Half, Word, int);
+extern	const char	*conv_reloc_386_type(Word, int, Conv_inv_buf_t *);
+extern	const char	*conv_reloc_amd64_type(Word, int, Conv_inv_buf_t *);
+extern	const char	*conv_reloc_SPARC_type(Word, int, Conv_inv_buf_t *);
+extern	const char	*conv_sec_flags(Xword, Conv_sec_flags_buf_t *);
+extern	const char	*conv_sec_linkinfo(Word, Xword, Conv_inv_buf_t *);
+extern	const char	*conv_sec_type(Half, Word, int, Conv_inv_buf_t *);
+extern	const char	*conv_sym_info_bind(uchar_t, int, Conv_inv_buf_t *);
+extern	const char	*conv_sym_info_type(Half, uchar_t, int,
+			    Conv_inv_buf_t *);
+extern	const char	*conv_sym_shndx(Half, Conv_inv_buf_t *);
+extern	const char	*conv_sym_other(uchar_t, Conv_inv_buf_t *);
+extern	const char	*conv_sym_value(Half, uchar_t, Addr, Conv_inv_buf_t *);
+extern	const char	*conv_sym_SPARC_value(Addr, int, Conv_inv_buf_t *);
 
 #ifdef	__cplusplus
 }
--- a/usr/src/cmd/sgs/libconv/common/_conv.h	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/libconv/common/_conv.h	Thu Jul 26 08:45:42 2007 -0700
@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -100,7 +100,7 @@
 #define	DEFINE_conv_map2str \
 static \
 const char * \
-conv_map2str(char *buf, size_t bufsize, int val, int flags, int num_msg, \
+conv_map2str(Conv_inv_buf_t *inv_buf, int val, int flags, int num_msg, \
 	const Msg *msg, const Msg *msg_altdump, const Msg *msg_altfile) \
 { \
 	if ((val >= 0) && (val < num_msg)) { \
@@ -114,7 +114,7 @@
 	} \
 \
 	/* If we get here, it's an unknown value */ \
-	return (conv_invalid_val(buf, bufsize, val, flags)); \
+	return (conv_invalid_val(inv_buf, val, flags)); \
 }
 
 /* # of elements in an array */
--- a/usr/src/cmd/sgs/libconv/common/cap.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/libconv/common/cap.c	Thu Jul 26 08:45:42 2007 -0700
@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 #pragma ident	"%Z%%M%	%I%	%E% SMI"
@@ -57,48 +57,33 @@
 	return (1);
 }
 
-/*
- * Establish a buffer size based on the maximum number of hardware capabilities
- * that exist.  See common/elfcap.
- */
-#define	HW1SZ	200
-
 const char *
-conv_cap_val_hw1(Xword val, Half mach)
+conv_cap_val_hw1(Xword val, Half mach, Conv_cap_val_hw1_buf_t *cap_val_hw1_buf)
 {
-	static char	string[HW1SZ];
-
 	if (val == 0)
 		return (MSG_ORIG(MSG_GBL_ZERO));
 
-	if (conv_cap_1(val, string, HW1SZ, mach, hwcap_1_val2str) == 0)
-		return (conv_invalid_val(string, HW1SZ, val, 0));
-	return ((const char *)string);
+	if (conv_cap_1(val, cap_val_hw1_buf->buf, sizeof (cap_val_hw1_buf->buf),
+	    mach, hwcap_1_val2str) == 0)
+		return (conv_invalid_val(&cap_val_hw1_buf->inv_buf, val, 0));
+	return ((const char *)cap_val_hw1_buf->buf);
 }
 
-/*
- * Establish a buffer size based on the maximum number of software capabilities
- * that exist.  See common/elfcap.
- */
-#define	SF1SZ	50
-
 const char *
-conv_cap_val_sf1(Xword val, Half mach)
+conv_cap_val_sf1(Xword val, Half mach, Conv_cap_val_sf1_buf_t *cap_val_sf1_buf)
 {
-	static char	string[SF1SZ];
-
 	if (val == 0)
 		return (MSG_ORIG(MSG_GBL_ZERO));
 
-	if (conv_cap_1(val, string, SF1SZ, mach, sfcap_1_val2str) == 0)
-		return (conv_invalid_val(string, SF1SZ, val, 0));
-	return ((const char *)string);
+	if (conv_cap_1(val, cap_val_sf1_buf->buf, sizeof (cap_val_sf1_buf->buf),
+	    mach, sfcap_1_val2str) == 0)
+		return (conv_invalid_val(&cap_val_sf1_buf->inv_buf, val, 0));
+	return ((const char *)cap_val_sf1_buf->buf);
 }
 
 const char *
-conv_cap_tag(Xword tag)
+conv_cap_tag(Xword tag, Conv_inv_buf_t *inv_buf)
 {
-	static Conv_inv_buf_t	string;
 	static const Msg	tags[] = {
 		MSG_CA_SUNW_NULL,	MSG_CA_SUNW_HW_1,
 		MSG_CA_SUNW_SF_1
@@ -107,18 +92,18 @@
 	if (tag <= CA_SUNW_SF_1)
 		return (MSG_ORIG(tags[tag]));
 	else
-		return (conv_invalid_val(string, CONV_INV_STRSIZE, tag, 0));
+		return (conv_invalid_val(inv_buf, tag, 0));
 }
 
 const char *
-conv_cap_val(Xword tag, Xword val, Half mach)
+conv_cap_val(Xword tag, Xword val, Half mach, Conv_cap_val_buf_t *cap_val_buf)
 {
-	static Conv_inv_buf_t	string;
-
 	if (tag == CA_SUNW_HW_1)
-		return (conv_cap_val_hw1(val, mach));
+		return (conv_cap_val_hw1(val, mach,
+		    &cap_val_buf->cap_val_hw1_buf));
 	else if (tag == CA_SUNW_SF_1)
-		return (conv_cap_val_sf1(val, mach));
+		return (conv_cap_val_sf1(val, mach,
+		    &cap_val_buf->cap_val_sf1_buf));
 	else
-		return (conv_invalid_val(string, CONV_INV_STRSIZE, val, 0));
+		return (conv_invalid_val(&cap_val_buf->inv_buf, val, 0));
 }
--- a/usr/src/cmd/sgs/libconv/common/config.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/libconv/common/config.c	Thu Jul 26 08:45:42 2007 -0700
@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 #pragma ident	"%Z%%M%	%I%	%E% SMI"
@@ -42,15 +42,27 @@
 		MSG_CONF_MEMRESV_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
 		MSG_CONF_ENVS_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
 		MSG_CONF_FLTR_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
-		CONV_INV_STRSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
+		CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
+
+/*
+ * Ensure that Conv_config_feat_buf_t is large enough:
+ *
+ * FEATSZ is the real minimum size of the buffer required by conv_config_feat().
+ * However, Conv_config_feat_buf_t uses CONV_CONFIG_FEAT_BUFSIZE to set the
+ * buffer size. We do things this way because the definition of FEATSZ uses
+ * information that is not available in the environment of other programs
+ * that include the conv.h header file.
+ */
+#if (CONV_CONFIG_FEAT_BUFSIZE < FEATSZ) && !defined(__lint)
+#error "CONV_CONFIG_FEAT_BUFSIZE is not large enough"
+#endif
 
 /*
  * String conversion routine for configuration file information.
  */
 const char *
-conv_config_feat(int features)
+conv_config_feat(int features, Conv_config_feat_buf_t *config_feat_buf)
 {
-	static	char	string[FEATSZ];
 	static Val_desc	vda[] = {
 		{ CONF_EDLIBPATH,	MSG_ORIG(MSG_CONF_EDLIBPATH) },
 		{ CONF_ESLIBPATH,	MSG_ORIG(MSG_CONF_ESLIBPATH) },
@@ -63,12 +75,14 @@
 		{ CONF_FLTR,		MSG_ORIG(MSG_CONF_FLTR) },
 		{ 0,			0 }
 	};
-	static CONV_EXPN_FIELD_ARG conv_arg = { string, sizeof (string), vda };
+	static CONV_EXPN_FIELD_ARG conv_arg = {
+	    NULL, sizeof (config_feat_buf->buf), vda };
 
+	conv_arg.buf = config_feat_buf->buf;
 	conv_arg.oflags = conv_arg.rflags = features;
 	(void) conv_expn_field(&conv_arg);
 
-	return ((const char *)string);
+	return ((const char *)config_feat_buf->buf);
 }
 
 #define	FLAGSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
@@ -86,15 +100,27 @@
 		MSG_CONF_CMDLINE_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
 		MSG_CONF_FILTER_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
 		MSG_CONF_FILTEE_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
-		CONV_INV_STRSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
+		CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
+
+/*
+ * Ensure that Conv_config_obj_buf_t is large enough:
+ *
+ * FLAGSZ is the real minimum size of the buffer required by conv_config_obj().
+ * However, Conv_config_obj_buf_t uses CONV_CONFIG_OBJ_BUFSIZE to set the
+ * buffer size. We do things this way because the definition of FLAGSZ uses
+ * information that is not available in the environment of other programs
+ * that include the conv.h header file.
+ */
+#if (CONV_CONFIG_OBJ_BUFSIZE < FLAGSZ) && !defined(__lint)
+#error "CONV_CONFIG_OBJ_BUFSIZE is not large enough"
+#endif
 
 /*
  * String conversion routine for object flags.
  */
 const char *
-conv_config_obj(ushort_t flags)
+conv_config_obj(ushort_t flags, Conv_config_obj_buf_t *config_obj_buf)
 {
-	static char	string[FLAGSZ];
 	static Val_desc vda[] = {
 		{ RTC_OBJ_DIRENT,	MSG_ORIG(MSG_CONF_DIRENT) },
 		{ RTC_OBJ_ALLENTS,	MSG_ORIG(MSG_CONF_ALLENTS) },
@@ -112,14 +138,15 @@
 		{ 0,			0 }
 	};
 	static const char *leading_str_arr[2];
-	static CONV_EXPN_FIELD_ARG conv_arg = { string, sizeof (string), vda,
-		leading_str_arr };
+	static CONV_EXPN_FIELD_ARG conv_arg = {
+	    NULL, sizeof (config_obj_buf->buf), vda, leading_str_arr };
 
 	const char **lstr = leading_str_arr;
 
 	if ((flags == 0) || (flags == RTC_OBJ_OPTINAL))
 		return (MSG_ORIG(MSG_GBL_NULL));
 
+	conv_arg.buf = config_obj_buf->buf;
 	conv_arg.rflags = flags;
 
 	/*
@@ -135,7 +162,7 @@
 
 	(void) conv_expn_field(&conv_arg);
 
-	return ((const char *)string);
+	return ((const char *)config_obj_buf->buf);
 }
 
 /*
--- a/usr/src/cmd/sgs/libconv/common/data.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/libconv/common/data.c	Thu Jul 26 08:45:42 2007 -0700
@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -33,9 +33,8 @@
 #include	"data_msg.h"
 
 const char *
-conv_elfdata_type(Elf_Type type)
+conv_elfdata_type(Elf_Type type, Conv_inv_buf_t *inv_buf)
 {
-	static Conv_inv_buf_t	string;
 	static const Msg	types[] = {
 		MSG_DATA_BYTE,		MSG_DATA_ADDR,
 		MSG_DATA_DYN,		MSG_DATA_EHDR,
@@ -51,7 +50,7 @@
 	};
 
 	if (type >= ELF_T_NUM)
-		return (conv_invalid_val(string, CONV_INV_STRSIZE, type, 0));
+		return (conv_invalid_val(inv_buf, type, 0));
 	else
 		return (MSG_ORIG(types[type]));
 }
--- a/usr/src/cmd/sgs/libconv/common/deftag.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/libconv/common/deftag.c	Thu Jul 26 08:45:42 2007 -0700
@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 #pragma ident	"%Z%%M%	%I%	%E% SMI"
@@ -32,15 +32,14 @@
 #include	"deftag_msg.h"
 
 const char *
-conv_def_tag(Symref ref)
+conv_def_tag(Symref ref, Conv_inv_buf_t *inv_buf)
 {
-	static Conv_inv_buf_t	string;
 	static const Msg	refs[] = {
 		MSG_REF_DYN_SEEN,	MSG_REF_DYN_NEED,	MSG_REF_REL_NEED
 	};
 
 	if (ref >= REF_NUM)
-		return (conv_invalid_val(string, CONV_INV_STRSIZE, ref, 0));
+		return (conv_invalid_val(inv_buf, ref, 0));
 	else
 		return (MSG_ORIG(refs[ref]));
 }
--- a/usr/src/cmd/sgs/libconv/common/dl.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/libconv/common/dl.c	Thu Jul 26 08:45:42 2007 -0700
@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 #pragma ident	"%Z%%M%	%I%	%E% SMI"
@@ -39,16 +39,28 @@
 		MSG_RTLD_NODELETE_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
 		MSG_RTLD_FIRST_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
 		MSG_RTLD_CONFGEN_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
-		CONV_INV_STRSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
+		CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
+
 
+/*
+ * Ensure that Conv_dl_mode_buf_t is large enough:
+ *
+ * MODESZ is the real minimum size of the buffer required by conv_dl_mode().
+ * However, Conv_dl_mode_buf_t uses CONV_DL_MODE_BUFSIZE to set the
+ * buffer size. We do things this way because the definition of MODESZ uses
+ * information that is not available in the environment of other programs
+ * that include the conv.h header file.
+ */
+#if (CONV_DL_MODE_BUFSIZE < MODESZ) && !defined(__lint)
+#error "CONV_DL_MODE_BUFSIZE is not large enough"
+#endif
 
 /*
  * String conversion routine for dlopen() attributes.
  */
 const char *
-conv_dl_mode(int mode, int fabricate)
+conv_dl_mode(int mode, int fabricate, Conv_dl_mode_buf_t *dl_mode_buf)
 {
-	static	char	string[MODESZ];
 	static Val_desc vda[] = {
 		{ RTLD_NOLOAD,		MSG_ORIG(MSG_RTLD_NOLOAD) },
 		{ RTLD_PARENT,		MSG_ORIG(MSG_RTLD_PARENT) },
@@ -60,11 +72,12 @@
 		{ 0,			0 }
 	};
 	static const char *leading_str_arr[3];
-	static CONV_EXPN_FIELD_ARG conv_arg = { string, sizeof (string), vda,
-		leading_str_arr };
+	static CONV_EXPN_FIELD_ARG conv_arg = {
+	    NULL, sizeof (dl_mode_buf->buf), vda, leading_str_arr };
 
 	const char **lstr = leading_str_arr;
 
+	conv_arg.buf = dl_mode_buf->buf;
 	conv_arg.oflags = conv_arg.rflags = mode;
 
 
@@ -84,7 +97,7 @@
 
 	(void) conv_expn_field(&conv_arg);
 
-	return ((const char *)string);
+	return ((const char *)dl_mode_buf->buf);
 }
 
 /*
@@ -105,7 +118,20 @@
 		MSG_RTLD_STRIP_SIZE +		MSG_GBL_SEP_SIZE + \
 		MSG_RTLD_NOHEAP_SIZE +		MSG_GBL_SEP_SIZE + \
 		MSG_RTLD_CONFSET_SIZE + \
-		CONV_INV_STRSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
+		CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
+
+/*
+ * Ensure that Conv_dl_flag_buf_t is large enough:
+ *
+ * FLAGSZ is the real minimum size of the buffer required by conv_dl_flag().
+ * However, Conv_dl_flag_buf_t uses CONV_DL_FLAG_BUFSIZE to set the
+ * buffer size. We do things this way because the definition of FLAGSZ uses
+ * information that is not available in the environment of other programs
+ * that include the conv.h header file.
+ */
+#if (CONV_DL_FLAG_BUFSIZE < FLAGSZ) && !defined(__lint)
+#error "CONV_DL_FLAG_BUFSIZE is not large enough"
+#endif
 
 /*
  * String conversion routine for dldump() flags.
@@ -113,9 +139,8 @@
  * we build a "|" separated string.
  */
 const char *
-conv_dl_flag(int flags, int fmt_flags)
+conv_dl_flag(int flags, int fmt_flags, Conv_dl_flag_buf_t *dl_flag_buf)
 {
-	static	char	string[FLAGSZ];
 	static Val_desc vda[] = {
 		{ RTLD_REL_RELATIVE,	MSG_ORIG(MSG_RTLD_REL_RELATIVE) },
 		{ RTLD_REL_EXEC,	MSG_ORIG(MSG_RTLD_REL_EXEC) },
@@ -130,31 +155,30 @@
 		{ 0,			0 }
 	};
 	static const char *leading_str_arr[2];
-	static CONV_EXPN_FIELD_ARG conv_arg = { string, sizeof (string), vda,
-		leading_str_arr };
+	static CONV_EXPN_FIELD_ARG conv_arg = {
+	    NULL, sizeof (dl_flag_buf->buf), vda, leading_str_arr };
 
 	const char **lstr = leading_str_arr;
 
 	if (flags == 0)
 		return (MSG_ORIG(MSG_GBL_ZERO));
 
-
+	conv_arg.buf = dl_flag_buf->buf;
 	if (fmt_flags & CONV_FMT_ALTCRLE) {
 		conv_arg.prefix = conv_arg.suffix = MSG_ORIG(MSG_GBL_QUOTE);
 		conv_arg.sep = MSG_ORIG(MSG_GBL_SEP);
 	} else {		/* Use default delimiters */
-		conv_arg.prefix = conv_arg.suffix =
-			conv_arg.sep = NULL;
+		conv_arg.prefix = conv_arg.suffix = conv_arg.sep = NULL;
 	}
 
 	if ((flags & RTLD_REL_ALL) == RTLD_REL_ALL) {
 		*lstr++ = MSG_ORIG(MSG_RTLD_REL_ALL);
-	    flags &= ~RTLD_REL_ALL;
+		flags &= ~RTLD_REL_ALL;
 	}
 	*lstr = NULL;
 	conv_arg.oflags = conv_arg.rflags = flags;
 
 	(void) conv_expn_field(&conv_arg);
 
-	return ((const char *)string);
+	return ((const char *)dl_flag_buf->buf);
 }
--- a/usr/src/cmd/sgs/libconv/common/dwarf_ehe.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/libconv/common/dwarf_ehe.c	Thu Jul 26 08:45:42 2007 -0700
@@ -20,94 +20,107 @@
  */
 
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 #pragma ident	"%Z%%M%	%I%	%E% SMI"
 
 #include	<strings.h>
 #include	<dwarf.h>
+#include	"_conv.h"
 #include	<dwarf_ehe_msg.h>
-#include	"_conv.h"
 
 #define	FLAGSZ	MSG_GBL_OSQBRKT_SIZE + \
 		MSG_DWEHE_SLEB128_SIZE + \
 		MSG_DWEHE_INDIRECT_SIZE + \
-		CONV_INV_STRSIZE + MSG_GBL_CSQBRKT_SIZE
+		CONV_INV_BUFSIZE + MSG_GBL_CSQBRKT_SIZE
+
+/*
+ * Ensure that Conv_dwarf_ehe_buf_t is large enough:
+ *
+ * FLAGSZ is the real minimum size of the buffer required by conv_dwarf_ehe().
+ * However, Conv_dwarf_ehe_buf_t uses CONV_EHDR_FLAG_BUFSIZE to set the
+ * buffer size. We do things this way because the definition of FLAGSZ uses
+ * information that is not available in the environment of other programs
+ * that include the conv.h header file.
+ */
+#if (CONV_DWARF_EHE_BUFSIZE < FLAGSZ) && !defined(__lint)
+#error "CONV_DWARF_EHE_BUFSIZE is not large enough"
+#endif
 
 const char *
-conv_dwarf_ehe(uint_t flags)
+conv_dwarf_ehe(uint_t flags, Conv_dwarf_ehe_buf_t *dwarf_ehe_buf)
 {
-	static char	string[FLAGSZ];
-	size_t		ret = 0;
+	char	*buf = dwarf_ehe_buf->buf;
+	size_t	ret = 0;
 
-	(void) strncpy(string, MSG_ORIG(MSG_GBL_OSQBRKT), FLAGSZ);
+	(void) strncpy(buf, MSG_ORIG(MSG_GBL_OSQBRKT), FLAGSZ);
 
 	if (flags == DW_EH_PE_omit)
-		ret = strlcat(string, MSG_ORIG(MSG_DWEHE_OMIT), FLAGSZ);
+		ret = strlcat(buf, MSG_ORIG(MSG_DWEHE_OMIT), FLAGSZ);
 	else if (flags == DW_EH_PE_absptr)
-		ret = strlcat(string, MSG_ORIG(MSG_DWEHE_ABSPTR), FLAGSZ);
+		ret = strlcat(buf, MSG_ORIG(MSG_DWEHE_ABSPTR), FLAGSZ);
 
 	if (ret >= FLAGSZ)
-		return (conv_invalid_val(string, FLAGSZ, flags, 0));
+		return (conv_invalid_val(&dwarf_ehe_buf->inv_buf, flags, 0));
 
 	if ((flags == DW_EH_PE_omit) || (flags == DW_EH_PE_absptr)) {
-		(void) strlcat(string, MSG_ORIG(MSG_GBL_CSQBRKT), FLAGSZ);
-		return (string);
+		(void) strlcat(buf, MSG_ORIG(MSG_GBL_CSQBRKT), FLAGSZ);
+		return (buf);
 	}
 
 	switch (flags & 0x0f) {
 	case DW_EH_PE_uleb128:
-		ret = strlcat(string, MSG_ORIG(MSG_DWEHE_ULEB128), FLAGSZ);
+		ret = strlcat(buf, MSG_ORIG(MSG_DWEHE_ULEB128), FLAGSZ);
 		break;
 	case DW_EH_PE_udata2:
-		ret = strlcat(string, MSG_ORIG(MSG_DWEHE_UDATA2), FLAGSZ);
+		ret = strlcat(buf, MSG_ORIG(MSG_DWEHE_UDATA2), FLAGSZ);
 		break;
 	case DW_EH_PE_udata4:
-		ret = strlcat(string, MSG_ORIG(MSG_DWEHE_UDATA4), FLAGSZ);
+		ret = strlcat(buf, MSG_ORIG(MSG_DWEHE_UDATA4), FLAGSZ);
 		break;
 	case DW_EH_PE_udata8:
-		ret = strlcat(string, MSG_ORIG(MSG_DWEHE_UDATA8), FLAGSZ);
+		ret = strlcat(buf, MSG_ORIG(MSG_DWEHE_UDATA8), FLAGSZ);
 		break;
 	case DW_EH_PE_sleb128:
-		ret = strlcat(string, MSG_ORIG(MSG_DWEHE_SLEB128), FLAGSZ);
+		ret = strlcat(buf, MSG_ORIG(MSG_DWEHE_SLEB128), FLAGSZ);
 		break;
 	case DW_EH_PE_sdata2:
-		ret = strlcat(string, MSG_ORIG(MSG_DWEHE_SDATA2), FLAGSZ);
+		ret = strlcat(buf, MSG_ORIG(MSG_DWEHE_SDATA2), FLAGSZ);
 		break;
 	case DW_EH_PE_sdata4:
-		ret = strlcat(string, MSG_ORIG(MSG_DWEHE_SDATA4), FLAGSZ);
+		ret = strlcat(buf, MSG_ORIG(MSG_DWEHE_SDATA4), FLAGSZ);
 		break;
 	case DW_EH_PE_sdata8:
-		ret = strlcat(string, MSG_ORIG(MSG_DWEHE_SDATA8), FLAGSZ);
+		ret = strlcat(buf, MSG_ORIG(MSG_DWEHE_SDATA8), FLAGSZ);
 		break;
 	}
 	if (ret >= FLAGSZ)
-		return (conv_invalid_val(string, FLAGSZ, flags, 0));
+		return (conv_invalid_val(&dwarf_ehe_buf->inv_buf, flags, 0));
 
 	switch (flags & 0xf0) {
 	case DW_EH_PE_pcrel:
-		ret = strlcat(string, MSG_ORIG(MSG_DWEHE_PCREL), FLAGSZ);
+		ret = strlcat(buf, MSG_ORIG(MSG_DWEHE_PCREL), FLAGSZ);
 		break;
 	case DW_EH_PE_textrel:
-		ret = strlcat(string, MSG_ORIG(MSG_DWEHE_TEXTREL), FLAGSZ);
+		ret = strlcat(buf, MSG_ORIG(MSG_DWEHE_TEXTREL), FLAGSZ);
 		break;
 	case DW_EH_PE_datarel:
-		ret = strlcat(string, MSG_ORIG(MSG_DWEHE_DATAREL), FLAGSZ);
+		ret = strlcat(buf, MSG_ORIG(MSG_DWEHE_DATAREL), FLAGSZ);
 		break;
 	case DW_EH_PE_funcrel:
-		ret = strlcat(string, MSG_ORIG(MSG_DWEHE_FUNCREL), FLAGSZ);
+		ret = strlcat(buf, MSG_ORIG(MSG_DWEHE_FUNCREL), FLAGSZ);
 		break;
 	case DW_EH_PE_aligned:
-		ret = strlcat(string, MSG_ORIG(MSG_DWEHE_ALIGNED), FLAGSZ);
+		ret = strlcat(buf, MSG_ORIG(MSG_DWEHE_ALIGNED), FLAGSZ);
 		break;
 	case DW_EH_PE_indirect:
-		ret = strlcat(string, MSG_ORIG(MSG_DWEHE_INDIRECT), FLAGSZ);
+		ret = strlcat(buf, MSG_ORIG(MSG_DWEHE_INDIRECT), FLAGSZ);
 		break;
 	}
 	if (ret >= FLAGSZ)
-		return (conv_invalid_val(string, FLAGSZ, flags, 0));
+		return (conv_invalid_val(&dwarf_ehe_buf->inv_buf, flags, 0));
 
-	(void) strlcat(string, MSG_ORIG(MSG_GBL_CSQBRKT), FLAGSZ);
-	return (string);
+	(void) strlcat(buf, MSG_ORIG(MSG_GBL_CSQBRKT), FLAGSZ);
+	return (buf);
 }
--- a/usr/src/cmd/sgs/libconv/common/dynamic.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/libconv/common/dynamic.c	Thu Jul 26 08:45:42 2007 -0700
@@ -45,26 +45,40 @@
 #define	POSSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
 		MSG_DFP_LAZYLOAD_ALT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
 		MSG_DFP_GROUPPERM_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
-		CONV_INV_STRSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
+		CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
+
+/*
+ * Ensure that Conv_dyn_posflag1_buf_t is large enough:
+ *
+ * POSSZ is the real minimum size of the buffer required by conv_dyn_posflag1().
+ * However, Conv_dyn_posflag1_buf_t uses CONV_DYN_POSFLAG1_BUFSIZE to set the
+ * buffer size. We do things this way because the definition of POSSZ uses
+ * information that is not available in the environment of other programs
+ * that include the conv.h header file.
+ */
+#if CONV_DYN_POSFLAG1_BUFSIZE < POSSZ
+#error "CONV_DYN_POSFLAG1_BUFSIZE is not large enough"
+#endif
 
 const char *
-conv_dyn_posflag1(Xword flags, int fmt_flags)
+conv_dyn_posflag1(Xword flags, int fmt_flags,
+    Conv_dyn_posflag1_buf_t *dyn_posflag1_buf)
 {
-	static char	string[POSSZ];
 	static Val_desc vda[] = {
 		{ DF_P1_LAZYLOAD,	MSG_ORIG(MSG_DFP_LAZYLOAD) },
 		{ DF_P1_GROUPPERM,	MSG_ORIG(MSG_DFP_GROUPPERM) },
 		{ 0,			0 }
 	};
-	static CONV_EXPN_FIELD_ARG conv_arg = { string, sizeof (string), vda };
+	static CONV_EXPN_FIELD_ARG conv_arg = {
+	    NULL, sizeof (dyn_posflag1_buf->buf), vda };
 	static Val_desc vda_alt[] = {
 		{ DF_P1_LAZYLOAD,	MSG_ORIG(MSG_DFP_LAZYLOAD_ALT) },
 		{ DF_P1_GROUPPERM,	MSG_ORIG(MSG_DFP_GROUPPERM) },
 		{ 0,			0 }
 	};
-	static CONV_EXPN_FIELD_ARG conv_arg_alt = { string, sizeof (string),
-		vda_alt, NULL, 0, 0, MSG_ORIG(MSG_STR_EMPTY), NULL,
-		MSG_ORIG(MSG_STR_EMPTY) };
+	static CONV_EXPN_FIELD_ARG conv_arg_alt = {
+	    NULL, sizeof (dyn_posflag1_buf->buf), vda_alt, NULL, 0, 0,
+	    MSG_ORIG(MSG_STR_EMPTY), NULL, MSG_ORIG(MSG_STR_EMPTY) };
 
 	CONV_EXPN_FIELD_ARG *arg;
 
@@ -72,10 +86,11 @@
 		return (MSG_ORIG(MSG_GBL_ZERO));
 
 	arg = (fmt_flags & CONV_FMT_ALTDUMP) ? &conv_arg_alt : &conv_arg;
+	arg->buf = dyn_posflag1_buf->buf;
 	arg->oflags = arg->rflags = flags;
 	(void) conv_expn_field(arg);
 
-	return ((const char *)string);
+	return ((const char *)dyn_posflag1_buf);
 }
 
 #define	FLAGSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
@@ -84,12 +99,24 @@
 		MSG_DF_TEXTREL_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
 		MSG_DF_BIND_NOW_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
 		MSG_DF_STATIC_TLS_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
-		CONV_INV_STRSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
+		CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
+
+/*
+ * Ensure that Conv_dyn_flag_buf_t is large enough:
+ *
+ * FLAGSZ is the real minimum size of the buffer required by conv_dyn_flag().
+ * However, Conv_dyn_flag_buf_t uses CONV_DYN_FLAG_BUFSIZE to set the
+ * buffer size. We do things this way because the definition of FLAGSZ uses
+ * information that is not available in the environment of other programs
+ * that include the conv.h header file.
+ */
+#if CONV_DYN_FLAG_BUFSIZE < FLAGSZ
+#error "CONV_DYN_FLAG_BUFSIZE is not large enough"
+#endif
 
 const char *
-conv_dyn_flag(Xword flags, int fmt_flags)
+conv_dyn_flag(Xword flags, int fmt_flags, Conv_dyn_flag_buf_t *dyn_flag_buf)
 {
-	static char	string[FLAGSZ];
 	static Val_desc vda[] = {
 		{ DF_ORIGIN,		MSG_ORIG(MSG_DF_ORIGIN) },
 		{ DF_SYMBOLIC,		MSG_ORIG(MSG_DF_SYMBOLIC) },
@@ -98,11 +125,13 @@
 		{ DF_STATIC_TLS,	MSG_ORIG(MSG_DF_STATIC_TLS) },
 		{ 0,			0 }
 	};
-	static CONV_EXPN_FIELD_ARG conv_arg = { string, sizeof (string), vda };
+	static CONV_EXPN_FIELD_ARG conv_arg = {
+	    NULL, sizeof (dyn_flag_buf->buf), vda };
 
 	if (flags == 0)
 		return (MSG_ORIG(MSG_GBL_ZERO));
 
+	conv_arg.buf = dyn_flag_buf->buf;
 	conv_arg.oflags = conv_arg.rflags = flags;
 	if (fmt_flags & CONV_FMT_ALTDUMP) {
 		conv_arg.prefix = conv_arg.suffix = MSG_ORIG(MSG_STR_EMPTY);
@@ -111,7 +140,7 @@
 	}
 	(void) conv_expn_field(&conv_arg);
 
-	return ((const char *)string);
+	return ((const char *)dyn_flag_buf->buf);
 }
 
 #define	FLAG1SZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
@@ -139,12 +168,24 @@
 		MSG_DF1_NORELOC_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
 		MSG_DF1_SYMINTPOSE_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
 		MSG_DF1_GLOBAUDIT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
-		CONV_INV_STRSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
+		CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
+
+/*
+ * Ensure that Conv_dyn_flag1_buf_t is large enough:
+ *
+ * FLAG1SZ is the real minimum size of the buffer required by conv_dyn_flag1().
+ * However, Conv_dyn_flag1_buf_t uses CONV_DYN_FLAG1_BUFSIZE to set the
+ * buffer size. We do things this way because the definition of FLAG1SZ uses
+ * information that is not available in the environment of other programs
+ * that include the conv.h header file.
+ */
+#if CONV_DYN_FLAG1_BUFSIZE < FLAG1SZ
+#error "CONV_DYN_FLAG1_BUFSIZE is not large enough"
+#endif
 
 const char *
-conv_dyn_flag1(Xword flags)
+conv_dyn_flag1(Xword flags, Conv_dyn_flag1_buf_t *dyn_flag1_buf)
 {
-	static char	string[FLAG1SZ];
 	static Val_desc vda[] = {
 		{ DF_1_NOW,		MSG_ORIG(MSG_DF1_NOW) },
 		{ DF_1_GLOBAL,		MSG_ORIG(MSG_DF1_GLOBAL) },
@@ -173,36 +214,53 @@
 		{ DF_1_GLOBAUDIT,	MSG_ORIG(MSG_DF1_GLOBAUDIT) },
 		{ 0,			0 }
 	};
-	static CONV_EXPN_FIELD_ARG conv_arg = { string, sizeof (string), vda };
+	static CONV_EXPN_FIELD_ARG conv_arg = {
+	    NULL, sizeof (dyn_flag1_buf->buf), vda };
 
 	if (flags == 0)
 		return (MSG_ORIG(MSG_GBL_ZERO));
 
 	conv_arg.oflags = conv_arg.rflags = flags;
+	conv_arg.buf = dyn_flag1_buf->buf;
 	(void) conv_expn_field(&conv_arg);
 
-	return ((const char *)string);
+	return ((const char *)dyn_flag1_buf->buf);
 }
 
 #define	FEATSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
 		MSG_DTF_PARINIT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
 		MSG_DTF_CONFEXP_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
-		CONV_INV_STRSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
+		CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
+
+/*
+ * Ensure that Conv_dyn_feature1_buf_t is large enough:
+ *
+ * FEATSZ is the real min size of the buffer required by conv_dyn_feature1().
+ * However, Conv_dyn_feature1_buf_t uses CONV_DYN_FEATURE1_BUFSIZE to set the
+ * buffer size. We do things this way because the definition of FEATSZ uses
+ * information that is not available in the environment of other programs
+ * that include the conv.h header file.
+ */
+#if CONV_DYN_FEATURE1_BUFSIZE < FEATSZ
+#error "CONV_DYN_FEATURE1_BUFSIZE is not large enough"
+#endif
 
 const char *
-conv_dyn_feature1(Xword flags, int fmt_flags)
+conv_dyn_feature1(Xword flags, int fmt_flags,
+    Conv_dyn_feature1_buf_t *dyn_feature1_buf)
 {
-	static char	string[FEATSZ];
 	static Val_desc vda[] = {
 		{ DTF_1_PARINIT,	MSG_ORIG(MSG_DTF_PARINIT) },
 		{ DTF_1_CONFEXP,	MSG_ORIG(MSG_DTF_CONFEXP) },
 		{ 0,			0 }
 	};
-	static CONV_EXPN_FIELD_ARG conv_arg = { string, sizeof (string), vda };
+	static CONV_EXPN_FIELD_ARG conv_arg = {
+	    NULL, sizeof (dyn_feature1_buf->buf), vda };
 
 	if (flags == 0)
 		return (MSG_ORIG(MSG_GBL_ZERO));
 
+	conv_arg.buf = dyn_feature1_buf->buf;
 	conv_arg.oflags = conv_arg.rflags = flags;
 	if (fmt_flags & CONV_FMT_ALTDUMP) {
 		conv_arg.prefix = conv_arg.suffix = MSG_ORIG(MSG_STR_EMPTY);
@@ -211,14 +269,12 @@
 	}
 	(void) conv_expn_field(&conv_arg);
 
-	return ((const char *)string);
+	return ((const char *)dyn_feature1_buf->buf);
 }
 
 const char *
-conv_dyn_tag(Xword tag, Half mach, int fmt_flags)
+conv_dyn_tag(Xword tag, Half mach, int fmt_flags, Conv_inv_buf_t *inv_buf)
 {
-	static Conv_inv_buf_t	string;
-
 	/*
 	 * Dynamic tag values are sparse, cover a wide range, and have
 	 * holes. To handle this efficiently, we fall through a series
@@ -344,9 +400,8 @@
 
 
 	if (tag <= DT_FLAGS)
-		return (conv_map2str(string, sizeof (string), tag,
-		    fmt_flags, ARRAY_NELTS(tags_null), tags_null,
-		    tags_null_alt, NULL));
+		return (conv_map2str(inv_buf, tag, fmt_flags,
+		    ARRAY_NELTS(tags_null), tags_null, tags_null_alt, NULL));
 	DYN_RANGE(DT_PREINIT_ARRAY, tags_preinit_array);
 	DYN_RANGE(DT_SUNW_AUXILIARY, tags_sunw_auxiliary);
 	if (tag == DT_SUNW_STRPAD)
@@ -370,7 +425,7 @@
 		return (MSG_ORIG(MSG_DYN_REGISTER));
 
 	/* Unknown item */
-	return (conv_invalid_val(string, CONV_INV_STRSIZE, tag, fmt_flags));
+	return (conv_invalid_val(inv_buf, tag, fmt_flags));
 
 #undef DYN_RANGE
 }
@@ -379,27 +434,41 @@
 		MSG_BND_NEEDED_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
 		MSG_BND_REFER_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
 		MSG_BND_FILTER_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
-		CONV_INV_STRSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
+		CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
+
+/*
+ * Ensure that Conv_bnd_type_buf_t is large enough:
+ *
+ * BINDTSZ is the real minimum size of the buffer required by conv_bnd_type().
+ * However, Conv_bnd_type_buf_t uses CONV_BND_TYPE_BUFSIZE to set the
+ * buffer size. We do things this way because the definition of BINDTSZ uses
+ * information that is not available in the environment of other programs
+ * that include the conv.h header file.
+ */
+#if CONV_BND_TYPE_BUFSIZE < BINDTSZ
+#error "CONV_BND_TYPE_BUFSIZE is not large enough"
+#endif
 
 const char *
-conv_bnd_type(uint_t flags)
+conv_bnd_type(uint_t flags, Conv_bnd_type_buf_t *bnd_type_buf)
 {
-	static char	string[BINDTSZ];
 	static Val_desc vda[] = {
 		{ BND_NEEDED,		MSG_ORIG(MSG_BND_NEEDED) },
 		{ BND_REFER,		MSG_ORIG(MSG_BND_REFER) },
 		{ BND_FILTER,		MSG_ORIG(MSG_BND_FILTER) },
 		{ 0,			0 }
 	};
-	static CONV_EXPN_FIELD_ARG conv_arg = { string, sizeof (string), vda };
+	static CONV_EXPN_FIELD_ARG conv_arg = {
+	    NULL, sizeof (bnd_type_buf->buf), vda };
 
 	if (flags == 0)
 		return (MSG_ORIG(MSG_STR_EMPTY));
 
+	conv_arg.buf = bnd_type_buf->buf;
 	conv_arg.oflags = conv_arg.rflags = flags;
 	(void) conv_expn_field(&conv_arg);
 
-	return ((const char *)string);
+	return ((const char *)bnd_type_buf->buf);
 }
 
 /*
@@ -411,12 +480,24 @@
 #define	BINDOSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
 		MSG_BND_ADDED_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
 		MSG_BND_REEVAL_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
-		CONV_INV_STRSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
+		CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
+
+/*
+ * Ensure that Conv_bnd_obj_buf_t is large enough:
+ *
+ * BINDOSZ is the real minimum size of the buffer required by conv_bnd_obj().
+ * However, Conv_bnd_obj_buf_t uses CONV_BND_OBJ_BUFSIZE to set the
+ * buffer size. We do things this way because the definition of BINDOSZ uses
+ * information that is not available in the environment of other programs
+ * that include the conv.h header file.
+ */
+#if CONV_BND_OBJ_BUFSIZE < BINDOSZ
+#error "CONV_BND_OBJ_BUFSIZE is not large enough"
+#endif
 
 const char *
-conv_bnd_obj(uint_t flags)
+conv_bnd_obj(uint_t flags, Conv_bnd_obj_buf_t *bnd_obj_buf)
 {
-	static char	string[BINDOSZ];
 	static Val_desc vda[] = {
 		{ LML_FLG_OBJADDED,	MSG_ORIG(MSG_BND_ADDED) },
 		{ LML_FLG_OBJREEVAL,	MSG_ORIG(MSG_BND_REEVAL) },
@@ -424,7 +505,8 @@
 		{ LML_FLG_ATEXIT,	MSG_ORIG(MSG_BND_ATEXIT) },
 		{ 0,			0 }
 	};
-	static CONV_EXPN_FIELD_ARG conv_arg = { string, sizeof (string), vda };
+	static CONV_EXPN_FIELD_ARG conv_arg = {
+	    NULL, sizeof (bnd_obj_buf->buf), vda };
 
 	if ((flags & (LML_FLG_OBJADDED | LML_FLG_OBJREEVAL |
 	    LML_FLG_OBJDELETED | LML_FLG_ATEXIT)) == 0)
@@ -435,8 +517,9 @@
 	 * the selected flags are of interest, so we leave conv_arg.rflags
 	 * set to 0.
 	 */
+	conv_arg.buf = bnd_obj_buf->buf;
 	conv_arg.oflags = flags;
 	(void) conv_expn_field(&conv_arg);
 
-	return ((const char *)string);
+	return ((const char *)bnd_obj_buf->buf);
 }
--- a/usr/src/cmd/sgs/libconv/common/elf.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/libconv/common/elf.c	Thu Jul 26 08:45:42 2007 -0700
@@ -42,9 +42,8 @@
 
 
 const char *
-conv_ehdr_class(uchar_t class, int fmt_flags)
+conv_ehdr_class(uchar_t class, int fmt_flags, Conv_inv_buf_t *inv_buf)
 {
-	static Conv_inv_buf_t	string;
 	static const Msg	classes[] = {
 		MSG_ELFCLASSNONE, MSG_ELFCLASS32, MSG_ELFCLASS64
 	};
@@ -52,14 +51,13 @@
 		MSG_ELFCLASSNONE_ALT, MSG_ELFCLASS32_ALT, MSG_ELFCLASS64_ALT
 	};
 
-	return (conv_map2str(string, sizeof (string), class, fmt_flags,
-		ARRAY_NELTS(classes), classes, classes_alt, classes_alt));
+	return (conv_map2str(inv_buf, class, fmt_flags,
+	    ARRAY_NELTS(classes), classes, classes_alt, classes_alt));
 }
 
 const char *
-conv_ehdr_data(uchar_t data, int fmt_flags)
+conv_ehdr_data(uchar_t data, int fmt_flags, Conv_inv_buf_t *inv_buf)
 {
-	static Conv_inv_buf_t	string;
 	static const Msg	datas[] = {
 		MSG_ELFDATANONE, MSG_ELFDATA2LSB, MSG_ELFDATA2MSB
 	};
@@ -70,8 +68,8 @@
 		MSG_ELFDATANONE_ALT, MSG_ELFDATA2LSB_ALT2, MSG_ELFDATA2MSB_ALT2
 	};
 
-	return (conv_map2str(string, sizeof (string), data, fmt_flags,
-		ARRAY_NELTS(datas), datas, datas_dump, datas_file));
+	return (conv_map2str(inv_buf, data, fmt_flags,
+	    ARRAY_NELTS(datas), datas, datas_dump, datas_file));
 }
 
 static const Msg machines[EM_NUM] = {
@@ -147,19 +145,16 @@
 #endif
 
 const char *
-conv_ehdr_mach(Half machine, int fmt_flags)
+conv_ehdr_mach(Half machine, int fmt_flags, Conv_inv_buf_t *inv_buf)
 {
-	static Conv_inv_buf_t	string;
-
-	return (conv_map2str(string, sizeof (string), machine, fmt_flags,
-		ARRAY_NELTS(machines), machines, machines_alt, machines_alt));
+	return (conv_map2str(inv_buf, machine, fmt_flags,
+	    ARRAY_NELTS(machines), machines, machines_alt, machines_alt));
 }
 
 
 const char *
-conv_ehdr_type(Half etype, int fmt_flags)
+conv_ehdr_type(Half etype, int fmt_flags, Conv_inv_buf_t *inv_buf)
 {
-	static Conv_inv_buf_t	string;
 	static const Msg	etypes[] = {
 		MSG_ET_NONE,		MSG_ET_REL,		MSG_ET_EXEC,
 		MSG_ET_DYN,		MSG_ET_CORE
@@ -171,19 +166,18 @@
 
 	if (etype == ET_SUNWPSEUDO) {
 		return ((fmt_flags & CONV_FMTALTMASK)
-			? MSG_ORIG(MSG_ET_SUNWPSEUDO_ALT)
-			: MSG_ORIG(MSG_ET_SUNWPSEUDO));
+		    ? MSG_ORIG(MSG_ET_SUNWPSEUDO_ALT)
+		    : MSG_ORIG(MSG_ET_SUNWPSEUDO));
 	}
 
-	return (conv_map2str(string, sizeof (string), etype, fmt_flags,
-		ARRAY_NELTS(etypes), etypes, etypes_alt, etypes_alt));
+	return (conv_map2str(inv_buf, etype, fmt_flags,
+	    ARRAY_NELTS(etypes), etypes, etypes_alt, etypes_alt));
 
 }
 
 const char *
-conv_ehdr_vers(Word version, int fmt_flags)
+conv_ehdr_vers(Word version, int fmt_flags, Conv_inv_buf_t *inv_buf)
 {
-	static Conv_inv_buf_t	string;
 	static const Msg	versions[] = {
 		MSG_EV_NONE,		MSG_EV_CURRENT
 	};
@@ -191,8 +185,8 @@
 		MSG_EV_NONE_ALT,	MSG_EV_CURRENT_ALT
 	};
 
-	return (conv_map2str(string, sizeof (string), version, fmt_flags,
-		ARRAY_NELTS(versions), versions, versions_alt, versions_alt));
+	return (conv_map2str(inv_buf, version, fmt_flags,
+	    ARRAY_NELTS(versions), versions, versions_alt, versions_alt));
 }
 
 #define	EFLAGSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
@@ -200,15 +194,27 @@
 		MSG_EF_SPARC_SUN_US1_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE +  \
 		MSG_EF_SPARC_HAL_R1_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE +  \
 		MSG_EF_SPARC_SUN_US3_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE +  \
-		CONV_INV_STRSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
+		CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
+
+/*
+ * Ensure that Conv_ehdr_flags_buf_t is large enough:
+ *
+ * EFLAGSZ is the real minimum size of the buffer required by conv_ehdr_flags().
+ * However, Conv_ehdr_flags_buf_t uses CONV_EHDR_FLAG_BUFSIZE to set the
+ * buffer size. We do things this way because the definition of EFLAGSZ uses
+ * information that is not available in the environment of other programs
+ * that include the conv.h header file.
+ */
+#if CONV_EHDR_FLAGS_BUFSIZE < EFLAGSZ
+#error "CONV_EHDR_FLAGS_BUFSIZE is not large enough"
+#endif
 
 /*
  * Make a string representation of the e_flags field.
  */
 const char *
-conv_ehdr_flags(Half mach, Word flags)
+conv_ehdr_flags(Half mach, Word flags, Conv_ehdr_flags_buf_t *flags_buf)
 {
-	static char	string[EFLAGSZ];
 	static Val_desc vda[] = {
 		{ EF_SPARC_32PLUS,	MSG_ORIG(MSG_EF_SPARC_32PLUS) },
 		{ EF_SPARC_SUN_US1,	MSG_ORIG(MSG_EF_SPARC_SUN_US1) },
@@ -221,11 +227,13 @@
 		MSG_EF_SPARCV9_RMO
 	};
 	static const char *leading_str_arr[2];
-	static CONV_EXPN_FIELD_ARG conv_arg = { string, sizeof (string), vda,
-		leading_str_arr };
+	static CONV_EXPN_FIELD_ARG conv_arg = {
+	    NULL, sizeof (flags_buf->buf), vda, leading_str_arr };
 
 	const char **lstr = leading_str_arr;
 
+	conv_arg.buf = flags_buf->buf;
+
 	/*
 	 * Non-SPARC architectures presently provide no known flags.
 	 */
@@ -245,18 +253,18 @@
 
 		(void) conv_expn_field(&conv_arg);
 
-		return (string);
+		return (conv_arg.buf);
 	}
-	return (conv_invalid_val(string, EFLAGSZ, flags, CONV_FMT_DECIMAL));
+
+	return (conv_invalid_val(&flags_buf->inv_buf, flags, CONV_FMT_DECIMAL));
 }
 
 /*
  * Make a string representation of the e_ident[EI_OSABI] field.
  */
 const char *
-conv_ehdr_osabi(uchar_t osabi, int fmt_flags)
+conv_ehdr_osabi(uchar_t osabi, int fmt_flags, Conv_inv_buf_t *inv_buf)
 {
-	static Conv_inv_buf_t	string;
 	static const Msg	osabi_arr[] = {
 		MSG_OSABI_NONE,		MSG_OSABI_HPUX,
 		MSG_OSABI_NETBSD,	MSG_OSABI_LINUX,
@@ -293,9 +301,9 @@
 		break;
 
 	default:
-		str = conv_map2str(string, sizeof (string), osabi, fmt_flags,
-		    ARRAY_NELTS(osabi_arr), osabi_arr,
-		    osabi_arr_alt, osabi_arr_alt);
+		str = conv_map2str(inv_buf, osabi, fmt_flags,
+		    ARRAY_NELTS(osabi_arr), osabi_arr, osabi_arr_alt,
+		    osabi_arr_alt);
 		break;
 	}
 
@@ -307,30 +315,34 @@
  * terms of a string.
  */
 const char *
-conv_reject_desc(Rej_desc * rej)
+conv_reject_desc(Rej_desc * rej, Conv_reject_desc_buf_t *reject_desc_buf)
 {
-	static Conv_inv_buf_t	string;
-	ushort_t		type = rej->rej_type;
-	uint_t			info = rej->rej_info;
+	ushort_t	type = rej->rej_type;
+	uint_t		info = rej->rej_info;
 
 	if (type == SGS_REJ_MACH)
 		/* LINTED */
-		return (conv_ehdr_mach((Half)info, 0));
+		return (conv_ehdr_mach((Half)info, 0,
+		    &reject_desc_buf->inv_buf));
 	else if (type == SGS_REJ_CLASS)
 		/* LINTED */
-		return (conv_ehdr_class((uchar_t)info, 0));
+		return (conv_ehdr_class((uchar_t)info, 0,
+		    &reject_desc_buf->inv_buf));
 	else if (type == SGS_REJ_DATA)
 		/* LINTED */
-		return (conv_ehdr_data((uchar_t)info, 0));
+		return (conv_ehdr_data((uchar_t)info, 0,
+		    &reject_desc_buf->inv_buf));
 	else if (type == SGS_REJ_TYPE)
 		/* LINTED */
-		return (conv_ehdr_type((Half)info, 0));
+		return (conv_ehdr_type((Half)info, 0,
+		    &reject_desc_buf->inv_buf));
 	else if ((type == SGS_REJ_BADFLAG) || (type == SGS_REJ_MISFLAG) ||
 	    (type == SGS_REJ_HAL) || (type == SGS_REJ_US3))
 		/*
 		 * Only called from ld.so.1, thus M_MACH is hardcoded.
 		 */
-		return (conv_ehdr_flags(M_MACH, (Word)info));
+		return (conv_ehdr_flags(M_MACH, (Word)info,
+		    &reject_desc_buf->flags_buf));
 	else if (type == SGS_REJ_UNKFILE)
 		return ((const char *)0);
 	else if ((type == SGS_REJ_STR) || (type == SGS_REJ_HWCAP_1)) {
@@ -339,6 +351,6 @@
 		else
 			return (MSG_ORIG(MSG_STR_EMPTY));
 	} else
-		return (conv_invalid_val(string, CONV_INV_STRSIZE, info,
+		return (conv_invalid_val(&reject_desc_buf->inv_buf, info,
 		    CONV_FMT_DECIMAL));
 }
--- a/usr/src/cmd/sgs/libconv/common/globals.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/libconv/common/globals.c	Thu Jul 26 08:45:42 2007 -0700
@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 #pragma ident	"%Z%%M%	%I%	%E% SMI"
@@ -36,17 +36,16 @@
  * Given an integer value, generate an ASCII representation of it.
  *
  * entry:
- *	string - Buffer into which the resulting string is generated.
- *	size - Size of string buffer (i.e. sizeof(string))
+ *	inv_buf - Buffer into which the resulting string is generated.
  *	value - Value to be formatted.
  *	fmt_flags - CONV_FMT_* values, used to specify formatting details.
  *
  * exit:
- *	The formatted string, or as much as will fit, is placed into
- *	string. String is returned.
+ *	The formatted string is placed into inv_buf. The pointer
+ *	to the string is returned.
  */
 const char *
-conv_invalid_val(char *string, size_t size, Xword value, int fmt_flags)
+conv_invalid_val(Conv_inv_buf_t *inv_buf, Xword value, int fmt_flags)
 {
 	const char	*fmt;
 
@@ -61,8 +60,8 @@
 		else
 			fmt = MSG_ORIG(MSG_GBL_FMT_HEX);
 	}
-	(void) snprintf(string, size, fmt, value);
-	return ((const char *)string);
+	(void) snprintf(inv_buf->buf, sizeof (inv_buf->buf), fmt, value);
+	return ((const char *)inv_buf->buf);
 }
 
 
@@ -100,6 +99,7 @@
 cef_cp(CONV_EXPN_FIELD_ARG *arg, CONV_EXPN_FIELD_STATE *state,
 	int list_item, const char *str)
 {
+	Conv_inv_buf_t inv_buf;
 	int n;
 
 	if (list_item) {	/* This is a list item */
@@ -110,7 +110,7 @@
 		if (state->list_cnt != 0) {
 			if (state->sep_str_len < state->room) {
 				(void) memcpy(state->cur, state->sep_str,
-					state->sep_str_len);
+				    state->sep_str_len);
 				state->cur += state->sep_str_len;
 				state->room -= state->sep_str_len;
 			} else {
@@ -130,7 +130,8 @@
 	}
 
 	/* Buffer too small. Fill in the numeric value and report failure */
-	(void) conv_invalid_val(arg->buf, arg->bufsize, arg->oflags, 0);
+	(void) conv_invalid_val(&inv_buf, arg->oflags, 0);
+	(void) strlcpy(arg->buf, inv_buf.buf, arg->bufsize);
 	return (FALSE);
 }
 
@@ -198,10 +199,10 @@
 	 * representation of these flags to the users output buffer.
 	 */
 	if (rflags) {
-		Conv_inv_buf_t ibuf;
+		Conv_inv_buf_t inv_buf;
 
-		(void) conv_invalid_val(ibuf, sizeof (ibuf), rflags, 0);
-		if (!cef_cp(arg, &state, TRUE, ibuf))
+		(void) conv_invalid_val(&inv_buf, rflags, 0);
+		if (!cef_cp(arg, &state, TRUE, inv_buf.buf))
 			return (FALSE);
 	}
 
--- a/usr/src/cmd/sgs/libconv/common/group.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/libconv/common/group.c	Thu Jul 26 08:45:42 2007 -0700
@@ -37,15 +37,27 @@
 		MSG_GPH_PARENT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
 		MSG_GPH_FILTEE_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
 		MSG_GPH_INITIAL_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
-		CONV_INV_STRSIZE	+ CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
+		CONV_INV_BUFSIZE	+ CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
+
+/*
+ * Ensure that Conv_grphdl_flags_buf_t is large enough:
+ *
+ * HDLSZ is the real minimum size of the buffer required by conv_grphdl_flags().
+ * However, Conv_grphdl_flags_buf_t uses CONV_GRPHDL_FLAGS_BUFSIZE to set the
+ * buffer size. We do things this way because the definition of HDLSZ uses
+ * information that is not available in the environment of other programs
+ * that include the conv.h header file.
+ */
+#if (CONV_GRPHDL_FLAGS_BUFSIZE < HDLSZ) && !defined(__lint)
+#error "CONV_GRPHDL_FLAGS_BUFSIZE is not large enough"
+#endif
 
 /*
  * String conversion routine for Grp_hdl flags.
  */
 const char *
-conv_grphdl_flags(uint_t flags)
+conv_grphdl_flags(uint_t flags, Conv_grphdl_flags_buf_t *grphdl_flags_buf)
 {
-	static char	string[HDLSZ];
 	static Val_desc vda[] = {
 		{ GPH_ZERO,		MSG_ORIG(MSG_GPH_ZERO) },
 		{ GPH_LDSO,		MSG_ORIG(MSG_GPH_LDSO) },
@@ -55,15 +67,17 @@
 		{ GPH_INITIAL,		MSG_ORIG(MSG_GPH_INITIAL) },
 		{ 0,			0 }
 	};
-	static CONV_EXPN_FIELD_ARG conv_arg = { string, sizeof (string), vda };
+	static CONV_EXPN_FIELD_ARG conv_arg = {
+	    NULL, sizeof (grphdl_flags_buf->buf), vda };
 
 	if (flags == 0)
 		return (MSG_ORIG(MSG_GBL_NULL));
 
+	conv_arg.buf = grphdl_flags_buf->buf;
 	conv_arg.oflags = conv_arg.rflags = flags;
 	(void) conv_expn_field(&conv_arg);
 
-	return ((const char *)string);
+	return ((const char *)grphdl_flags_buf->buf);
 }
 
 #define	DESCSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
@@ -73,14 +87,27 @@
 		MSG_GPD_PARENT_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
 		MSG_GPD_FILTER_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
 		MSG_GPD_REMOVE_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
-		CONV_INV_STRSIZE	+ CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
+		CONV_INV_BUFSIZE	+ CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
+
+/*
+ * Ensure that Conv_grpdesc_flags_buf_t is large enough:
+ *
+ * DESCSZ is the real min size of the buffer required by conv_grpdesc_flags().
+ * However, Conv_grpdesc_flags_buf_t uses CONV_GRPDESC_FLAGS_BUFSIZE to set the
+ * buffer size. We do things this way because the definition of DESCSZ uses
+ * information that is not available in the environment of other programs
+ * that include the conv.h header file.
+ */
+#if (CONV_GRPDESC_FLAGS_BUFSIZE < DESCSZ) && !defined(__lint)
+#error "CONV_GRPDESC_FLAGS_BUFSIZE is not large enough"
+#endif
+
 /*
  * String conversion routine for Grp_desc flags.
  */
 const char *
-conv_grpdesc_flags(uint_t flags)
+conv_grpdesc_flags(uint_t flags, Conv_grpdesc_flags_buf_t *grpdesc_flags_buf)
 {
-	static char	string[DESCSZ];
 	static Val_desc vda[] = {
 		{ GPD_DLSYM,		MSG_ORIG(MSG_GPD_DLSYM) },
 		{ GPD_RELOC,		MSG_ORIG(MSG_GPD_RELOC) },
@@ -90,13 +117,15 @@
 		{ GPD_REMOVE,		MSG_ORIG(MSG_GPD_REMOVE) },
 		{ 0,			0 }
 	};
-	static CONV_EXPN_FIELD_ARG conv_arg = { string, sizeof (string), vda };
+	static CONV_EXPN_FIELD_ARG conv_arg = {
+	    NULL, sizeof (grpdesc_flags_buf->buf), vda };
 
 	if (flags == 0)
 		return (MSG_ORIG(MSG_GBL_NULL));
 
+	conv_arg.buf = grpdesc_flags_buf->buf;
 	conv_arg.oflags = conv_arg.rflags = flags;
 	(void) conv_expn_field(&conv_arg);
 
-	return ((const char *)string);
+	return ((const char *)grpdesc_flags_buf->buf);
 }
--- a/usr/src/cmd/sgs/libconv/common/llib-lconv	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/libconv/common/llib-lconv	Thu Jul 26 08:45:42 2007 -0700
@@ -39,95 +39,120 @@
  * Define all generic interfaces.
  */
 uchar_t		conv_check_native(char **, char **);
-const char      *conv_config_feat(int);
-const char	*conv_config_obj(ushort_t);
+const char      *conv_config_feat(int, Conv_config_feat_buf_t *);
+const char	*conv_config_obj(ushort_t, Conv_config_obj_buf_t *);
 const char	*conv_config_upm(const char *, const char *, const char *,
 		    size_t);
-const char	*conv_def_tag(Symref);
+const char	*conv_def_tag(Symref, Conv_inv_buf_t *);
 const char	*conv_demangle_name(const char *);
-const char	*conv_dl_flag(int, int);
-const char	*conv_dl_mode(int, int);
-const char	*conv_dwarf_ehe(uint_t);
-const char	*conv_elfdata_type(Elf_Type);
+const char	*conv_dl_flag(int, int, Conv_dl_flag_buf_t *);
+const char	*conv_dl_mode(int, int, Conv_dl_mode_buf_t *);
+const char	*conv_dwarf_ehe(uint_t, Conv_dwarf_ehe_buf_t *);
+const char	*conv_elfdata_type(Elf_Type, Conv_inv_buf_t *);
 int		conv_expn_field(CONV_EXPN_FIELD_ARG *);
-const char	*conv_grphdl_flags(uint_t);
-const char	*conv_grpdesc_flags(uint_t);
+const char	*conv_grphdl_flags(uint_t, Conv_grphdl_flags_buf_t *);
+const char	*conv_grpdesc_flags(uint_t, Conv_grpdesc_flags_buf_t *);
 Isa_desc	*conv_isalist(void);
 const char	*conv_lddstub(int);
-const char	*conv_seg_flags(Half);
+const char	*conv_seg_flags(Half, Conv_seg_flags_buf_t *);
 int		conv_sys_eclass(void);
 Uts_desc	*conv_uts(void);
 const char	*conv_ver_flags(Half);
-const char	*conv_ver_index(Versym verndx, int gnuver);
+const char	*conv_ver_index(Versym, int, Conv_inv_buf_t *);
+
 
 /*
  * Define all class specific routines.
  */
-const char	*conv32_bnd_obj(uint_t);
-const char	*conv64_bnd_obj(uint_t);
-const char	*conv32_bnd_type(uint_t);
-const char	*conv64_bnd_type(uint_t);
-const char	*conv32_cap_tag(Elf32_Word);
-const char	*conv64_cap_tag(Elf64_Xword);
-const char	*conv32_cap_val(Elf32_Word, Elf32_Word, Half);
-const char	*conv64_cap_val(Elf64_Xword, Elf64_Xword, Half);
-const char	*conv32_cap_val_hw1(Elf32_Word, Half);
-const char	*conv64_cap_val_hw1(Elf64_Xword, Half);
-const char	*conv32_cap_val_sf1(Elf32_Word, Half);
-const char	*conv64_cap_val_sf1(Elf64_Xword, Half);
-const char	*conv32_dyn_flag1(Elf32_Word);
-const char	*conv64_dyn_flag1(Elf64_Xword);
-const char	*conv32_dyn_flag(Elf32_Word, int);
-const char	*conv64_dyn_flag(Elf64_Xword, int);
-const char	*conv32_dyn_posflag1(Elf32_Word, int);
-const char	*conv64_dyn_posflag1(Elf64_Xword, int);
-const char	*conv32_dyn_tag(Elf32_Word, Elf32_Half, int);
-const char	*conv64_dyn_tag(Elf64_Xword, Elf64_Half, int);
-const char	*conv32_dyn_feature1(Elf32_Word, int);
-const char	*conv64_dyn_feature1(Elf64_Xword, int);
-const char	*conv32_ehdr_class(uchar_t, int);
-const char	*conv64_ehdr_class(uchar_t, int);
-const char	*conv32_ehdr_data(uchar_t, int);
-const char	*conv64_ehdr_data(uchar_t, int);
-const char	*conv32_ehdr_flags(Elf32_Half, Elf32_Word);
-const char	*conv64_ehdr_flags(Elf64_Half, Elf64_Word);
-const char	*conv32_ehdr_mach(Elf32_Half, int);
-const char	*conv64_ehdr_mach(Elf64_Half, int);
-const char	*conv32_ehdr_type(Elf32_Half, int);
-const char	*conv64_ehdr_type(Elf64_Half, int);
-const char	*conv32_ehdr_vers(Elf32_Word, int);
-const char	*conv64_ehdr_vers(Elf64_Word, int);
-const char	*conv32_invalid_val(char *, size_t, Elf32_Word, int);
-const char	*conv64_invalid_val(char *, size_t, Elf64_Xword, int);
-const char	*conv32_phdr_flags(Word);
-const char	*conv64_phdr_flags(Word);
-const char	*conv32_phdr_type(Elf32_Half, Word, int);
-const char	*conv64_phdr_type(Elf64_Half, Word, int);
-const char	*conv32_reject_desc(Rej_desc *);
-const char	*conv64_reject_desc(Rej_desc *);
-const char	*conv32_reloc_type(Half, Word, int);
-const char	*conv64_reloc_type(Half, Word, int);
-const char	*conv32_reloc_386_type(Word, int);
-const char	*conv64_reloc_386_type(Word, int);
-const char	*conv32_reloc_amd64_type(Word, int);
-const char	*conv64_reloc_amd64_type(Word, int);
-const char	*conv32_reloc_SPARC_type(Word, int);
-const char	*conv64_reloc_SPARC_type(Word, int);
-const char	*conv32_sec_flags(Elf32_Word);
-const char	*conv64_sec_flags(Elf64_Xword);
-const char	*conv32_sec_linkinfo(Elf32_Word, Elf32_Word, Conv_inv_buf_t);
-const char	*conv64_sec_linkinfo(Elf64_Word, Elf64_Xword, Conv_inv_buf_t);
-const char	*conv32_sec_type(Elf32_Half, Elf32_Word, int);
-const char	*conv64_sec_type(Elf64_Half, Elf64_Word, int);
-const char	*conv32_sym_info_bind(uchar_t, int);
-const char	*conv64_sym_info_bind(uchar_t, int);
-const char	*conv32_sym_info_type(Elf32_Half, uchar_t, int);
-const char	*conv64_sym_info_type(Elf64_Half, uchar_t, int);
-const char	*conv32_sym_shndx(Elf32_Half);
-const char	*conv64_sym_shndx(Elf64_Half);
-const char	*conv32_sym_other(uchar_t);
-const char	*conv64_sym_other(uchar_t);
-const char	*conv32_sym_value(Elf32_Half, uchar_t, Elf32_Addr);
-const char	*conv64_sym_value(Elf64_Half, uchar_t, Elf64_Addr);
-const char	*conv32_sym_SPARC_value(Elf32_Addr, int);
-const char	*conv64_sym_SPARC_value(Elf64_Addr, int);
+const char	*conv32_bnd_obj(uint_t, Conv32_bnd_obj_buf_t *);
+const char	*conv64_bnd_obj(uint_t, Conv64_bnd_obj_buf_t *);
+const char	*conv32_bnd_type(uint_t, Conv32_bnd_type_buf_t *);
+const char	*conv64_bnd_type(uint_t, Conv64_bnd_type_buf_t *);
+const char	*conv32_cap_tag(Elf32_Word, Conv32_inv_buf_t *);
+const char	*conv64_cap_tag(Elf64_Xword, Conv64_inv_buf_t *);
+const char	*conv32_cap_val(Elf32_Word, Elf32_Word, Half,
+		    Conv32_cap_val_buf_t *);
+const char	*conv64_cap_val(Elf64_Xword, Elf64_Xword, Half,
+		    Conv64_cap_val_buf_t *);
+const char	*conv32_cap_val_hw1(Elf32_Word, Half,
+		    Conv32_cap_val_hw1_buf_t *);
+const char	*conv64_cap_val_hw1(Elf64_Xword, Half,
+		    Conv64_cap_val_hw1_buf_t *);
+const char	*conv32_cap_val_sf1(Elf32_Word, Half,
+		    Conv32_cap_val_sf1_buf_t *);
+const char	*conv64_cap_val_sf1(Elf64_Xword, Half,
+		    Conv64_cap_val_sf1_buf_t *);
+const char	*conv32_dyn_flag1(Elf32_Word, Conv32_dyn_flag1_buf_t *);
+const char	*conv64_dyn_flag1(Elf64_Xword, Conv64_dyn_flag1_buf_t *);
+const char	*conv32_dyn_flag(Elf32_Word, int, Conv32_dyn_flag_buf_t *);
+const char	*conv64_dyn_flag(Elf64_Xword, int, Conv64_dyn_flag_buf_t *);
+const char	*conv32_dyn_posflag1(Elf32_Word, int,
+		    Conv32_dyn_posflag1_buf_t *);
+const char	*conv64_dyn_posflag1(Elf64_Xword, int,
+		    Conv64_dyn_posflag1_buf_t *);
+const char	*conv32_dyn_tag(Elf32_Word, Elf32_Half, int,
+		    Conv32_inv_buf_t *);
+const char	*conv64_dyn_tag(Elf64_Xword, Elf64_Half, int,
+		    Conv64_inv_buf_t *);
+const char	*conv32_dyn_feature1(Elf32_Word, int,
+		    Conv32_dyn_feature1_buf_t *);
+const char	*conv64_dyn_feature1(Elf64_Xword, int,
+		    Conv64_dyn_feature1_buf_t *);
+const char	*conv32_ehdr_class(uchar_t, int, Conv32_inv_buf_t *);
+const char	*conv64_ehdr_class(uchar_t, int, Conv64_inv_buf_t *);
+const char	*conv32_ehdr_data(uchar_t, int, Conv32_inv_buf_t *);
+const char	*conv64_ehdr_data(uchar_t, int, Conv64_inv_buf_t *);
+const char	*conv32_ehdr_flags(Elf32_Half, Elf32_Word,
+		    Conv32_ehdr_flags_buf_t *);
+const char	*conv64_ehdr_flags(Elf64_Half, Elf64_Word,
+		    Conv64_ehdr_flags_buf_t *);
+const char	*conv32_ehdr_mach(Elf32_Half, int, Conv32_inv_buf_t *);
+const char	*conv64_ehdr_mach(Elf64_Half, int, Conv64_inv_buf_t *);
+const char	*conv32_ehdr_type(Elf32_Half, int, Conv32_inv_buf_t *);
+const char	*conv64_ehdr_type(Elf64_Half, int, Conv64_inv_buf_t *);
+const char	*conv32_ehdr_vers(Elf32_Word, int, Conv32_inv_buf_t *);
+const char	*conv64_ehdr_vers(Elf64_Word, int, Conv64_inv_buf_t *);
+const char	*conv32_invalid_val(Conv32_inv_buf_t *, Elf32_Word, int);
+const char	*conv64_invalid_val(Conv64_inv_buf_t *, Elf64_Xword, int);
+const char	*conv32_phdr_flags(Word, Conv32_phdr_flags_buf_t *);
+const char	*conv64_phdr_flags(Word, Conv64_phdr_flags_buf_t *);
+const char	*conv32_phdr_type(Elf32_Half, Word, int, Conv32_inv_buf_t *);
+const char	*conv64_phdr_type(Elf64_Half, Word, int, Conv64_inv_buf_t *);
+const char	*conv32_reject_desc(Rej_desc *, Conv32_reject_desc_buf_t *);
+const char	*conv64_reject_desc(Rej_desc *, Conv64_reject_desc_buf_t *);
+const char	*conv32_reloc_type(Half, Word, int, Conv32_inv_buf_t *);
+const char	*conv64_reloc_type(Half, Word, int, Conv64_inv_buf_t *);
+const char	*conv32_reloc_type_static(Half, Word, int);
+const char	*conv64_reloc_type_static(Half, Word, int);
+const char	*conv32_reloc_386_type(Word, int, Conv32_inv_buf_t *);
+const char	*conv64_reloc_386_type(Word, int, Conv64_inv_buf_t *);
+const char	*conv32_reloc_amd64_type(Word, int, Conv32_inv_buf_t *);
+const char	*conv64_reloc_amd64_type(Word, int, Conv64_inv_buf_t *);
+const char	*conv32_reloc_SPARC_type(Word, int, Conv32_inv_buf_t *);
+const char	*conv64_reloc_SPARC_type(Word, int, Conv64_inv_buf_t *);
+const char	*conv32_sec_flags(Elf32_Word, Conv32_sec_flags_buf_t *);
+const char	*conv64_sec_flags(Elf64_Xword, Conv64_sec_flags_buf_t *);
+const char	*conv32_sec_linkinfo(Elf32_Word, Elf32_Word,
+		    Conv32_inv_buf_t *);
+const char	*conv64_sec_linkinfo(Elf64_Word, Elf64_Xword,
+		    Conv64_inv_buf_t *);
+const char	*conv32_sec_type(Elf32_Half, Elf32_Word, int,
+		    Conv32_inv_buf_t *);
+const char	*conv64_sec_type(Elf64_Half, Elf64_Word, int,
+		    Conv64_inv_buf_t *);
+const char	*conv32_sym_info_bind(uchar_t, int, Conv32_inv_buf_t *);
+const char	*conv64_sym_info_bind(uchar_t, int, Conv64_inv_buf_t *);
+const char	*conv32_sym_info_type(Elf32_Half, uchar_t, int,
+		    Conv32_inv_buf_t *);
+const char	*conv64_sym_info_type(Elf64_Half, uchar_t, int,
+		    Conv64_inv_buf_t *);
+const char	*conv32_sym_shndx(Elf32_Half, Conv32_inv_buf_t *);
+const char	*conv64_sym_shndx(Elf64_Half, Conv64_inv_buf_t *);
+const char	*conv32_sym_other(uchar_t, Conv32_inv_buf_t *);
+const char	*conv64_sym_other(uchar_t, Conv64_inv_buf_t *);
+const char	*conv32_sym_value(Elf32_Half, uchar_t, Elf32_Addr,
+		    Conv32_inv_buf_t *);
+const char	*conv64_sym_value(Elf64_Half, uchar_t, Elf64_Addr,
+		    Conv64_inv_buf_t *);
+const char	*conv32_sym_SPARC_value(Elf32_Addr, int, Conv32_inv_buf_t *);
+const char	*conv64_sym_SPARC_value(Elf64_Addr, int, Conv64_inv_buf_t *);
--- a/usr/src/cmd/sgs/libconv/common/phdr.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/libconv/common/phdr.c	Thu Jul 26 08:45:42 2007 -0700
@@ -37,9 +37,8 @@
 DEFINE_conv_map2str
 
 const char *
-conv_phdr_type(Half mach, Word type, int fmt_flags)
+conv_phdr_type(Half mach, Word type, int fmt_flags, Conv_inv_buf_t *inv_buf)
 {
-	static Conv_inv_buf_t	string;
 	static const Msg	phdrs[] = {
 		MSG_PT_NULL,		MSG_PT_LOAD,
 		MSG_PT_DYNAMIC,		MSG_PT_INTERP,
@@ -68,19 +67,17 @@
 #endif
 
 	if (type < PT_NUM) {
-		return (conv_map2str(string, sizeof (string),
-		    type, fmt_flags, ARRAY_NELTS(phdrs),
-		    phdrs, phdrs_alt, phdrs_alt));
+		return (conv_map2str(inv_buf, type, fmt_flags,
+		    ARRAY_NELTS(phdrs), phdrs, phdrs_alt, phdrs_alt));
 	} else if ((type >= PT_SUNWBSS) && (type <= PT_HISUNW)) {
-		return (conv_map2str(string, sizeof (string),
-		    (type - PT_SUNWBSS), fmt_flags, ARRAY_NELTS(uphdrs),
-		    uphdrs, uphdrs_alt, uphdrs_alt));
+		return (conv_map2str(inv_buf, (type - PT_SUNWBSS), fmt_flags,
+		    ARRAY_NELTS(uphdrs), uphdrs, uphdrs_alt, uphdrs_alt));
 	} else if ((type == PT_SUNW_UNWIND) && (mach == EM_AMD64)) {
 		return ((fmt_flags & CONV_FMTALTMASK) ?
 		    MSG_ORIG(MSG_PT_SUNW_UNWIND_ALT) :
 		    MSG_ORIG(MSG_PT_SUNW_UNWIND));
 	} else
-		return (conv_invalid_val(string, CONV_INV_STRSIZE, type, 0));
+		return (conv_invalid_val(inv_buf, type, 0));
 }
 
 #define	PHDRSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
@@ -88,12 +85,24 @@
 		MSG_PF_W_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
 		MSG_PF_R_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
 		MSG_PF_SUNW_FAILURE_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
-		CONV_INV_STRSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
+		CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
+
+/*
+ * Ensure that Conv_phdr_flags_buf_t is large enough:
+ *
+ * PHDRSZ is the real minimum size of the buffer required by conv_phdr_flags().
+ * However, Conv_phdr_flags_buf_t uses CONV_PHDR_FLAGS_BUFSIZE to set the
+ * buffer size. We do things this way because the definition of PHDRSZ uses
+ * information that is not available in the environment of other programs
+ * that include the conv.h header file.
+ */
+#if CONV_PHDR_FLAGS_BUFSIZE < PHDRSZ
+#error "CONV_PHDR_FLAGS_BUFSIZE is not large enough"
+#endif
 
 const char *
-conv_phdr_flags(Word flags)
+conv_phdr_flags(Word flags, Conv_phdr_flags_buf_t *phdr_flags_buf)
 {
-	static char string[PHDRSZ];
 	static Val_desc vda[] = {
 		{ PF_X,			MSG_ORIG(MSG_PF_X) },
 		{ PF_W,			MSG_ORIG(MSG_PF_W) },
@@ -101,13 +110,15 @@
 		{ PF_SUNW_FAILURE,	MSG_ORIG(MSG_PF_SUNW_FAILURE) },
 		{ 0,			0 }
 	};
-	static CONV_EXPN_FIELD_ARG conv_arg = { string, sizeof (string), vda };
+	static CONV_EXPN_FIELD_ARG conv_arg = {
+	    NULL, sizeof (phdr_flags_buf->buf), vda };
 
 	if (flags == 0)
 		return (MSG_ORIG(MSG_GBL_ZERO));
 
+	conv_arg.buf = phdr_flags_buf->buf;
 	conv_arg.oflags = conv_arg.rflags = flags;
 	(void) conv_expn_field(&conv_arg);
 
-	return ((const char *)string);
+	return ((const char *)phdr_flags_buf->buf);
 }
--- a/usr/src/cmd/sgs/libconv/common/relocate.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/libconv/common/relocate.c	Thu Jul 26 08:45:42 2007 -0700
@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 #pragma ident	"%Z%%M%	%I%	%E% SMI"
@@ -35,23 +35,33 @@
  * Generic front-end that determines machine specific relocations.
  */
 const char *
-conv_reloc_type(Half mach, Word type, int fmt_flags)
+conv_reloc_type(Half mach, Word type, int fmt_flags, Conv_inv_buf_t *inv_buf)
 {
-	static Conv_inv_buf_t	string;
-
 	switch (mach) {
 	case EM_386:
-		return (conv_reloc_386_type(type, fmt_flags));
+		return (conv_reloc_386_type(type, fmt_flags, inv_buf));
 
 	case EM_SPARC:
 	case EM_SPARC32PLUS:
 	case EM_SPARCV9:
-		return (conv_reloc_SPARC_type(type, fmt_flags));
+		return (conv_reloc_SPARC_type(type, fmt_flags, inv_buf));
 
 	case EM_AMD64:
-		return (conv_reloc_amd64_type(type, fmt_flags));
+		return (conv_reloc_amd64_type(type, fmt_flags, inv_buf));
 	}
 
 	/* If didn't match a machine type, use integer value */
-	return (conv_invalid_val(string, CONV_INV_STRSIZE, type, fmt_flags));
+	return (conv_invalid_val(inv_buf, type, fmt_flags));
 }
+
+/*
+ * This version supplies a static buffer. It is for the benefit of
+ * do_reloc().
+ */
+const char *
+conv_reloc_type_static(Half mach, Word type, int fmt_flags)
+{
+	static Conv_inv_buf_t inv_buf;
+
+	return (conv_reloc_type(mach, type, fmt_flags, &inv_buf));
+}
--- a/usr/src/cmd/sgs/libconv/common/relocate_amd64.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/libconv/common/relocate_amd64.c	Thu Jul 26 08:45:42 2007 -0700
@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 #pragma ident	"%Z%%M%	%I%	%E% SMI"
@@ -61,12 +61,9 @@
 #endif
 
 const char *
-conv_reloc_amd64_type(Word type, int fmt_flags)
+conv_reloc_amd64_type(Word type, int fmt_flags, Conv_inv_buf_t *inv_buf)
 {
-	static Conv_inv_buf_t	string;
-
 	if (type >= R_AMD64_NUM)
-		return (conv_invalid_val(string, CONV_INV_STRSIZE,
-			type, fmt_flags));
+		return (conv_invalid_val(inv_buf, type, fmt_flags));
 	return (MSG_ORIG(rels[type]));
 }
--- a/usr/src/cmd/sgs/libconv/common/relocate_i386.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/libconv/common/relocate_i386.c	Thu Jul 26 08:45:42 2007 -0700
@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 #pragma ident	"%Z%%M%	%I%	%E% SMI"
@@ -64,12 +64,8 @@
 #endif
 
 const char *
-conv_reloc_386_type(Word type, int fmt_flags)
-{
-	static Conv_inv_buf_t	string;
-
-	if (type >= R_386_NUM)
-		return (conv_invalid_val(string, CONV_INV_STRSIZE,
-			type, fmt_flags));
+conv_reloc_386_type(Word type, int fmt_flags, Conv_inv_buf_t *inv_buf)
+{	if (type >= R_386_NUM)
+		return (conv_invalid_val(inv_buf, type, fmt_flags));
 	return (MSG_ORIG(rels[type]));
 }
--- a/usr/src/cmd/sgs/libconv/common/relocate_sparc.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/libconv/common/relocate_sparc.c	Thu Jul 26 08:45:42 2007 -0700
@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 #pragma ident	"%Z%%M%	%I%	%E% SMI"
@@ -88,12 +88,9 @@
 #endif
 
 const char *
-conv_reloc_SPARC_type(Word type, int fmt_flags)
+conv_reloc_SPARC_type(Word type, int fmt_flags, Conv_inv_buf_t *inv_buf)
 {
-	static Conv_inv_buf_t	string;
-
 	if (type >= R_SPARC_NUM)
-		return (conv_invalid_val(string, CONV_INV_STRSIZE,
-			type, fmt_flags));
+		return (conv_invalid_val(inv_buf, type, fmt_flags));
 	return (MSG_ORIG(rels[type]));
 }
--- a/usr/src/cmd/sgs/libconv/common/sections.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/libconv/common/sections.c	Thu Jul 26 08:45:42 2007 -0700
@@ -90,16 +90,14 @@
 
 
 const char *
-conv_sec_type(Half mach, Word sec, int fmt_flags)
+conv_sec_type(Half mach, Word sec, int fmt_flags, Conv_inv_buf_t *inv_buf)
 {
-	static Conv_inv_buf_t	string;
-
 	if (sec < SHT_NUM) {
-		return (conv_map2str(string, sizeof (string), sec, fmt_flags,
-			ARRAY_NELTS(secs), secs, secs_alt, NULL));
+		return (conv_map2str(inv_buf, sec, fmt_flags,
+		    ARRAY_NELTS(secs), secs, secs_alt, NULL));
 	} else if ((sec >= SHT_LOSUNW) && (sec <= SHT_HISUNW)) {
-		return (conv_map2str(string, sizeof (string), sec - SHT_LOSUNW,
-			fmt_flags, ARRAY_NELTS(usecs), usecs, usecs_alt, NULL));
+		return (conv_map2str(inv_buf, sec - SHT_LOSUNW,
+		    fmt_flags, ARRAY_NELTS(usecs), usecs, usecs_alt, NULL));
 	} else if ((sec >= SHT_LOPROC) && (sec <= SHT_HIPROC)) {
 		switch (mach) {
 		case EM_SPARC:
@@ -107,21 +105,21 @@
 		case EM_SPARCV9:
 			if (sec == SHT_SPARC_GOTDATA) {
 				return (fmt_flags & CONV_FMT_ALTDUMP)
-					? MSG_ORIG(MSG_SHT_SPARC_GOTDATA_ALT)
-					: MSG_ORIG(MSG_SHT_SPARC_GOTDATA);
+				    ? MSG_ORIG(MSG_SHT_SPARC_GOTDATA_ALT)
+				    : MSG_ORIG(MSG_SHT_SPARC_GOTDATA);
 			}
 			break;
 		case EM_AMD64:
 			if (sec == SHT_AMD64_UNWIND) {
 				return (fmt_flags & CONV_FMT_ALTDUMP)
-					? MSG_ORIG(MSG_SHT_AMD64_UNWIND_ALT)
-					: MSG_ORIG(MSG_SHT_AMD64_UNWIND);
+				    ? MSG_ORIG(MSG_SHT_AMD64_UNWIND_ALT)
+				    : MSG_ORIG(MSG_SHT_AMD64_UNWIND);
 			}
 		}
 	}
 
 	/* If we get here, it's an unknown type */
-	return (conv_invalid_val(string, CONV_INV_STRSIZE, sec, fmt_flags));
+	return (conv_invalid_val(inv_buf, sec, fmt_flags));
 }
 
 #define	FLAGSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
@@ -138,12 +136,24 @@
 		MSG_SHF_EXCLUDE_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
 		MSG_SHF_ORDERED_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
 		MSG_SHF_AMD64_LARGE_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
-		CONV_INV_STRSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
+		CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
+
+/*
+ * Ensure that Conv_sec_flags_buf_t is large enough:
+ *
+ * FLAGSZ is the real minimum size of the buffer required by conv_sec_flags().
+ * However, Conv_sec_flags_buf_t uses CONV_SEC_FLAGS_BUFSIZE to set the
+ * buffer size. We do things this way because the definition of FLAGSZ uses
+ * information that is not available in the environment of other programs
+ * that include the conv.h header file.
+ */
+#if CONV_SEC_FLAGS_BUFSIZE < FLAGSZ
+#error "CONV_SEC_FLAGS_BUFSIZE is not large enough"
+#endif
 
 const char *
-conv_sec_flags(Xword flags)
+conv_sec_flags(Xword flags, Conv_sec_flags_buf_t *sec_flags_buf)
 {
-	static	char	string[FLAGSZ];
 	static Val_desc vda[] = {
 		{ SHF_WRITE,		MSG_ORIG(MSG_SHF_WRITE) },
 		{ SHF_ALLOC,		MSG_ORIG(MSG_SHF_ALLOC) },
@@ -160,24 +170,21 @@
 		{ SHF_AMD64_LARGE,	MSG_ORIG(MSG_SHF_AMD64_LARGE) },
 		{ 0,			0 }
 	};
-	static CONV_EXPN_FIELD_ARG conv_arg = { string, sizeof (string), vda };
+	static CONV_EXPN_FIELD_ARG conv_arg = {
+	    NULL, sizeof (sec_flags_buf->buf), vda };
 
 	if (flags == 0)
 		return (MSG_ORIG(MSG_GBL_ZERO));
 
+	conv_arg.buf = sec_flags_buf->buf;
 	conv_arg.oflags = conv_arg.rflags = flags;
 	(void) conv_expn_field(&conv_arg);
 
-	return ((const char *)string);
+	return ((const char *)sec_flags_buf->buf);
 }
 
-/*
- * conv_sec_linkinfo() is one of the few conversion routines that can be called
- * twice for the same diagnostic (see liblddbg:Elf_Shdr()), hence the caller
- * has to supply different string buffers.
- */
 const char *
-conv_sec_linkinfo(Word info, Xword flags, Conv_inv_buf_t buffer)
+conv_sec_linkinfo(Word info, Xword flags, Conv_inv_buf_t *inv_buf)
 {
 	if (flags & ALL_SHF_ORDER) {
 		if (info == SHN_BEFORE)
@@ -185,6 +192,7 @@
 		else if (info == SHN_AFTER)
 			return (MSG_ORIG(MSG_SHN_AFTER));
 	}
-	(void) conv_invalid_val(buffer, CONV_INV_STRSIZE, info, 1);
-	return ((const char *)buffer);
+
+	(void) conv_invalid_val(inv_buf, info, 1);
+	return ((const char *)inv_buf->buf);
 }
--- a/usr/src/cmd/sgs/libconv/common/segments.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/libconv/common/segments.c	Thu Jul 26 08:45:42 2007 -0700
@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 #pragma ident	"%Z%%M%	%I%	%E% SMI"
@@ -47,12 +47,24 @@
 		MSG_FLG_SG_KEY_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
 		MSG_FLG_SG_DISABLED_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
 		MSG_FLG_SG_PHREQ_SIZE	+ CONV_EXPN_FIELD_DEF_SEP_SIZE + \
-		CONV_INV_STRSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
+		CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
+
+/*
+ * Ensure that Conv_seg_flags_buf_t is large enough:
+ *
+ * SEGSZ is the real minimum size of the buffer required by conv_seg_flags().
+ * However, Conv_seg_flags_buf_t uses CONV_SEG_FLAGS_BUFSIZE to set the
+ * buffer size. We do things this way because the definition of SEGSZ uses
+ * information that is not available in the environment of other programs
+ * that include the conv.h header file.
+ */
+#if (CONV_SEG_FLAGS_BUFSIZE < SEGSZ) && !defined(__lint)
+#error "CONV_SEG_FLAGS_BUFSIZE is not large enough"
+#endif
 
 const char *
-conv_seg_flags(Half flags)
+conv_seg_flags(Half flags, Conv_seg_flags_buf_t *seg_flags_buf)
 {
-	static char	string[SEGSZ];
 	static Val_desc vda[] = {
 		{ FLG_SG_VADDR,		MSG_ORIG(MSG_FLG_SG_VADDR) },
 		{ FLG_SG_PADDR,		MSG_ORIG(MSG_FLG_SG_PADDR) },
@@ -69,13 +81,15 @@
 		{ FLG_SG_PHREQ,		MSG_ORIG(MSG_FLG_SG_PHREQ) },
 		{ 0,			0 }
 	};
-	static CONV_EXPN_FIELD_ARG conv_arg = { string, sizeof (string), vda };
+	static CONV_EXPN_FIELD_ARG conv_arg = {
+	    NULL, sizeof (seg_flags_buf->buf), vda };
 
 	if (flags == 0)
 		return (MSG_ORIG(MSG_GBL_ZERO));
 
+	conv_arg.buf = seg_flags_buf->buf;
 	conv_arg.oflags = conv_arg.rflags = flags;
 	(void) conv_expn_field(&conv_arg);
 
-	return ((const char *)string);
+	return ((const char *)seg_flags_buf->buf);
 }
--- a/usr/src/cmd/sgs/libconv/common/symbols.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/libconv/common/symbols.c	Thu Jul 26 08:45:42 2007 -0700
@@ -36,9 +36,8 @@
 #include	"symbols_msg.h"
 
 const char *
-conv_sym_other(uchar_t other)
+conv_sym_other(uchar_t other, Conv_inv_buf_t *inv_buf)
 {
-	static Conv_inv_buf_t	string;
 	static const char	visibility[4] = {
 		'D',	/* STV_DEFAULT */
 		'I',	/* STV_INTERNAL */
@@ -48,22 +47,22 @@
 	uint_t		vis = ELF_ST_VISIBILITY(other);
 	uint_t		ndx = 0;
 
-	string[ndx++] = visibility[vis];
+	inv_buf->buf[ndx++] = visibility[vis];
 
 	/*
 	 * If unkown bits are present in stother - throw out a '?'
 	 */
 	if (other & ~MSK_SYM_VISIBILITY)
-		string[ndx++] = '?';
-	string[ndx++] = '\0';
+		inv_buf->buf[ndx++] = '?';
+	inv_buf->buf[ndx++] = '\0';
 
-	return (string);
+	return (inv_buf->buf);
 }
 
 const char *
-conv_sym_info_type(Half mach, uchar_t type, int fmt_flags)
+conv_sym_info_type(Half mach, uchar_t type, int fmt_flags,
+    Conv_inv_buf_t *inv_buf)
 {
-	static Conv_inv_buf_t	string;
 	static const Msg	types[] = {
 		MSG_STT_NOTYPE,		MSG_STT_OBJECT,		MSG_STT_FUNC,
 		MSG_STT_SECTION,	MSG_STT_FILE,		MSG_STT_COMMON,
@@ -76,31 +75,26 @@
 	    (mach == EM_SPARCV9)) && (type == STT_SPARC_REGISTER)) {
 		return (MSG_ORIG(MSG_STT_REGISTER));
 	} else {
-		return (conv_invalid_val(string, CONV_INV_STRSIZE,
-			type, fmt_flags));
+		return (conv_invalid_val(inv_buf, type, fmt_flags));
 	}
 }
 
 const char *
-conv_sym_info_bind(uchar_t bind, int fmt_flags)
+conv_sym_info_bind(uchar_t bind, int fmt_flags, Conv_inv_buf_t *inv_buf)
 {
-	static Conv_inv_buf_t	string;
 	static const Msg	binds[] = {
 		MSG_STB_LOCAL,		MSG_STB_GLOBAL,		MSG_STB_WEAK
 	};
 
 	if (bind >= STB_NUM)
-		return (conv_invalid_val(string, CONV_INV_STRSIZE,
-			bind, fmt_flags));
+		return (conv_invalid_val(inv_buf, bind, fmt_flags));
 	else
 		return (MSG_ORIG(binds[bind]));
 }
 
 const char *
-conv_sym_shndx(Half shndx)
+conv_sym_shndx(Half shndx, Conv_inv_buf_t *inv_buf)
 {
-	static Conv_inv_buf_t	string;
-
 	switch (shndx) {
 	case SHN_UNDEF:
 		return (MSG_ORIG(MSG_SHN_UNDEF));
@@ -119,21 +113,18 @@
 	case SHN_XINDEX:
 		return (MSG_ORIG(MSG_SHN_XINDEX));
 	default:
-		return (conv_invalid_val(string, CONV_INV_STRSIZE, shndx,
-		    CONV_FMT_DECIMAL));
+		return (conv_invalid_val(inv_buf, shndx, CONV_FMT_DECIMAL));
 	}
 }
 
 const char *
-conv_sym_value(Half mach, uchar_t type, Addr value)
+conv_sym_value(Half mach, uchar_t type, Addr value, Conv_inv_buf_t *inv_buf)
 {
-	static Conv_inv_buf_t	string;
-
 	if (((mach == EM_SPARC) || (mach == EM_SPARC32PLUS) ||
 	    (mach == EM_SPARCV9)) && (type == STT_SPARC_REGISTER))
-		return (conv_sym_SPARC_value(value, 0));
+		return (conv_sym_SPARC_value(value, 0, inv_buf));
 
-	(void) snprintf(string, sizeof (string), MSG_ORIG(MSG_SYM_FMT_VAL),
-	    EC_ADDR(value));
-	return (string);
+	(void) snprintf(inv_buf->buf, sizeof (inv_buf->buf),
+	    MSG_ORIG(MSG_SYM_FMT_VAL), EC_ADDR(value));
+	return (inv_buf->buf);
 }
--- a/usr/src/cmd/sgs/libconv/common/symbols_sparc.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/libconv/common/symbols_sparc.c	Thu Jul 26 08:45:42 2007 -0700
@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -42,13 +42,10 @@
 };
 
 const char *
-conv_sym_SPARC_value(Addr val, int fmt_flags)
+conv_sym_SPARC_value(Addr val, int fmt_flags, Conv_inv_buf_t *inv_buf)
 {
-	static Conv_inv_buf_t	string;
-
 	if ((val < STO_SPARC_REGISTER_G1) || (val > STO_SPARC_REGISTER_G7)) {
-		return (conv_invalid_val(string, CONV_INV_STRSIZE,
-			val, fmt_flags));
+		return (conv_invalid_val(inv_buf, val, fmt_flags));
 	} else {
 		return (MSG_ORIG(registers[val]));
 	}
--- a/usr/src/cmd/sgs/libconv/common/version.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/libconv/common/version.c	Thu Jul 26 08:45:42 2007 -0700
@@ -53,9 +53,8 @@
  *		GNU ld are assumed. If False (0), Solaris ld rules apply.
  */
 const char *
-conv_ver_index(Versym verndx, int gnuver)
+conv_ver_index(Versym verndx, int gnuver, Conv_inv_buf_t *inv_buf)
 {
-	static Conv_inv_buf_t	string;
 	const char		*fmt;
 
 	/* Special case versions starting at VER_NDX_LORESERVE */
@@ -75,6 +74,7 @@
 	}
 
 	/* format as numeric */
-	(void) snprintf(string, sizeof (string), fmt, EC_HALF(verndx));
-	return (string);
+	(void) snprintf(inv_buf->buf, sizeof (inv_buf->buf),
+	    fmt, EC_HALF(verndx));
+	return (inv_buf->buf);
 }
--- a/usr/src/cmd/sgs/libld/common/args.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/libld/common/args.c	Thu Jul 26 08:45:42 2007 -0700
@@ -1117,7 +1117,6 @@
 				    MSG_INTL(MSG_ARG_ILLEGAL),
 				    MSG_ORIG(MSG_ARG_Z), optarg);
 				ofl->ofl_flags |= FLG_OF_FATAL;
-
 			}
 
 			break;
@@ -1554,10 +1553,13 @@
 		 * Check for mismatched input.
 		 */
 		if (rej.rej_type) {
+			Conv_reject_desc_buf_t rej_buf;
+
 			eprintf(ofl->ofl_lml, ERR_FATAL,
 			    MSG_INTL(reject[rej.rej_type]),
 			    rej.rej_name ? rej.rej_name :
-			    MSG_INTL(MSG_STR_UNKNOWN), conv_reject_desc(&rej));
+			    MSG_INTL(MSG_STR_UNKNOWN),
+			    conv_reject_desc(&rej, &rej_buf));
 			ofl->ofl_flags |= FLG_OF_FATAL;
 			return (1);
 		}
--- a/usr/src/cmd/sgs/libld/common/files.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/libld/common/files.c	Thu Jul 26 08:45:42 2007 -0700
@@ -488,9 +488,11 @@
 invalid_section(const char *name, Ifl_desc *ifl, Shdr *shdr, Elf_Scn *scn,
     Word ndx, int ident, Ofl_desc *ofl)
 {
+	Conv_inv_buf_t inv_buf;
+
 	eprintf(ofl->ofl_lml, ERR_WARNING, MSG_INTL(MSG_FIL_INVALSEC),
 	    ifl->ifl_name, name, conv_sec_type(ifl->ifl_ehdr->e_machine,
-	    shdr->sh_type, 0));
+	    shdr->sh_type, 0, &inv_buf));
 	return (1);
 }
 
@@ -1220,6 +1222,7 @@
 	Is_desc	*risc;
 	Os_desc	*osp;
 	Shdr	*shdr = isc->is_shdr;
+	Conv_inv_buf_t inv_buf;
 
 	/*
 	 * Make sure this is a valid relocation we can handle.
@@ -1227,7 +1230,8 @@
 	if (shdr->sh_type != M_REL_SHT_TYPE) {
 		eprintf(ofl->ofl_lml, ERR_FATAL, MSG_INTL(MSG_FIL_INVALSEC),
 		    ifl->ifl_name, isc->is_name,
-		    conv_sec_type(ifl->ifl_ehdr->e_machine, shdr->sh_type, 0));
+		    conv_sec_type(ifl->ifl_ehdr->e_machine,
+		    shdr->sh_type, 0, &inv_buf));
 		ofl->ofl_flags |= FLG_OF_FATAL;
 		return (0);
 	}
@@ -1578,12 +1582,15 @@
 			 * really know what to do with it, issue a warning
 			 * message but do the basic section processing anyway.
 			 */
-			if (row < (Word)SHT_LOSUNW)
+			if (row < (Word)SHT_LOSUNW) {
+				Conv_inv_buf_t inv_buf;
+
 				eprintf(ofl->ofl_lml, ERR_WARNING,
 				    MSG_INTL(MSG_FIL_INVALSEC), ifl->ifl_name,
 				    name,
 				    conv_sec_type(ifl->ifl_ehdr->e_machine,
-				    shdr->sh_type, 0));
+				    shdr->sh_type, 0, &inv_buf));
+			}
 
 			/*
 			 * Handle sections greater than SHT_LOSUNW.
@@ -1997,13 +2004,10 @@
 					 * so as to provide the most
 					 * descriptive diagnostic.
 					 */
-					if (strcmp(name, ifl->ifl_name) == 0)
-						errmsg =
-						    MSG_INTL(MSG_FIL_MULINC_1);
-					else
-						errmsg =
-						    MSG_INTL(MSG_FIL_MULINC_2);
-
+					errmsg =
+					    (strcmp(name, ifl->ifl_name) == 0) ?
+					    MSG_INTL(MSG_FIL_MULINC_1) :
+					    MSG_INTL(MSG_FIL_MULINC_2);
 					eprintf(ofl->ofl_lml, ERR_WARNING,
 					    errmsg, name, ifl->ifl_name);
 				}
@@ -2283,11 +2287,13 @@
 					return (S_ERROR);
 				}
 				if (_rej.rej_type) {
+					Conv_reject_desc_buf_t rej_buf;
+
 					eprintf(ofl->ofl_lml, ERR_WARNING,
 					    MSG_INTL(reject[_rej.rej_type]),
 					    _rej.rej_name ? rej.rej_name :
 					    MSG_INTL(MSG_STR_UNKNOWN),
-					    conv_reject_desc(&_rej));
+					    conv_reject_desc(&_rej, &rej_buf));
 				} else
 					sdf->sdf_file = ifl;
 			}
@@ -2392,10 +2398,13 @@
 		 * generic "not found" diagnostic.
 		 */
 		if (rej.rej_type) {
+			Conv_reject_desc_buf_t rej_buf;
+
 			eprintf(ofl->ofl_lml, ERR_WARNING,
 			    MSG_INTL(reject[rej.rej_type]),
 			    rej.rej_name ? rej.rej_name :
-			    MSG_INTL(MSG_STR_UNKNOWN), conv_reject_desc(&rej));
+			    MSG_INTL(MSG_STR_UNKNOWN),
+			    conv_reject_desc(&rej, &rej_buf));
 		} else {
 			eprintf(ofl->ofl_lml, ERR_WARNING,
 			    MSG_INTL(MSG_FIL_NOTFOUND), file, sdf->sdf_rfile);
--- a/usr/src/cmd/sgs/libld/common/ldlibs.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/libld/common/ldlibs.c	Thu Jul 26 08:45:42 2007 -0700
@@ -23,7 +23,7 @@
  *	Copyright (c) 1988 AT&T
  *	  All Rights Reserved
  *
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -96,9 +96,10 @@
 		if (cp == NULL) {
 			if (*path == '\0') {
 				if (seenflg)
-				    if (list_appendc(list, subsflag ?
-					compat_YL_YU(ofl, dot, i) : dot) == 0)
-					    return ((char *)S_ERROR);
+					if (list_appendc(list, subsflag ?
+					    compat_YL_YU(ofl, dot, i) : dot) ==
+					    0)
+						return ((char *)S_ERROR);
 			} else
 				if (list_appendc(list, subsflag ?
 				    compat_YL_YU(ofl, path, i) : path) == 0)
@@ -307,13 +308,16 @@
 	 * diagnostic to that effect, otherwise generate a generic "not found"
 	 * diagnostic.
 	 */
-	if (rej.rej_type)
+	if (rej.rej_type) {
+		Conv_reject_desc_buf_t rej_buf;
+
 		eprintf(ofl->ofl_lml, ERR_FATAL, MSG_INTL(reject[rej.rej_type]),
 		    rej.rej_name ? rej.rej_name : MSG_INTL(MSG_STR_UNKNOWN),
-		    conv_reject_desc(&rej));
-	else
+		    conv_reject_desc(&rej, &rej_buf));
+	} else {
 		eprintf(ofl->ofl_lml, ERR_FATAL, MSG_INTL(MSG_LIB_NOTFOUND),
 		    name);
+	}
 
 	ofl->ofl_flags |= FLG_OF_FATAL;
 	return (0);
@@ -349,7 +353,7 @@
 #else
 		if ((cp = getenv(MSG_ORIG(MSG_LD_LIBPATH_32))) == NULL)
 #endif
-		    cp  = getenv(MSG_ORIG(MSG_LD_LIBPATH));
+			cp  = getenv(MSG_ORIG(MSG_LD_LIBPATH));
 	}
 
 	if ((cp != NULL) && (*cp != '\0')) {
--- a/usr/src/cmd/sgs/libld/common/libs.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/libld/common/libs.c	Thu Jul 26 08:45:42 2007 -0700
@@ -23,7 +23,7 @@
  *	Copyright (c) 1988 AT&T
  *	  All Rights Reserved
  *
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 #pragma ident	"%Z%%M%	%I%	%E% SMI"
@@ -605,12 +605,13 @@
 	 * and if one had occurred issue a warning - its possible a user has
 	 * pointed at an archive containing the wrong class of elf members.
 	 */
-	if (found == 0) {
-		if (rej.rej_type)
-			eprintf(ofl->ofl_lml, ERR_WARNING,
-			    MSG_INTL(reject[rej.rej_type]),
-			    rej.rej_name ? rej.rej_name :
-			    MSG_INTL(MSG_STR_UNKNOWN), conv_reject_desc(&rej));
+	if ((found == 0) && (rej.rej_type)) {
+		Conv_reject_desc_buf_t rej_buf;
+
+		eprintf(ofl->ofl_lml, ERR_WARNING,
+		    MSG_INTL(reject[rej.rej_type]),
+		    rej.rej_name ? rej.rej_name : MSG_INTL(MSG_STR_UNKNOWN),
+		    conv_reject_desc(&rej, &rej_buf));
 	}
 
 	/*
--- a/usr/src/cmd/sgs/libld/common/machrel.amd.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/libld/common/machrel.amd.c	Thu Jul 26 08:45:42 2007 -0700
@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 #pragma ident	"%Z%%M%	%I%	%E% SMI"
@@ -136,7 +136,7 @@
 	 * NOTE: 0x06 represents next instruction.
 	 */
 	val1 = (ofl->ofl_osgot->os_shdr->sh_addr + got_off) -
-		(ofl->ofl_osplt->os_shdr->sh_addr + plt_off) - 0x06;
+	    (ofl->ofl_osplt->os_shdr->sh_addr + plt_off) - 0x06;
 
 	/*
 	 * If '-z noreloc' is specified - skip the do_reloc
@@ -257,13 +257,13 @@
 			raddend += (Off)_elf_getxoff(psym->sd_isc->is_indata);
 			if (psym->sd_isc->is_shdr->sh_flags & SHF_ALLOC)
 				raddend +=
-				psym->sd_isc->is_osdesc->os_shdr->sh_addr;
+				    psym->sd_isc->is_osdesc->os_shdr->sh_addr;
 		} else {
 			/* LINTED */
 			raddend += (Off)_elf_getxoff(sdp->sd_isc->is_indata);
 			if (sdp->sd_isc->is_shdr->sh_flags & SHF_ALLOC)
 				raddend +=
-				sdp->sd_isc->is_osdesc->os_shdr->sh_addr;
+				    sdp->sd_isc->is_osdesc->os_shdr->sh_addr;
 		}
 	}
 
@@ -715,8 +715,9 @@
 					    sdp->sd_isc->is_indata);
 					if (sdp->sd_isc->is_shdr->sh_flags &
 					    SHF_ALLOC)
-					    value += sdp->sd_isc->is_osdesc->
-					    os_shdr->sh_addr;
+						value +=
+						    sdp->sd_isc->is_osdesc->
+						    os_shdr->sh_addr;
 				}
 				if (sdp->sd_isc->is_shdr->sh_flags & SHF_TLS)
 					value -= ofl->ofl_tlsphdr->p_vaddr;
@@ -909,10 +910,13 @@
 			 * see this.
 			 */
 			if (arsp->rel_isdesc->is_indata->d_buf == 0) {
+				Conv_inv_buf_t inv_buf;
+
 				eprintf(ofl->ofl_lml, ERR_FATAL,
 				    MSG_INTL(MSG_REL_EMPTYSEC),
-				    conv_reloc_amd64_type(arsp->rel_rtype, 0),
-				    ifl_name, demangle(arsp->rel_sname),
+				    conv_reloc_amd64_type(arsp->rel_rtype,
+				    0, &inv_buf), ifl_name,
+				    demangle(arsp->rel_sname),
 				    arsp->rel_isdesc->is_name);
 				return (S_ERROR);
 			}
@@ -932,7 +936,8 @@
 			if ((((uintptr_t)addr - (uintptr_t)ofl->ofl_nehdr) >
 			    ofl->ofl_size) || (arsp->rel_roffset >
 			    arsp->rel_osdesc->os_shdr->sh_size)) {
-				int	class;
+				int		class;
+				Conv_inv_buf_t inv_buf;
 
 				if (((uintptr_t)addr -
 				    (uintptr_t)ofl->ofl_nehdr) > ofl->ofl_size)
@@ -942,8 +947,9 @@
 
 				eprintf(ofl->ofl_lml, class,
 				    MSG_INTL(MSG_REL_INVALOFFSET),
-				    conv_reloc_amd64_type(arsp->rel_rtype, 0),
-				    ifl_name, arsp->rel_isdesc->is_name,
+				    conv_reloc_amd64_type(arsp->rel_rtype,
+				    0, &inv_buf), ifl_name,
+				    arsp->rel_isdesc->is_name,
 				    demangle(arsp->rel_sname),
 				    EC_ADDR((uintptr_t)addr -
 				    (uintptr_t)ofl->ofl_nehdr));
@@ -1189,6 +1195,8 @@
 	    ((shndx == SHN_UNDEF) ||
 	    ((sdp->sd_ref == REF_DYN_NEED) &&
 	    ((sdp->sd_flags & FLG_SY_MVTOCOMM) == 0)))) {
+		Conv_inv_buf_t inv_buf;
+
 		/*
 		 * If the relocation is against a SHT_SUNW_ANNOTATE
 		 * section - then silently ignore that the relocation
@@ -1199,7 +1207,7 @@
 			return (0);
 		(void) eprintf(ofl->ofl_lml, ERR_WARNING,
 		    MSG_INTL(MSG_REL_EXTERNSYM),
-		    conv_reloc_amd64_type(rsp->rel_rtype, 0),
+		    conv_reloc_amd64_type(rsp->rel_rtype, 0, &inv_buf),
 		    rsp->rel_isdesc->is_file->ifl_name,
 		    demangle(rsp->rel_sname), rsp->rel_osdesc->os_name);
 		return (1);
@@ -1489,8 +1497,8 @@
 		 *	 be pointing at.
 		 */
 		val1 = (ofl->ofl_osgot->os_shdr->sh_addr) +
-			(M_GOT_XLINKMAP * M_GOT_ENTSIZE) -
-			ofl->ofl_osplt->os_shdr->sh_addr - 0x06;
+		    (M_GOT_XLINKMAP * M_GOT_ENTSIZE) -
+		    ofl->ofl_osplt->os_shdr->sh_addr - 0x06;
 
 		/*
 		 * If '-z noreloc' is specified - skip the do_reloc
@@ -1512,8 +1520,8 @@
 		 *  JMP	*GOT+16(%rip)
 		 */
 		val1 = (ofl->ofl_osgot->os_shdr->sh_addr) +
-			(M_GOT_XRTLD * M_GOT_ENTSIZE) -
-			ofl->ofl_osplt->os_shdr->sh_addr - 0x0c;
+		    (M_GOT_XRTLD * M_GOT_ENTSIZE) -
+		    ofl->ofl_osplt->os_shdr->sh_addr - 0x0c;
 		/*
 		 * If '-z noreloc' is specified - skip the do_reloc
 		 * stage.
--- a/usr/src/cmd/sgs/libld/common/machrel.intel.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/libld/common/machrel.intel.c	Thu Jul 26 08:45:42 2007 -0700
@@ -133,7 +133,7 @@
 		pltent += 2;
 		/* LINTED */
 		*(Word *)pltent = (Word)(ofl->ofl_osgot->os_shdr->sh_addr +
-			got_off);
+		    got_off);
 	} else {
 		pltent[0] = M_SPECIAL_INST;
 		pltent[1] = M_JMP_REG_DISP_IND;
@@ -202,7 +202,7 @@
 		    orsp->rel_roffset)))) {
 			DBG_CALL(Dbg_move_outsctadj(ofl->ofl_lml, psym));
 			sectmoved = 1;
-		    }
+		}
 	}
 
 	value = sdp->sd_sym->st_value;
@@ -556,11 +556,17 @@
 		/*
 		 * Unexpected instruction sequence - fatal error.
 		 */
-		eprintf(ofl->ofl_lml, ERR_FATAL, MSG_INTL(MSG_REL_BADTLSINS),
-		    conv_reloc_386_type(arsp->rel_rtype, 0),
-		    arsp->rel_isdesc->is_file->ifl_name,
-		    demangle(arsp->rel_sname), arsp->rel_isdesc->is_name,
-		    EC_OFF(arsp->rel_roffset));
+		{
+			Conv_inv_buf_t	inv_buf;
+
+			eprintf(ofl->ofl_lml, ERR_FATAL,
+			    MSG_INTL(MSG_REL_BADTLSINS),
+			    conv_reloc_386_type(arsp->rel_rtype, 0, &inv_buf),
+			    arsp->rel_isdesc->is_file->ifl_name,
+			    demangle(arsp->rel_sname),
+			    arsp->rel_isdesc->is_name,
+			    EC_OFF(arsp->rel_roffset));
+		}
 		return (FIX_ERROR);
 
 	case R_386_TLS_IE:
@@ -617,11 +623,17 @@
 		/*
 		 * Unexpected instruction sequence - fatal error.
 		 */
-		eprintf(ofl->ofl_lml, ERR_FATAL, MSG_INTL(MSG_REL_BADTLSINS),
-		    conv_reloc_386_type(arsp->rel_rtype, 0),
-		    arsp->rel_isdesc->is_file->ifl_name,
-		    demangle(arsp->rel_sname), arsp->rel_isdesc->is_name,
-		    EC_OFF(arsp->rel_roffset));
+		{
+			Conv_inv_buf_t	inv_buf;
+
+			eprintf(ofl->ofl_lml, ERR_FATAL,
+			    MSG_INTL(MSG_REL_BADTLSINS),
+			    conv_reloc_386_type(arsp->rel_rtype, 0, &inv_buf),
+			    arsp->rel_isdesc->is_file->ifl_name,
+			    demangle(arsp->rel_sname),
+			    arsp->rel_isdesc->is_name,
+			    EC_OFF(arsp->rel_roffset));
+		}
 		return (FIX_ERROR);
 	}
 	return (FIX_RELOC);
@@ -913,9 +925,12 @@
 			 * see this.
 			 */
 			if (arsp->rel_isdesc->is_indata->d_buf == 0) {
+				Conv_inv_buf_t	inv_buf;
+
 				eprintf(ofl->ofl_lml, ERR_FATAL,
 				    MSG_INTL(MSG_REL_EMPTYSEC),
-				    conv_reloc_386_type(arsp->rel_rtype, 0),
+				    conv_reloc_386_type(arsp->rel_rtype,
+				    0, &inv_buf),
 				    ifl_name, demangle(arsp->rel_sname),
 				    arsp->rel_isdesc->is_name);
 				return (S_ERROR);
@@ -936,7 +951,8 @@
 			if ((((uintptr_t)addr - (uintptr_t)ofl->ofl_nehdr) >
 			    ofl->ofl_size) || (arsp->rel_roffset >
 			    arsp->rel_osdesc->os_shdr->sh_size)) {
-				int	class;
+				Conv_inv_buf_t	inv_buf;
+				int		class;
 
 				if (((uintptr_t)addr -
 				    (uintptr_t)ofl->ofl_nehdr) > ofl->ofl_size)
@@ -946,7 +962,8 @@
 
 				eprintf(ofl->ofl_lml, class,
 				    MSG_INTL(MSG_REL_INVALOFFSET),
-				    conv_reloc_386_type(arsp->rel_rtype, 0),
+				    conv_reloc_386_type(arsp->rel_rtype,
+				    0, &inv_buf),
 				    ifl_name, arsp->rel_isdesc->is_name,
 				    demangle(arsp->rel_sname),
 				    EC_ADDR((uintptr_t)addr -
@@ -1186,6 +1203,8 @@
 	    ((shndx == SHN_UNDEF) ||
 	    ((sdp->sd_ref == REF_DYN_NEED) &&
 	    ((sdp->sd_flags & FLG_SY_MVTOCOMM) == 0)))) {
+		Conv_inv_buf_t inv_buf;
+
 		/*
 		 * If the relocation is against a SHT_SUNW_ANNOTATE
 		 * section - then silently ignore that the relocation
@@ -1195,7 +1214,7 @@
 		    (rsp->rel_osdesc->os_shdr->sh_type == SHT_SUNW_ANNOTATE))
 			return (0);
 		eprintf(ofl->ofl_lml, ERR_WARNING, MSG_INTL(MSG_REL_EXTERNSYM),
-		    conv_reloc_386_type(rsp->rel_rtype, 0),
+		    conv_reloc_386_type(rsp->rel_rtype, 0, &inv_buf),
 		    rsp->rel_isdesc->is_file->ifl_name,
 		    demangle(rsp->rel_sname), rsp->rel_osdesc->os_name);
 		return (1);
@@ -1473,28 +1492,28 @@
 			pltent += 2;
 			/* LINTED */
 			*(Word *)pltent = (Word)(ofl->ofl_osgot->os_shdr->
-				sh_addr + M_GOT_XLINKMAP * M_GOT_ENTSIZE);
+			    sh_addr + M_GOT_XLINKMAP * M_GOT_ENTSIZE);
 			pltent += 4;
 			pltent[0] = M_SPECIAL_INST;
 			pltent[1] = M_JMP_DISP_IND;
 			pltent += 2;
 			/* LINTED */
 			*(Word *)pltent = (Word)(ofl->ofl_osgot->os_shdr->
-				sh_addr + M_GOT_XRTLD * M_GOT_ENTSIZE);
+			    sh_addr + M_GOT_XRTLD * M_GOT_ENTSIZE);
 		} else {
 			pltent[0] = M_SPECIAL_INST;
 			pltent[1] = M_PUSHL_REG_DISP;
 			pltent += 2;
 			/* LINTED */
 			*(Word *)pltent = (Word)(M_GOT_XLINKMAP *
-				M_GOT_ENTSIZE);
+			    M_GOT_ENTSIZE);
 			pltent += 4;
 			pltent[0] = M_SPECIAL_INST;
 			pltent[1] = M_JMP_REG_DISP_IND;
 			pltent += 2;
 			/* LINTED */
 			*(Word *)pltent = (Word)(M_GOT_XRTLD *
-				M_GOT_ENTSIZE);
+			    M_GOT_ENTSIZE);
 		}
 	}
 	return (1);
--- a/usr/src/cmd/sgs/libld/common/machrel.sparc.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/libld/common/machrel.sparc.c	Thu Jul 26 08:45:42 2007 -0700
@@ -232,7 +232,7 @@
 
 
 	farblkcnt = ((ofl->ofl_pltcnt - 1 +
-		M_PLT_XNumber - M64_PLT_NEARPLTS) / M64_PLT_FBLKCNTS);
+	    M_PLT_XNumber - M64_PLT_NEARPLTS) / M64_PLT_FBLKCNTS);
 
 	/*
 	 * Determine the 'Far' PLT index.
@@ -250,10 +250,10 @@
 	 * that this PLT is a member of.
 	 */
 	pltblockoff = (M64_PLT_NEARPLTS * M_PLT_ENTSIZE) +
-		(blockndx * M64_PLT_FBLOCKSZ);
+	    (blockndx * M64_PLT_FBLOCKSZ);
 
 	pltoff = pltblockoff +
-		(farpltblkndx * M64_PLT_FENTSIZE);
+	    (farpltblkndx * M64_PLT_FENTSIZE);
 
 	pltptroff = pltblockoff;
 
@@ -264,7 +264,7 @@
 		 * after 160 fplts.
 		 */
 		pltptroff += (M64_PLT_FBLKCNTS * M64_PLT_FENTSIZE) +
-			(farpltblkndx * M64_PLT_PSIZE);
+		    (farpltblkndx * M64_PLT_PSIZE);
 	} else {
 		Xword	lastblkpltndx;
 		/*
@@ -272,9 +272,9 @@
 		 * after the last FPLT instruction sequence.
 		 */
 		lastblkpltndx = (ofl->ofl_pltcnt - 1 + M_PLT_XNumber -
-			M64_PLT_NEARPLTS) % M64_PLT_FBLKCNTS;
+		    M64_PLT_NEARPLTS) % M64_PLT_FBLKCNTS;
 		pltptroff += ((lastblkpltndx + 1) * M64_PLT_FENTSIZE) +
-			(farpltblkndx * M64_PLT_PSIZE);
+		    (farpltblkndx * M64_PLT_PSIZE);
 	}
 	pltbuf = (uchar_t *)ofl->ofl_osplt->os_outdata->d_buf;
 
@@ -349,8 +349,7 @@
 	}
 
 	pltoff = M_PLT_RESERVSZ + (pltndx - 1) * M_PLT_ENTSIZE;
-	pltent = (uchar_t *)ofl->ofl_osplt->os_outdata->d_buf +
-		pltoff;
+	pltent = (uchar_t *)ofl->ofl_osplt->os_outdata->d_buf + pltoff;
 
 	*roffset = pltoff + (Xword)(ofl->ofl_osplt->os_shdr->sh_addr);
 	*raddend = 0;
@@ -370,7 +369,7 @@
 	pltoff = -pltoff;
 	/* LINTED */
 	*(Word *)pltent = M_BA_A_XCC |
-		(((pltoff + M_PLT_ENTSIZE) >> 2) & S_MASK(19));
+	    (((pltoff + M_PLT_ENTSIZE) >> 2) & S_MASK(19));
 
 	/*
 	 * PLT[2]: sethi 0, %g0 (NOP for delay slot of eventual CTI).
@@ -567,13 +566,13 @@
 			raddend += (Off)_elf_getxoff(psym->sd_isc->is_indata);
 			if (psym->sd_isc->is_shdr->sh_flags & SHF_ALLOC)
 				raddend +=
-				psym->sd_isc->is_osdesc->os_shdr->sh_addr;
+				    psym->sd_isc->is_osdesc->os_shdr->sh_addr;
 		} else {
 			/* LINTED */
 			raddend += (Off)_elf_getxoff(sdp->sd_isc->is_indata);
 			if (sdp->sd_isc->is_shdr->sh_flags & SHF_ALLOC)
 				raddend +=
-				sdp->sd_isc->is_osdesc->os_shdr->sh_addr;
+				    sdp->sd_isc->is_osdesc->os_shdr->sh_addr;
 		}
 	}
 
@@ -634,9 +633,11 @@
 		if (((rep->re_fsize == 2) && (roffset & 0x1)) ||
 		    ((rep->re_fsize == 4) && (roffset & 0x3)) ||
 		    ((rep->re_fsize == 8) && (roffset & 0x7))) {
+			Conv_inv_buf_t inv_buf;
+
 			eprintf(ofl->ofl_lml, ERR_FATAL,
 			    MSG_INTL(MSG_REL_NONALIGN),
-			    conv_reloc_SPARC_type(orsp->rel_rtype, 0),
+			    conv_reloc_SPARC_type(orsp->rel_rtype, 0, &inv_buf),
 			    orsp->rel_isdesc->is_file->ifl_name,
 			    demangle(orsp->rel_sname), EC_XWORD(roffset));
 			return (S_ERROR);
@@ -686,7 +687,7 @@
 	relbits = (char *)relosp->os_outdata->d_buf;
 
 	rea.r_info = ELF_R_INFO(ndx, ELF_R_TYPE_INFO(orsp->rel_typedata,
-			orsp->rel_rtype));
+	    orsp->rel_rtype));
 	rea.r_offset = roffset;
 	rea.r_addend = raddend;
 	DBG_CALL(Dbg_reloc_out(ofl, ELF_DBG_LD, SHT_RELA, &rea, relosp->os_name,
@@ -743,8 +744,8 @@
 	uint_t		*offset;
 
 	offset = (uint_t *)((uintptr_t)arsp->rel_roffset +
-		(uintptr_t)_elf_getxoff(arsp->rel_isdesc->is_indata) +
-		(uintptr_t)arsp->rel_osdesc->os_outdata->d_buf);
+	    (uintptr_t)_elf_getxoff(arsp->rel_isdesc->is_indata) +
+	    (uintptr_t)arsp->rel_osdesc->os_outdata->d_buf);
 
 	if (sdp->sd_ref == REF_DYN_NEED) {
 		/*
@@ -878,6 +879,7 @@
 	Word		rtype = arsp->rel_rtype;
 	uint_t		*offset;
 	const char	*ifl_name;
+	Conv_inv_buf_t	inv_buf;
 
 	switch (rtype) {
 	case R_SPARC_GOTDATA_OP_HIX22:
@@ -920,7 +922,7 @@
 		ifl_name = MSG_INTL(MSG_STR_NULL);
 
 	eprintf(ofl->ofl_lml, ERR_FATAL, MSG_INTL(MSG_REL_BADGOTFIX),
-	    conv_reloc_SPARC_type(arsp->rel_rtype, 0),
+	    conv_reloc_SPARC_type(arsp->rel_rtype, 0, &inv_buf),
 	    ifl_name, demangle(arsp->rel_sname));
 
 	assert(0);
@@ -1152,7 +1154,7 @@
 			} else if (IS_GOT_BASED(arsp->rel_rtype) &&
 			    ((flags & FLG_OF_RELOBJ) == 0)) {
 				value -= (ofl->ofl_osgot->os_shdr->sh_addr +
-					(-neggotoffset * M_GOT_ENTSIZE));
+				    (-neggotoffset * M_GOT_ENTSIZE));
 
 			} else if (IS_PC_RELATIVE(arsp->rel_rtype)) {
 				value -= refaddr;
@@ -1215,10 +1217,13 @@
 			 * see this.
 			 */
 			if (arsp->rel_isdesc->is_indata->d_buf == 0) {
+				Conv_inv_buf_t	inv_buf;
+
 				eprintf(ofl->ofl_lml, ERR_FATAL,
 				    MSG_INTL(MSG_REL_EMPTYSEC),
-				    conv_reloc_SPARC_type(arsp->rel_rtype, 0),
-				    ifl_name, demangle(arsp->rel_sname),
+				    conv_reloc_SPARC_type(arsp->rel_rtype,
+				    0, &inv_buf), ifl_name,
+				    demangle(arsp->rel_sname),
 				    arsp->rel_isdesc->is_name);
 				return (S_ERROR);
 			}
@@ -1239,7 +1244,8 @@
 			if ((((uintptr_t)addr - (uintptr_t)ofl->ofl_nehdr) >
 			    ofl->ofl_size) || (arsp->rel_roffset >
 			    arsp->rel_osdesc->os_shdr->sh_size)) {
-				int	class;
+				Conv_inv_buf_t	inv_buf;
+				int		class;
 
 				if (((uintptr_t)addr -
 				    (uintptr_t)ofl->ofl_nehdr) > ofl->ofl_size)
@@ -1249,8 +1255,9 @@
 
 				eprintf(ofl->ofl_lml, class,
 				    MSG_INTL(MSG_REL_INVALOFFSET),
-				    conv_reloc_SPARC_type(arsp->rel_rtype, 0),
-				    ifl_name, arsp->rel_isdesc->is_name,
+				    conv_reloc_SPARC_type(arsp->rel_rtype,
+				    0, &inv_buf), ifl_name,
+				    arsp->rel_isdesc->is_name,
 				    demangle(arsp->rel_sname),
 				    EC_ADDR((uintptr_t)addr -
 				    (uintptr_t)ofl->ofl_nehdr));
@@ -1283,6 +1290,7 @@
 	Rel_desc	*orsp;
 	Rel_cache	*rcp;
 	Sym_desc	*sdp = rsp->rel_sym;
+	Conv_inv_buf_t	inv_buf;
 
 	/*
 	 * Static executables *do not* want any relocations against them.
@@ -1306,11 +1314,10 @@
 		 * are not relative they make no sense to create in a shared
 		 * object - so emit the proper error message if that occurs.
 		 */
-		if ((rtype == R_SPARC_HIPLT22) ||
-		    (rtype == R_SPARC_LOPLT10)) {
+		if ((rtype == R_SPARC_HIPLT22) || (rtype == R_SPARC_LOPLT10)) {
 			eprintf(ofl->ofl_lml, ERR_FATAL,
 			    MSG_INTL(MSG_REL_UNRELREL),
-			    conv_reloc_SPARC_type(rsp->rel_rtype, 0),
+			    conv_reloc_SPARC_type(rsp->rel_rtype, 0, &inv_buf),
 			    rsp->rel_isdesc->is_file->ifl_name,
 			    demangle(rsp->rel_sname));
 			return (S_ERROR);
@@ -1327,7 +1334,7 @@
 		    (rtype == R_SPARC_L44)) {
 			eprintf(ofl->ofl_lml, ERR_FATAL,
 			    MSG_INTL(MSG_REL_SHOBJABS44),
-			    conv_reloc_SPARC_type(rsp->rel_rtype, 0),
+			    conv_reloc_SPARC_type(rsp->rel_rtype, 0, &inv_buf),
 			    rsp->rel_isdesc->is_file->ifl_name,
 			    demangle(rsp->rel_sname));
 			return (S_ERROR);
@@ -1570,6 +1577,8 @@
 	    ((shndx == SHN_UNDEF) ||
 	    ((sdp->sd_ref == REF_DYN_NEED) &&
 	    ((sdp->sd_flags & FLG_SY_MVTOCOMM) == 0)))) {
+		Conv_inv_buf_t	inv_buf;
+
 		/*
 		 * If the relocation is against a SHT_SUNW_ANNOTATE
 		 * section - then silently ignore that the relocation
@@ -1580,7 +1589,7 @@
 			return (0);
 		(void) eprintf(ofl->ofl_lml, ERR_WARNING,
 		    MSG_INTL(MSG_REL_EXTERNSYM),
-		    conv_reloc_SPARC_type(rsp->rel_rtype, 0),
+		    conv_reloc_SPARC_type(rsp->rel_rtype, 0, &inv_buf),
 		    rsp->rel_isdesc->is_file->ifl_name,
 		    demangle(rsp->rel_sname), rsp->rel_osdesc->os_name);
 		return (1);
--- a/usr/src/cmd/sgs/libld/common/machsym.sparc.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/libld/common/machsym.sparc.c	Thu Jul 26 08:45:42 2007 -0700
@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 #pragma ident	"%Z%%M%	%I%	%E% SMI"
@@ -60,6 +60,7 @@
 {
 	Sym		*osym = sdp->sd_sym;
 	const char	*oname = sdp->sd_name;
+	Conv_inv_buf_t	inv_buf1, inv_buf2;
 
 	/*
 	 * Scratch register definitions are compatible.
@@ -73,9 +74,10 @@
 	if ((ELF_ST_BIND(osym->st_info) == STB_LOCAL) ||
 	    (ELF_ST_BIND(nsym->st_info) == STB_LOCAL)) {
 		if (osym->st_value == nsym->st_value) {
+
 			eprintf(ofl->ofl_lml, ERR_FATAL,
 			    MSG_INTL(MSG_SYM_INCOMPREG3),
-			    conv_sym_SPARC_value(osym->st_value, 0),
+			    conv_sym_SPARC_value(osym->st_value, 0, &inv_buf1),
 			    sdp->sd_file->ifl_name, demangle(oname),
 			    ifl->ifl_name, demangle(nname));
 			ofl->ofl_flags |= FLG_OF_FATAL;
@@ -93,7 +95,7 @@
 		    (strcmp(oname, nname) != 0)) {
 			eprintf(ofl->ofl_lml, ERR_FATAL,
 			    MSG_INTL(MSG_SYM_INCOMPREG1),
-			    conv_sym_SPARC_value(osym->st_value, 0),
+			    conv_sym_SPARC_value(osym->st_value, 0, &inv_buf1),
 			    sdp->sd_file->ifl_name, demangle(oname),
 			    ifl->ifl_name, demangle(nname));
 			ofl->ofl_flags |= FLG_OF_FATAL;
@@ -107,7 +109,7 @@
 		    (nsym->st_shndx == SHN_ABS)) {
 			eprintf(ofl->ofl_lml, ERR_FATAL,
 			    MSG_INTL(MSG_SYM_MULTINIREG),
-			    conv_sym_SPARC_value(osym->st_value, 0),
+			    conv_sym_SPARC_value(osym->st_value, 0, &inv_buf1),
 			    demangle(nname), sdp->sd_file->ifl_name,
 			    ifl->ifl_name);
 			ofl->ofl_flags |= FLG_OF_FATAL;
@@ -117,8 +119,9 @@
 	} else if (strcmp(oname, nname) == 0) {
 		eprintf(ofl->ofl_lml, ERR_FATAL, MSG_INTL(MSG_SYM_INCOMPREG2),
 		    demangle(sdp->sd_name), sdp->sd_file->ifl_name,
-		    conv_sym_SPARC_value(osym->st_value, 0), ifl->ifl_name,
-		    conv_sym_SPARC_value(nsym->st_value, 0));
+		    conv_sym_SPARC_value(osym->st_value, 0, &inv_buf1),
+		    ifl->ifl_name,
+		    conv_sym_SPARC_value(nsym->st_value, 0, &inv_buf2));
 		ofl->ofl_flags |= FLG_OF_FATAL;
 		return (1);
 	}
@@ -128,9 +131,10 @@
 int
 ld_mach_sym_typecheck(Sym_desc *sdp, Sym *nsym, Ifl_desc *ifl, Ofl_desc *ofl)
 {
-	Sym	*osym = sdp->sd_sym;
-	Byte	otype = ELF_ST_TYPE(osym->st_info);
-	Byte	ntype = ELF_ST_TYPE(nsym->st_info);
+	Conv_inv_buf_t	inv_buf1, inv_buf2;
+	Sym		*osym = sdp->sd_sym;
+	Byte		otype = ELF_ST_TYPE(osym->st_info);
+	Byte		ntype = ELF_ST_TYPE(nsym->st_info);
 
 	if (otype != ntype) {
 		if ((otype == STT_SPARC_REGISTER) ||
@@ -140,10 +144,10 @@
 			eprintf(ofl->ofl_lml, ERR_NONE,
 			    MSG_INTL(MSG_SYM_FILETYPES),
 			    sdp->sd_file->ifl_name, conv_sym_info_type(
-			    sdp->sd_file->ifl_ehdr->e_machine, otype, 0),
-			    ifl->ifl_name,
+			    sdp->sd_file->ifl_ehdr->e_machine, otype,
+			    0, &inv_buf1), ifl->ifl_name,
 			    conv_sym_info_type(ifl->ifl_ehdr->e_machine,
-			    ntype, 0));
+			    ntype, 0, &inv_buf2));
 			ofl->ofl_flags |= FLG_OF_FATAL;
 			return (1);
 		}
@@ -200,10 +204,12 @@
 		 */
 		if ((ELF_ST_BIND(sym->st_info) != STB_GLOBAL) ||
 		    (shndx != SHN_UNDEF)) {
+			Conv_inv_buf_t inv_buf;
+
 			eprintf(ofl->ofl_lml, ERR_FATAL,
 			    MSG_INTL(MSG_SYM_BADSCRATCH),
 			    ifl->ifl_name, symsecname, symndx,
-			    conv_sym_SPARC_value(sym->st_value, 0));
+			    conv_sym_SPARC_value(sym->st_value, 0, &inv_buf));
 			return ((const char *)S_ERROR);
 		}
 
--- a/usr/src/cmd/sgs/libld/common/relocate.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/libld/common/relocate.c	Thu Jul 26 08:45:42 2007 -0700
@@ -63,6 +63,7 @@
 	Is_desc		*irel;
 	Addr		symaddr = cpy->copyrel_stval;
 	Listnode	*lnp1;
+	Conv_inv_buf_t	inv_buf;
 
 	/*
 	 * This symbol may not be *disp* relocated at run time, but could
@@ -72,8 +73,8 @@
 	if ((ifl->ifl_flags & FLG_IF_DISPDONE) &&
 	    (ofl->ofl_flags & FLG_OF_VERBOSE))
 		eprintf(ofl->ofl_lml, ERR_WARNING, MSG_INTL(MSG_REL_DISPREL2),
-		    conv_reloc_type(ifl->ifl_ehdr->e_machine, M_R_COPY, 0),
-		    ifl->ifl_name, demangle(sdp->sd_name));
+		    conv_reloc_type(ifl->ifl_ehdr->e_machine, M_R_COPY,
+		    0, &inv_buf), ifl->ifl_name, demangle(sdp->sd_name));
 
 	if ((ifl->ifl_flags & FLG_IF_DISPPEND) == 0)
 		return;
@@ -130,8 +131,8 @@
 				eprintf(ofl->ofl_lml,
 				    ERR_WARNING, MSG_INTL(MSG_REL_DISPREL1),
 				    conv_reloc_type(ifl->ifl_ehdr->e_machine,
-				    (uint_t)ELF_R_TYPE(reloc->r_info), 0),
-				    ifl->ifl_name, str,
+				    (uint_t)ELF_R_TYPE(reloc->r_info),
+				    0, &inv_buf), ifl->ifl_name, str,
 				    MSG_INTL(MSG_STR_UNKNOWN),
 				    EC_XWORD(reloc->r_offset),
 				    demangle(sdp->sd_name));
@@ -159,7 +160,7 @@
 			eprintf(ofl->ofl_lml, ERR_WARNING,
 			    MSG_INTL(MSG_REL_DISPREL1),
 			    conv_reloc_type(ifl->ifl_ehdr->e_machine,
-			    (uint_t)ELF_R_TYPE(reloc->r_info), 0),
+			    (uint_t)ELF_R_TYPE(reloc->r_info), 0, &inv_buf),
 			    ifl->ifl_name, demangle(rsdp->sd_name), str,
 			    EC_XWORD(reloc->r_offset), str);
 		}
@@ -301,6 +302,7 @@
 	Sym_desc	*sdp;
 	const char	*str;
 	Ifl_desc	*ifl = rsp->rel_isdesc->is_file;
+	Conv_inv_buf_t	inv_buf;
 
 	if ((sdp = disp_scansyms(ifl, rsp, 0, 1, ofl)) != 0)
 		str = demangle(sdp->sd_name);
@@ -308,8 +310,9 @@
 		str = MSG_INTL(MSG_STR_UNKNOWN);
 
 	eprintf(ofl->ofl_lml, ERR_WARNING, msg,
-	    conv_reloc_type(ifl->ifl_ehdr->e_machine, rsp->rel_rtype, 0),
-	    ifl->ifl_name, rsp->rel_sname, str, EC_OFF(rsp->rel_roffset));
+	    conv_reloc_type(ifl->ifl_ehdr->e_machine, rsp->rel_rtype,
+	    0, &inv_buf), ifl->ifl_name, rsp->rel_sname, str,
+	    EC_OFF(rsp->rel_roffset));
 }
 
 /*
@@ -712,9 +715,11 @@
 	 * relocations).
 	 */
 	if (ELF_ST_TYPE(sym->st_info) != STT_OBJECT) {
+		Conv_inv_buf_t inv_buf;
+
 		eprintf(ofl->ofl_lml, ERR_WARNING, MSG_INTL(MSG_REL_UNEXPSYM),
 		    conv_sym_info_type(sdp->sd_file->ifl_ehdr->e_machine,
-		    ELF_ST_TYPE(sym->st_info), 0),
+		    ELF_ST_TYPE(sym->st_info), 0, &inv_buf),
 		    rsp->rel_isdesc->is_file->ifl_name,
 		    demangle(rsp->rel_sname), sdp->sd_file->ifl_name);
 		return (ld_add_outrel(NULL, rsp, ofl));
@@ -867,11 +872,15 @@
 		/*
 		 * If this symbol is a protected symbol, warn it.
 		 */
-		if (_sdp->sd_flags & FLG_SY_PROT)
+		if (_sdp->sd_flags & FLG_SY_PROT) {
+			Conv_inv_buf_t inv_buf;
+
 			eprintf(ofl->ofl_lml, ERR_WARNING,
-			MSG_INTL(MSG_REL_COPY),
-			conv_reloc_type(_sdp->sd_file->ifl_ehdr->e_machine,
-			M_R_COPY, 0), _sdp->sd_file->ifl_name, _sdp->sd_name);
+			    MSG_INTL(MSG_REL_COPY),
+			    conv_reloc_type(_sdp->sd_file->ifl_ehdr->e_machine,
+			    M_R_COPY, 0, &inv_buf), _sdp->sd_file->ifl_name,
+			    _sdp->sd_name);
+		}
 		DBG_CALL(Dbg_syms_reloc(ofl, sdp));
 	}
 	return (ld_add_actrel(NULL, rsp, ofl));
@@ -886,10 +895,11 @@
 reloc_generic(Rel_desc *rsp, Ofl_desc *ofl)
 {
 	Ifl_desc	*ifl = rsp->rel_isdesc->is_file;
+	Conv_inv_buf_t	inv_buf;
 
 	eprintf(ofl->ofl_lml, ERR_WARNING, MSG_INTL(MSG_REL_UNEXPREL),
-	    conv_reloc_type(ifl->ifl_ehdr->e_machine, rsp->rel_rtype, 0),
-	    ifl->ifl_name, demangle(rsp->rel_sname));
+	    conv_reloc_type(ifl->ifl_ehdr->e_machine, rsp->rel_rtype,
+	    0, &inv_buf), ifl->ifl_name, demangle(rsp->rel_sname));
 
 	/*
 	 * If building a shared object then put the relocation off
@@ -943,12 +953,13 @@
 		 */
 		if (IS_GOT_RELATIVE(rsp->rel_rtype)) {
 			Ifl_desc	*ifl = rsp->rel_isdesc->is_file;
+			Conv_inv_buf_t inv_buf;
 
 			eprintf(ofl->ofl_lml, ERR_FATAL,
 			    MSG_INTL(MSG_REL_PICREDLOC),
 			    demangle(rsp->rel_sname), ifl->ifl_name,
 			    conv_reloc_type(ifl->ifl_ehdr->e_machine,
-			    rsp->rel_rtype, 0));
+			    rsp->rel_rtype, 0, &inv_buf));
 			return (S_ERROR);
 		}
 
@@ -994,6 +1005,7 @@
 	Half		mach = ifl->ifl_ehdr->e_machine;
 	Sym_desc	*sdp = rsp->rel_sym;
 	unsigned char	type;
+	Conv_inv_buf_t	inv_buf1, inv_buf2;
 
 	/*
 	 * All TLS relocations are illegal in a static executable.
@@ -1001,7 +1013,7 @@
 	if ((flags & (FLG_OF_STATIC | FLG_OF_EXEC)) ==
 	    (FLG_OF_STATIC | FLG_OF_EXEC)) {
 		eprintf(ofl->ofl_lml, ERR_FATAL, MSG_INTL(MSG_REL_TLSSTAT),
-		    conv_reloc_type(mach, rtype, 0), ifl->ifl_name,
+		    conv_reloc_type(mach, rtype, 0, &inv_buf1), ifl->ifl_name,
 		    demangle(rsp->rel_sname));
 		return (S_ERROR);
 	}
@@ -1012,9 +1024,9 @@
 	 */
 	if ((type = ELF_ST_TYPE(sdp->sd_sym->st_info)) != STT_TLS) {
 		eprintf(ofl->ofl_lml, ERR_FATAL, MSG_INTL(MSG_REL_TLSBADSYM),
-		    conv_reloc_type(mach, rtype, 0), ifl->ifl_name,
+		    conv_reloc_type(mach, rtype, 0, &inv_buf1), ifl->ifl_name,
 		    demangle(rsp->rel_sname),
-		    conv_sym_info_type(mach, type, 0));
+		    conv_sym_info_type(mach, type, 0, &inv_buf2));
 		return (S_ERROR);
 	}
 
@@ -1026,7 +1038,7 @@
 	if (!local && (IS_TLS_LD(rtype) ||
 	    ((flags & FLG_OF_EXEC) && IS_TLS_LE(rtype)))) {
 		eprintf(ofl->ofl_lml, ERR_FATAL, MSG_INTL(MSG_REL_TLSBND),
-		    conv_reloc_type(mach, rtype, 0), ifl->ifl_name,
+		    conv_reloc_type(mach, rtype, 0, &inv_buf1), ifl->ifl_name,
 		    demangle(rsp->rel_sname), sdp->sd_file->ifl_name);
 		return (S_ERROR);
 	}
@@ -1048,15 +1060,15 @@
 		if (IS_TLS_LE(rtype)) {
 			eprintf(ofl->ofl_lml, ERR_FATAL,
 			    MSG_INTL(MSG_REL_TLSLE),
-			    conv_reloc_type(mach, rtype, 0), ifl->ifl_name,
-			    demangle(rsp->rel_sname));
+			    conv_reloc_type(mach, rtype, 0, &inv_buf1),
+			    ifl->ifl_name, demangle(rsp->rel_sname));
 			return (S_ERROR);
 
 		} else if ((IS_TLS_IE(rtype)) && (flags & FLG_OF_VERBOSE)) {
 			eprintf(ofl->ofl_lml, ERR_WARNING,
 			    MSG_INTL(MSG_REL_TLSIE),
-			    conv_reloc_type(mach, rtype, 0), ifl->ifl_name,
-			    demangle(rsp->rel_sname));
+			    conv_reloc_type(mach, rtype, 0, &inv_buf1),
+			    ifl->ifl_name, demangle(rsp->rel_sname));
 		}
 	}
 
@@ -1072,6 +1084,7 @@
 	Sym_desc	*sdp = reld->rel_sym;
 	Sym_aux		*sap;
 	Boolean		local;
+	Conv_inv_buf_t	inv_buf;
 
 	DBG_CALL(Dbg_reloc_in(ofl->ofl_lml, ELF_DBG_LD, M_MACH, M_REL_SHT_TYPE,
 	    (void *)reloc, isname, reld->rel_sname));
@@ -1192,8 +1205,8 @@
 		Ifl_desc	*ifl = reld->rel_isdesc->is_file;
 
 		eprintf(ofl->ofl_lml, ERR_FATAL, MSG_INTL(MSG_REL_BADGOTBASED),
-		    conv_reloc_type(ifl->ifl_ehdr->e_machine, rtype, 0),
-		    ifl->ifl_name, demangle(sdp->sd_name));
+		    conv_reloc_type(ifl->ifl_ehdr->e_machine, rtype,
+		    0, &inv_buf), ifl->ifl_name, demangle(sdp->sd_name));
 		return (S_ERROR);
 	}
 
@@ -1212,7 +1225,8 @@
 			eprintf(ofl->ofl_lml, ERR_FATAL,
 			    MSG_INTL(MSG_REL_BADTLS),
 			    conv_reloc_type(ifl->ifl_ehdr->e_machine,
-			    rtype, 0), ifl->ifl_name, demangle(sdp->sd_name));
+			    rtype, 0, &inv_buf), ifl->ifl_name,
+			    demangle(sdp->sd_name));
 			return (S_ERROR);
 		}
 	}
@@ -1316,6 +1330,7 @@
 	const char	*is_name;
 	Sym		*sym = sdp->sd_sym;
 	Is_desc		*isp = sdp->sd_isc;
+	Conv_inv_buf_t	inv_buf;
 
 	/*
 	 * ld_place_section() can alter the section name if it contains
@@ -1334,8 +1349,8 @@
 	 */
 	if ((isp->is_osdesc == NULL) ||
 	    ((isp->is_shdr->sh_type != SHT_SUNW_COMDAT) &&
-		((isp->is_shdr->sh_flags & SHF_GROUP) == 0)))
-	    return (NULL);
+	    ((isp->is_shdr->sh_flags & SHF_GROUP) == 0)))
+		return (NULL);
 
 	/*
 	 * Examine each input section assigned to this output section.
@@ -1348,6 +1363,7 @@
 	 *	- Have the same SHF_GROUP flag setting (either on or off)
 	 *	- Must be a COMDAT section of one form or the other.
 	 */
+	/* BEGIN CSTYLED */
 	for (LIST_TRAVERSE(&isp->is_osdesc->os_isdescs, lnp, rep_isp)) {
 	    const char *rep_is_name = rep_isp->is_basename ?
 		rep_isp->is_basename : rep_isp->is_name;
@@ -1400,7 +1416,7 @@
 				eprintf(ofl->ofl_lml, ERR_WARNING,
 				    MSG_INTL(MSG_REL_SLOPCDATNAM),
 				    conv_reloc_type(ifl->ifl_ehdr->e_machine,
-					reld->rel_rtype, 0),
+					reld->rel_rtype, 0, &inv_buf),
 				    ifl->ifl_name, reld->rel_isdesc->is_name,
 				    rep_sdp->sd_name, is_name,
 				    rep_sdp->sd_file->ifl_name);
@@ -1409,7 +1425,7 @@
 				    MSG_INTL(MSG_REL_SLOPCDATNONAM),
 				    conv_reloc_type(
 					ifl->ifl_ehdr->e_machine,
-					reld->rel_rtype, 0),
+					reld->rel_rtype, 0, &inv_buf),
 				    ifl->ifl_name, reld->rel_isdesc->is_name,
 				    is_name, rep_sdp->sd_file->ifl_name);
 			    }
@@ -1421,7 +1437,7 @@
 		}
 	    }
 	}
-
+	/* END CSTYLED */
 
 	/* If didn't return above, we didn't find it */
 	return (NULL);
@@ -1437,6 +1453,7 @@
 	Ifl_desc	*ifl = isp->is_file;
 	Word		rtype = reld->rel_rtype;
 	Sym_desc	*sdp;
+	Conv_inv_buf_t	inv_buf;
 
 	/*
 	 * Make sure the relocation is in the valid range.
@@ -1497,8 +1514,8 @@
 
 	if (((ofl->ofl_flags & FLG_OF_RELOBJ) == 0) && IS_NOTSUP(rtype)) {
 		eprintf(ofl->ofl_lml, ERR_FATAL, MSG_INTL(MSG_REL_NOTSUP),
-		    conv_reloc_type(ifl->ifl_ehdr->e_machine, rtype, 0),
-		    ifl->ifl_name, isp->is_name);
+		    conv_reloc_type(ifl->ifl_ehdr->e_machine, rtype,
+		    0, &inv_buf), ifl->ifl_name, isp->is_name);
 		return (S_ERROR);
 	}
 
@@ -1508,8 +1525,9 @@
 	 */
 	if (sdp == NULL) {
 		eprintf(ofl->ofl_lml, ERR_FATAL, MSG_INTL(MSG_REL_NOSYMBOL),
-		    conv_reloc_type(ifl->ifl_ehdr->e_machine, rtype, 0),
-		    isp->is_name, ifl->ifl_name, EC_XWORD(reloc->r_offset));
+		    conv_reloc_type(ifl->ifl_ehdr->e_machine, rtype,
+		    0, &inv_buf), isp->is_name, ifl->ifl_name,
+		    EC_XWORD(reloc->r_offset));
 		return (S_ERROR);
 	}
 
@@ -1537,10 +1555,9 @@
 		}
 		if (nsdp == 0) {
 			eprintf(ofl->ofl_lml, ERR_FATAL,
-				MSG_INTL(MSG_REL_SYMDISC),
-				ifl->ifl_name, isp->is_name,
-				demangle(sdp->sd_name),
-				sdp->sd_isc->is_name);
+			    MSG_INTL(MSG_REL_SYMDISC),
+			    ifl->ifl_name, isp->is_name,
+			    demangle(sdp->sd_name), sdp->sd_isc->is_name);
 			return (S_ERROR);
 		}
 		ifl->ifl_oldndx[rsndx] = sdp = nsdp;
@@ -1568,8 +1585,9 @@
 	if (sdp->sd_isc && (sdp->sd_isc->is_osdesc == 0) &&
 	    (ELF_ST_TYPE(sdp->sd_sym->st_info) == STT_SECTION)) {
 		eprintf(ofl->ofl_lml, ERR_WARNING, MSG_INTL(MSG_RELINVSEC),
-		    conv_reloc_type(ifl->ifl_ehdr->e_machine, rtype, 0),
-		    ifl->ifl_name, isp->is_name, sdp->sd_isc->is_name);
+		    conv_reloc_type(ifl->ifl_ehdr->e_machine, rtype,
+		    0, &inv_buf), ifl->ifl_name, isp->is_name,
+		    sdp->sd_isc->is_name);
 		return (1);
 	}
 
@@ -1582,9 +1600,10 @@
 	if ((sdp->sd_flags & FLG_SY_INVALID) || (rsndx == 0) ||
 	    (rsndx >= ifl->ifl_symscnt)) {
 		eprintf(ofl->ofl_lml, ERR_FATAL, MSG_INTL(MSG_REL_UNKNWSYM),
-		    conv_reloc_type(ifl->ifl_ehdr->e_machine, rtype, 0),
-		    ifl->ifl_name, isp->is_name, demangle(reld->rel_sname),
-		    EC_XWORD(reloc->r_offset), EC_WORD(rsndx));
+		    conv_reloc_type(ifl->ifl_ehdr->e_machine, rtype,
+		    0, &inv_buf), ifl->ifl_name, isp->is_name,
+		    demangle(reld->rel_sname), EC_XWORD(reloc->r_offset),
+		    EC_WORD(rsndx));
 		return (S_ERROR);
 	}
 
@@ -1597,8 +1616,8 @@
 	if (IS_SIZE(rtype) &&
 	    (ELF_ST_TYPE(sdp->sd_sym->st_info) == STT_SECTION)) {
 		eprintf(ofl->ofl_lml, ERR_FATAL, MSG_INTL(MSG_REL_UNSUPSIZE),
-		    conv_reloc_type(ifl->ifl_ehdr->e_machine, rtype, 0),
-		    ifl->ifl_name, isp->is_name);
+		    conv_reloc_type(ifl->ifl_ehdr->e_machine, rtype,
+		    0, &inv_buf), ifl->ifl_name, isp->is_name);
 		return (S_ERROR);
 	}
 
@@ -1823,8 +1842,8 @@
 
 			for (num = mp->m_repeat, _num = 0; _num < num; _num++) {
 				reld.rel_roffset +=
-					/* LINTED */
-					(_num * ELF_M_SIZE(mp->m_info));
+				    /* LINTED */
+				    (_num * ELF_M_SIZE(mp->m_info));
 				/*
 				 * Generate Reld
 				 */
@@ -1839,7 +1858,7 @@
 			reld.rel_flags |= FLG_REL_MOVETAB;
 			reld.rel_osdesc = ofl->ofl_osmove;
 			reld.rel_isdesc =
-				ofl->ofl_osmove->os_isdescs.head->data;
+			    ofl->ofl_osmove->os_isdescs.head->data;
 			if (process_reld(ofl,
 			    rsect, &reld, rsndx, reloc) == S_ERROR)
 				return (S_ERROR);
@@ -2086,18 +2105,17 @@
 
 			if (orsp->rel_flags & FLG_REL_GOT)
 				sorted_list[index].rl_key3 =
-					ld_calc_got_offset(orsp, ofl);
+				    ld_calc_got_offset(orsp, ofl);
 			else {
 				if (orsp->rel_rtype == M_R_REGISTER)
 					sorted_list[index].rl_key3 = 0;
 				else {
 					sorted_list[index].rl_key3 =
-						orsp->rel_roffset +
-						(Xword)_elf_getxoff(orsp->
-						rel_isdesc->
-						is_indata) +
-						orsp->rel_isdesc->is_osdesc->
-						os_shdr->sh_addr;
+					    orsp->rel_roffset +
+					    (Xword)_elf_getxoff(orsp->
+					    rel_isdesc->is_indata) +
+					    orsp->rel_isdesc->is_osdesc->
+					    os_shdr->sh_addr;
 				}
 			}
 
@@ -2106,7 +2124,7 @@
 	}
 
 	qsort(sorted_list, (size_t)ofl->ofl_reloccnt, sizeof (Reloc_list),
-		(int (*)(const void *, const void *))reloc_compare);
+	    (int (*)(const void *, const void *))reloc_compare);
 
 	/*
 	 * All output relocations have now been sorted, go through
@@ -2277,11 +2295,8 @@
 		str1 = MSG_INTL(MSG_REL_RMN_ITM_11);
 
 	eprintf(ofl->ofl_lml, ERR_NONE, MSG_INTL(MSG_REL_REMAIN_FMT_1),
-		str1,
-		MSG_INTL(MSG_REL_RMN_ITM_31),
-		MSG_INTL(MSG_REL_RMN_ITM_12),
-		MSG_INTL(MSG_REL_RMN_ITM_2),
-		MSG_INTL(MSG_REL_RMN_ITM_32));
+	    str1, MSG_INTL(MSG_REL_RMN_ITM_31), MSG_INTL(MSG_REL_RMN_ITM_12),
+	    MSG_INTL(MSG_REL_RMN_ITM_2), MSG_INTL(MSG_REL_RMN_ITM_32));
 
 }
 
@@ -2414,7 +2429,7 @@
 	 * Update r_offset
 	 */
 	*offset2 = (Xword)((itm->mv_oidx - 1)*sizeof (Move) +
-		offset1 % sizeof (Move));
+	    offset1 % sizeof (Move));
 	return (1);
 }
 
--- a/usr/src/cmd/sgs/libld/common/resolve.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/libld/common/resolve.c	Thu Jul 26 08:45:42 2007 -0700
@@ -65,8 +65,9 @@
 sym_typecheck(Sym_desc *sdp, Sym *nsym, Ifl_desc *ifl, Ofl_desc *ofl,
 	int ndx, Word nshndx, Word nsymflags)
 {
-	uchar_t	otype = ELF_ST_TYPE(sdp->sd_sym->st_info);
-	uchar_t	ntype = ELF_ST_TYPE(nsym->st_info);
+	uchar_t		otype = ELF_ST_TYPE(sdp->sd_sym->st_info);
+	uchar_t		ntype = ELF_ST_TYPE(nsym->st_info);
+	Conv_inv_buf_t	inv_buf1, inv_buf2;
 
 	/*
 	 * Perform any machine specific type checking.
@@ -88,7 +89,7 @@
 		if ((nvis > STV_DEFAULT) &&
 		    ((ovis == STV_DEFAULT) || (nvis < ovis))) {
 			osym->st_other =
-				(osym->st_other & ~MSK_SYM_VISIBILITY) | nvis;
+			    (osym->st_other & ~MSK_SYM_VISIBILITY) | nvis;
 		}
 	}
 
@@ -103,9 +104,9 @@
 	    demangle(sdp->sd_name));
 	eprintf(ofl->ofl_lml, ERR_NONE, MSG_INTL(MSG_SYM_FILETYPES),
 	    sdp->sd_file->ifl_name,
-	    conv_sym_info_type(ofl->ofl_dehdr->e_machine, otype, 0),
+	    conv_sym_info_type(ofl->ofl_dehdr->e_machine, otype, 0, &inv_buf1),
 	    ifl->ifl_name,
-	    conv_sym_info_type(ofl->ofl_dehdr->e_machine, ntype, 0));
+	    conv_sym_info_type(ofl->ofl_dehdr->e_machine, ntype, 0, &inv_buf2));
 }
 
 /*ARGSUSED4*/
@@ -237,7 +238,7 @@
 		if ((ovis > STV_DEFAULT) &&
 		    ((nvis == STV_DEFAULT) || (ovis < nvis))) {
 			osym->st_other =
-				(osym->st_other & ~MSK_SYM_VISIBILITY) | ovis;
+			    (osym->st_other & ~MSK_SYM_VISIBILITY) | ovis;
 		}
 		sdp->sd_ref = REF_REL_NEED;
 
@@ -282,8 +283,7 @@
 		 * Visibility from a DYN symbol does not override
 		 * previous symbol visibility.
 		 */
-		osym->st_other = (osym->st_other & ~MSK_SYM_VISIBILITY) |
-			ovis;
+		osym->st_other = (osym->st_other & ~MSK_SYM_VISIBILITY) | ovis;
 
 		/*
 		 * Determine the symbols availability.  A symbol is determined
@@ -375,6 +375,7 @@
 sym_tworeals(Sym_desc *sdp, Sym *nsym, Ifl_desc *ifl, Ofl_desc *ofl,
 	int ndx, Word nshndx, Word nsymflags)
 {
+	Conv_inv_buf_t inv_buf1, inv_buf2;
 	Sym	*osym = sdp->sd_sym;
 	uchar_t	otype = ELF_ST_TYPE(osym->st_info);
 	uchar_t	obind = ELF_ST_BIND(osym->st_info);
@@ -394,9 +395,10 @@
 		    demangle(sdp->sd_name));
 		eprintf(ofl->ofl_lml, ERR_NONE, MSG_INTL(MSG_SYM_FILETYPES),
 		    sdp->sd_file->ifl_name,
-		    conv_sym_info_type(ofl->ofl_dehdr->e_machine, otype, 0),
-		    ifl->ifl_name,
-		    conv_sym_info_type(ofl->ofl_dehdr->e_machine, ntype, 0));
+		    conv_sym_info_type(ofl->ofl_dehdr->e_machine, otype,
+		    0, &inv_buf1), ifl->ifl_name,
+		    conv_sym_info_type(ofl->ofl_dehdr->e_machine, ntype,
+		    0, &inv_buf2));
 		ofl->ofl_flags |= FLG_OF_FATAL;
 		return;
 	}
@@ -415,9 +417,10 @@
 		    demangle(sdp->sd_name));
 		eprintf(ofl->ofl_lml, ERR_NONE, MSG_INTL(MSG_SYM_FILETYPES),
 		    sdp->sd_file->ifl_name,
-		    conv_sym_info_type(ofl->ofl_dehdr->e_machine, otype, 0),
-		    ifl->ifl_name, conv_sym_info_type(ofl->ofl_dehdr->e_machine,
-		    ntype, 0));
+		    conv_sym_info_type(ofl->ofl_dehdr->e_machine, otype,
+		    0, &inv_buf1), ifl->ifl_name,
+		    conv_sym_info_type(ofl->ofl_dehdr->e_machine, ntype,
+		    0, &inv_buf2));
 		warn++;
 	} else if ((otype == STT_OBJECT) && (osym->st_size != nsym->st_size)) {
 		if (!(ofl->ofl_flags & FLG_OF_NOWARN)) {
@@ -474,6 +477,7 @@
 sym_realtent(Sym_desc *sdp, Sym *nsym, Ifl_desc *ifl, Ofl_desc *ofl,
 	int ndx, Word nshndx, Word nsymflags)
 {
+	Conv_inv_buf_t inv_buf1, inv_buf2;
 	Sym	*osym = sdp->sd_sym;
 	uchar_t otype = ELF_ST_TYPE(osym->st_info);
 	uchar_t obind = ELF_ST_BIND(osym->st_info);
@@ -505,7 +509,7 @@
 			eprintf(ofl->ofl_lml, ERR_WARNING,
 			    MSG_INTL(MSG_SYM_DIFFTYPE), demangle(sdp->sd_name));
 			sym_promote(sdp, nsym, ifl, ofl, ndx,
-				nshndx, nsymflags);
+			    nshndx, nsymflags);
 		} else {
 			eprintf(ofl->ofl_lml, ERR_FATAL,
 			    MSG_INTL(MSG_SYM_MULDEF), demangle(sdp->sd_name));
@@ -513,9 +517,10 @@
 		}
 		eprintf(ofl->ofl_lml, ERR_NONE, MSG_INTL(MSG_SYM_FILETYPES),
 		    sdp->sd_file->ifl_name,
-		    conv_sym_info_type(ofl->ofl_dehdr->e_machine, otype, 0),
-		    ifl->ifl_name, conv_sym_info_type(ofl->ofl_dehdr->e_machine,
-		    ntype, 0));
+		    conv_sym_info_type(ofl->ofl_dehdr->e_machine, otype,
+		    0, &inv_buf1), ifl->ifl_name,
+		    conv_sym_info_type(ofl->ofl_dehdr->e_machine, ntype,
+		    0, &inv_buf2));
 		return;
 	} else if (ofile != nfile) {
 
@@ -532,7 +537,7 @@
 		if ((nfile == ET_DYN) && (ntype == STT_FUNC)) {
 			if ((ntype != STB_WEAK) && (otype == STB_WEAK)) {
 				sym_override(sdp, nsym, ifl, ofl, ndx,
-					nshndx, nsymflags);
+				    nshndx, nsymflags);
 				return;
 			} else
 				return;
@@ -553,9 +558,10 @@
 		    demangle(sdp->sd_name));
 		eprintf(ofl->ofl_lml, ERR_NONE, MSG_INTL(MSG_SYM_FILETYPES),
 		    sdp->sd_file->ifl_name,
-		    conv_sym_info_type(ofl->ofl_dehdr->e_machine, otype, 0),
-		    ifl->ifl_name, conv_sym_info_type(ofl->ofl_dehdr->e_machine,
-		    ntype, 0));
+		    conv_sym_info_type(ofl->ofl_dehdr->e_machine, otype,
+		    0, &inv_buf1), ifl->ifl_name,
+		    conv_sym_info_type(ofl->ofl_dehdr->e_machine, ntype,
+		    0, &inv_buf2));
 		warn++;
 	} else if (osym->st_size != nsym->st_size) {
 		/*
@@ -690,6 +696,7 @@
 	 * have a displacement value rather than an alignment.  In other words
 	 * we can only test this for two relocatable objects.
 	 */
+	/* BEGIN CSTYLED */
 	if ((osym->st_value != nsym->st_value) &&
 	    ((sdp->sd_flags & FLG_SY_SPECSEC) &&
 	    (sdp->sd_sym->st_shndx == SHN_COMMON) &&
@@ -703,6 +710,8 @@
 #else
 	    (nsym->st_shndx == SHN_COMMON))) {
 #endif
+	/* END CSTYLED */
+
 		const char	*emsg = MSG_INTL(MSG_SYM_DEFTAKEN);
 		const char	*file;
 		Xword		salign;
--- a/usr/src/cmd/sgs/libld/common/syms.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/libld/common/syms.c	Thu Jul 26 08:45:42 2007 -0700
@@ -1697,6 +1697,7 @@
 	_sdp->sd_isc && _sdp->sd_isc->is_shdr && \
 	((_sym->st_value + _sym->st_size) > _sdp->sd_isc->is_shdr->sh_size))
 
+	Conv_inv_buf_t	inv_buf;
 	Sym		*sym = (Sym *)isc->is_indata->d_buf;
 	Word		*symshndx = 0;
 	Shdr		*shdr = isc->is_shdr;
@@ -1927,7 +1928,8 @@
 					    MSG_INTL(MSG_SYM_INVSHNDX),
 					    demangle(sdp->sd_name),
 					    ifl->ifl_name,
-					    conv_sym_shndx(sym->st_shndx));
+					    conv_sym_shndx(sym->st_shndx,
+					    &inv_buf));
 				}
 				continue;
 			}
@@ -1978,7 +1980,7 @@
 				eprintf(ofl->ofl_lml, ERR_WARNING,
 				    MSG_INTL(MSG_SYM_INVSHNDX),
 				    demangle(sdp->sd_name), ifl->ifl_name,
-				    conv_sym_shndx(sym->st_shndx));
+				    conv_sym_shndx(sym->st_shndx, &inv_buf));
 				sdp->sd_isc = NULL;
 				sdp->sd_flags |= FLG_SY_INVALID;
 				continue;
@@ -2092,7 +2094,8 @@
 		if ((bind != STB_GLOBAL) && (bind != STB_WEAK)) {
 			eprintf(ofl->ofl_lml, ERR_WARNING,
 			    MSG_INTL(MSG_SYM_NONGLOB), demangle(name),
-			    ifl->ifl_name, conv_sym_info_bind(bind, 0));
+			    ifl->ifl_name,
+			    conv_sym_info_bind(bind, 0, &inv_buf));
 			continue;
 		}
 
@@ -2114,7 +2117,7 @@
 				eprintf(ofl->ofl_lml, ERR_WARNING,
 				    MSG_INTL(MSG_SYM_INVSHNDX), demangle(name),
 				    ifl->ifl_name,
-				    conv_sym_shndx(sym->st_shndx));
+				    conv_sym_shndx(sym->st_shndx, &inv_buf));
 				continue;
 			}
 
--- a/usr/src/cmd/sgs/liblddbg/common/bindings.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/liblddbg/common/bindings.c	Thu Jul 26 08:45:42 2007 -0700
@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 #pragma ident	"%Z%%M%	%I%	%E% SMI"
@@ -38,7 +38,7 @@
     Word pltcntu32, Word pltcntu44, Word pltcntfull, Word pltcntfar)
 {
 	Word plttotal = pltcnt21d + pltcnt24d + pltcntu32 +
-		pltcntu44 + pltcntfull + pltcntfar;
+	    pltcntu44 + pltcntfull + pltcntfar;
 
 	if (DBG_NOTCLASS(DBG_C_BINDINGS))
 		return;
@@ -77,7 +77,7 @@
 		MSG_BINFO_COPYREF_SIZE +	MSG_BINFO_SEP_SIZE + \
 		MSG_BINFO_FILTEE_SIZE +		MSG_BINFO_SEP_SIZE + \
 		MSG_BINFO_PLTADDR_SIZE + \
-		CONV_INV_STRSIZE + MSG_BINFO_END_SIZE
+		CONV_INV_BUFSIZE + MSG_BINFO_END_SIZE
 
 
 void
--- a/usr/src/cmd/sgs/liblddbg/common/cap.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/liblddbg/common/cap.c	Thu Jul 26 08:45:42 2007 -0700
@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 #pragma ident	"%Z%%M%	%I%	%E% SMI"
@@ -56,8 +56,11 @@
 void
 Dbg_cap_val_hw1(Lm_list *lml, Xword val, Half mach)
 {
+	Conv_cap_val_hw1_buf_t cap_val_hw1_buf;
+
 	Dbg_util_nl(lml, DBG_NL_FRC);
-	dbg_print(lml, MSG_INTL(MSG_CAP_VAL_HW1), conv_cap_val_hw1(val, mach));
+	dbg_print(lml, MSG_INTL(MSG_CAP_VAL_HW1),
+	    conv_cap_val_hw1(val, mach, &cap_val_hw1_buf));
 	Dbg_util_nl(lml, DBG_NL_FRC);
 }
 
@@ -82,11 +85,15 @@
 void
 Dbg_cap_sec_entry(Lm_list *lml, uint_t type, Xword tag, Xword val, Half mach)
 {
+	Conv_inv_buf_t		inv_buf;
+	Conv_cap_val_buf_t	cap_val_buf;
+
 	if (DBG_NOTCLASS(DBG_C_CAP))
 		return;
 
 	dbg_print(lml, MSG_INTL(MSG_CAP_SEC_ENTRY), MSG_INTL(captype[type]),
-	    conv_cap_tag(tag), conv_cap_val(tag, val, mach));
+	    conv_cap_tag(tag, &inv_buf), conv_cap_val(tag, val, mach,
+	    &cap_val_buf));
 }
 
 void
@@ -110,10 +117,12 @@
 void
 Elf_cap_entry(Lm_list *lml, Cap *cap, int ndx, Half mach)
 {
-	char	index[INDEX_STR_SIZE];
+	Conv_inv_buf_t		inv_buf;
+	Conv_cap_val_buf_t	cap_val_buf;
+	char			index[INDEX_STR_SIZE];
 
 	(void) snprintf(index, INDEX_STR_SIZE, MSG_ORIG(MSG_FMT_INDEX), ndx);
 	dbg_print(lml, MSG_INTL(MSG_CAP_ELF_ENTRY), index,
-	    conv_cap_tag(cap->c_tag),
-	    conv_cap_val(cap->c_tag, cap->c_un.c_val, mach));
+	    conv_cap_tag(cap->c_tag, &inv_buf),
+	    conv_cap_val(cap->c_tag, cap->c_un.c_val, mach, &cap_val_buf));
 }
--- a/usr/src/cmd/sgs/liblddbg/common/dynamic.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/liblddbg/common/dynamic.c	Thu Jul 26 08:45:42 2007 -0700
@@ -44,11 +44,13 @@
 void
 Elf_dyn_entry(Lm_list *lml, Dyn *dyn, int ndx, const char *name, Half mach)
 {
-	char	index[INDEX_STR_SIZE];
+	Conv_inv_buf_t	inv_buf;
+	char		index[INDEX_STR_SIZE];
 
 	(void) snprintf(index, sizeof (index), MSG_ORIG(MSG_FMT_INDEX), ndx);
 	dbg_print(lml, MSG_INTL(MSG_DYN_ENTRY), index,
-	    conv_dyn_tag(dyn->d_tag, mach, 0), EC_XWORD(dyn->d_un.d_val), name);
+	    conv_dyn_tag(dyn->d_tag, mach, 0, &inv_buf),
+	    EC_XWORD(dyn->d_un.d_val), name);
 }
 
 /*
@@ -59,7 +61,8 @@
 void
 Elf_dyn_null_entry(Lm_list *lml, Dyn *dyn, int start_ndx, int end_ndx)
 {
-	char	index[2 * INDEX_STR_SIZE];
+	Conv_inv_buf_t	inv_buf;
+	char		index[2 * INDEX_STR_SIZE];
 
 	if (start_ndx == end_ndx) {
 		Elf_dyn_entry(lml, dyn, start_ndx, MSG_ORIG(MSG_STR_EMPTY), 0);
@@ -67,7 +70,7 @@
 		(void) snprintf(index, sizeof (index),
 		    MSG_ORIG(MSG_FMT_INDEX_RANGE), start_ndx, end_ndx);
 		dbg_print(lml, MSG_INTL(MSG_DYN_ENTRY), index,
-		    conv_dyn_tag(DT_NULL, 0, 0), EC_XWORD(dyn->d_un.d_val),
-		    MSG_ORIG(MSG_STR_EMPTY));
+		    conv_dyn_tag(DT_NULL, 0, 0, &inv_buf),
+		    EC_XWORD(dyn->d_un.d_val), MSG_ORIG(MSG_STR_EMPTY));
 	}
 }
--- a/usr/src/cmd/sgs/liblddbg/common/elf.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/liblddbg/common/elf.c	Thu Jul 26 08:45:42 2007 -0700
@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 #pragma ident	"%Z%%M%	%I%	%E% SMI"
@@ -33,9 +33,12 @@
 void
 Elf_ehdr(Lm_list *lml, Ehdr *ehdr, Shdr *shdr0)
 {
-	Byte		*byte =	&(ehdr->e_ident[0]);
-	const char	*flgs;
-	int		xshdr = 0;
+	Conv_inv_buf_t		inv_buf1, inv_buf2;
+	Conv_ehdr_flags_buf_t	flags_buf;
+	Conv_sec_flags_buf_t	sec_flags_buf;
+	Byte			*byte =	&(ehdr->e_ident[0]);
+	const char		*flgs;
+	int			xshdr = 0;
 
 	dbg_print(lml, MSG_ORIG(MSG_STR_EMPTY));
 	dbg_print(lml, MSG_INTL(MSG_ELF_HEADER));
@@ -45,20 +48,20 @@
 	    (byte[EI_MAG2] ? byte[EI_MAG2] : '0'),
 	    (byte[EI_MAG3] ? byte[EI_MAG3] : '0'));
 	dbg_print(lml, MSG_ORIG(MSG_ELF_CLASS),
-	    conv_ehdr_class(ehdr->e_ident[EI_CLASS], 0),
-	    conv_ehdr_data(ehdr->e_ident[EI_DATA], 0));
+	    conv_ehdr_class(ehdr->e_ident[EI_CLASS], 0, &inv_buf1),
+	    conv_ehdr_data(ehdr->e_ident[EI_DATA], 0, &inv_buf2));
 	dbg_print(lml, MSG_ORIG(MSG_ELF_MACHINE),
-	    conv_ehdr_mach(ehdr->e_machine, 0),
-	    conv_ehdr_vers(ehdr->e_version, 0));
+	    conv_ehdr_mach(ehdr->e_machine, 0, &inv_buf1),
+	    conv_ehdr_vers(ehdr->e_version, 0, &inv_buf2));
 	dbg_print(lml, MSG_ORIG(MSG_ELF_TYPE),
-	    conv_ehdr_type(ehdr->e_type, 0));
+	    conv_ehdr_type(ehdr->e_type, 0, &inv_buf1));
 
 	/*
 	 * Line up the flags differently depending on whether we received a
 	 * numeric (e.g. "0x200") or text representation (e.g.
 	 * "[ EF_SPARC_SUN_US1 ]").
 	 */
-	flgs = conv_ehdr_flags(ehdr->e_machine, ehdr->e_flags);
+	flgs = conv_ehdr_flags(ehdr->e_machine, ehdr->e_flags, &flags_buf);
 	if (flgs[0] == '[')
 		dbg_print(lml, MSG_ORIG(MSG_ELF_FLAGS_FMT), flgs);
 	else
@@ -68,7 +71,7 @@
 	 * The e_shnum, e_shstrndx and e_phnum entries may have a different
 	 * meaning if extended sections exist.
 	 */
-	if ((ehdr->e_shnum == 0) && (ehdr->e_shstrndx == SHN_XINDEX)) {
+	if (ehdr->e_shstrndx == SHN_XINDEX) {
 		dbg_print(lml, MSG_ORIG(MSG_ELFX_ESIZE),
 		    EC_ADDR(ehdr->e_entry), ehdr->e_ehsize);
 		xshdr++;
@@ -76,7 +79,7 @@
 		dbg_print(lml, MSG_ORIG(MSG_ELF_ESIZE), EC_ADDR(ehdr->e_entry),
 		    ehdr->e_ehsize, ehdr->e_shstrndx);
 
-	if ((ehdr->e_shnum == 0) && (shdr0 != NULL) && (shdr0->sh_size != 0)) {
+	if (ehdr->e_shnum == 0) {
 		dbg_print(lml, MSG_ORIG(MSG_ELFX_SHOFF), EC_OFF(ehdr->e_shoff),
 		    ehdr->e_shentsize);
 		xshdr++;
@@ -84,7 +87,7 @@
 		dbg_print(lml, MSG_ORIG(MSG_ELF_SHOFF), EC_OFF(ehdr->e_shoff),
 		    ehdr->e_shentsize, ehdr->e_shnum);
 
-	if (ehdr->e_phoff == PN_XNUM) {
+	if (ehdr->e_phnum == PN_XNUM) {
 		dbg_print(lml, MSG_ORIG(MSG_ELFX_PHOFF), EC_OFF(ehdr->e_phoff),
 		    ehdr->e_phentsize);
 		xshdr++;
@@ -101,9 +104,9 @@
 	dbg_print(lml, MSG_ORIG(MSG_STR_EMPTY));
 	dbg_print(lml, MSG_ORIG(MSG_SHD0_TITLE));
 	dbg_print(lml, MSG_ORIG(MSG_SHD0_ADDR), EC_ADDR(shdr0->sh_addr),
-	    conv_sec_flags(shdr0->sh_flags));
+	    conv_sec_flags(shdr0->sh_flags, &sec_flags_buf));
 	dbg_print(lml, MSG_ORIG(MSG_SHD0_SIZE), EC_XWORD(shdr0->sh_size),
-	    conv_sec_type(ehdr->e_machine, shdr0->sh_type, 0));
+	    conv_sec_type(ehdr->e_machine, shdr0->sh_type, 0, &inv_buf1));
 	dbg_print(lml, MSG_ORIG(MSG_SHD0_OFFSET), EC_OFF(shdr0->sh_offset),
 	    EC_XWORD(shdr0->sh_entsize));
 	dbg_print(lml, MSG_ORIG(MSG_SHD0_LINK), EC_WORD(shdr0->sh_link),
--- a/usr/src/cmd/sgs/liblddbg/common/entry.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/liblddbg/common/entry.c	Thu Jul 26 08:45:42 2007 -0700
@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 #pragma ident	"%Z%%M%	%I%	%E% SMI"
@@ -35,19 +35,22 @@
 void
 Dbg_ent_entry(Lm_list *lml, Half mach, Ent_desc *enp)
 {
-	Listnode	*lnp;
-	char		*cp;
+	Conv_inv_buf_t		inv_buf;
+	Conv_sec_flags_buf_t	sec_flags_buf;
+	Listnode		*lnp;
+	char			*cp;
 
 	dbg_print(lml, MSG_ORIG(MSG_ECR_NAME),
 	    (enp->ec_name ? enp->ec_name : MSG_INTL(MSG_STR_NULL)),
-	    conv_sec_flags(enp->ec_attrmask));
+	    conv_sec_flags(enp->ec_attrmask, &sec_flags_buf));
 
 	dbg_print(lml, MSG_ORIG(MSG_ECR_SEGMENT),
 	    (enp->ec_segment->sg_name ? enp->ec_segment->sg_name :
-	    MSG_INTL(MSG_STR_NULL)), conv_sec_flags(enp->ec_attrbits));
+	    MSG_INTL(MSG_STR_NULL)),
+	    conv_sec_flags(enp->ec_attrbits, &sec_flags_buf));
 
-	dbg_print(lml, MSG_ORIG(MSG_ECR_NDX),
-	    EC_WORD(enp->ec_ndx), conv_sec_type(mach, enp->ec_type, 0));
+	dbg_print(lml, MSG_ORIG(MSG_ECR_NDX), EC_WORD(enp->ec_ndx),
+	    conv_sec_type(mach, enp->ec_type, 0, &inv_buf));
 
 	if (enp->ec_files.head) {
 		dbg_print(lml, MSG_ORIG(MSG_ECR_FILES));
--- a/usr/src/cmd/sgs/liblddbg/common/files.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/liblddbg/common/files.c	Thu Jul 26 08:45:42 2007 -0700
@@ -40,14 +40,15 @@
 void
 Dbg_file_analyze(Rt_map *lmp)
 {
-	Lm_list	*lml = LIST(lmp);
+	Conv_dl_mode_buf_t	dl_mode_buf;
+	Lm_list			*lml = LIST(lmp);
 
 	if (DBG_NOTCLASS(DBG_C_FILES))
 		return;
 
 	Dbg_util_nl(lml, DBG_NL_STD);
 	dbg_print(lml, MSG_INTL(MSG_FIL_ANALYZE), NAME(lmp),
-	    conv_dl_mode(MODE(lmp), 1));
+	    conv_dl_mode(MODE(lmp), 1, &dl_mode_buf));
 }
 
 void
@@ -145,32 +146,43 @@
 
 	/*
 	 * Establish a binding title for later use in Dbg_file_bind_entry.
+	 * These are to be used with the MSG_INTL() macro.
+	 *
+	 * Note: The following are to convince chkmsg.sh that these
+	 * messages are actually used:
+	 *
+	 *	MSG_INTL(MSG_FIL_HDL_CREATE)
+	 *	MSG_INTL(MSG_FIL_HDL_ADD)
+	 *	MSG_INTL(MSG_FIL_HDL_DELETE)
+	 *	MSG_INTL(MSG_FIL_HDL_ORPHAN)
+	 *	MSG_INTL(MSG_FIL_HDL_REINST)
 	 */
 	switch (type) {
 	case DBG_DEP_CREATE:
-	    hdl_str = MSG_FIL_HDL_CREATE;  /* MSG_INTL(MSG_FIL_HDL_CREATE) */
-	    break;
+		hdl_str = MSG_FIL_HDL_CREATE;
+		break;
 	case DBG_DEP_ADD:
-	    hdl_str = MSG_FIL_HDL_ADD;	   /* MSG_INTL(MSG_FIL_HDL_ADD) */
-	    break;
+		hdl_str = MSG_FIL_HDL_ADD;
+		break;
 	case DBG_DEP_DELETE:
-	    hdl_str = MSG_FIL_HDL_DELETE;  /* MSG_INTL(MSG_FIL_HDL_DELETE) */
-	    break;
+		hdl_str = MSG_FIL_HDL_DELETE;
+		break;
 	case DBG_DEP_ORPHAN:
-	    hdl_str = MSG_FIL_HDL_ORPHAN;  /* MSG_INTL(MSG_FIL_HDL_ORPHAN) */
-	    break;
+		hdl_str = MSG_FIL_HDL_ORPHAN;
+		break;
 	case DBG_DEP_REINST:
-	    hdl_str = MSG_FIL_HDL_REINST;  /* MSG_INTL(MSG_FIL_HDL_REINST) */
-	    break;
+		hdl_str = MSG_FIL_HDL_REINST;
+		break;
 	default:
-	    hdl_str = 0;
-	    break;
+		hdl_str = 0;
+		break;
 	}
 }
 
 void
 Dbg_file_hdl_collect(Grp_hdl *ghp, const char *name)
 {
+	Conv_grphdl_flags_buf_t	grphdl_flags_buf;
 	Lm_list		*lml = ghp->gh_ownlml;
 	const char	*str;
 
@@ -192,12 +204,13 @@
 		dbg_print(lml, MSG_INTL(MSG_FIL_HDL_RETAIN), str, name);
 	else
 		dbg_print(lml, MSG_INTL(MSG_FIL_HDL_COLLECT), str,
-		    conv_grphdl_flags(ghp->gh_flags));
+		    conv_grphdl_flags(ghp->gh_flags, &grphdl_flags_buf));
 }
 
 void
 Dbg_file_hdl_action(Grp_hdl *ghp, Rt_map *lmp, int type, uint_t flags)
 {
+	Conv_grpdesc_flags_buf_t grpdesc_flags_buf;
 	const char	*mode, *group;
 	Lm_list		*lml = LIST(lmp);
 	Msg		str;
@@ -226,31 +239,42 @@
 		hdl_title = 0;
 	}
 
+	/*
+	 * Note: The following are to convince chkmsg.sh that these
+	 * messages are actually used:
+	 *
+	 *	MSG_INTL(MSG_FIL_DEP_ADD)
+	 *	MSG_INTL(MSG_FIL_DEP_DELETE)
+	 *	MSG_INTL(MSG_FIL_DEP_REMOVE)
+	 *	MSG_INTL(MSG_FIL_DEP_REMAIN)
+	 *	MSG_INTL(MSG_FIL_DEP_ORPHAN)
+	 *	MSG_INTL(MSG_FIL_DEP_REINST)
+	 */
 	switch (type) {
 	case DBG_DEP_ADD:
-	    str = MSG_FIL_DEP_ADD;	/* MSG_INTL(MSG_FIL_DEP_ADD) */
-	    break;
+		str = MSG_FIL_DEP_ADD;
+		break;
 	case DBG_DEP_DELETE:
-	    str = MSG_FIL_DEP_DELETE;	/* MSG_INTL(MSG_FIL_DEP_DELETE) */
-	    break;
+		str = MSG_FIL_DEP_DELETE;
+		break;
 	case DBG_DEP_REMOVE:
-	    str = MSG_FIL_DEP_REMOVE;	/* MSG_INTL(MSG_FIL_DEP_REMOVE) */
-	    break;
+		str = MSG_FIL_DEP_REMOVE;
+		break;
 	case DBG_DEP_REMAIN:
-	    str = MSG_FIL_DEP_REMAIN;	/* MSG_INTL(MSG_FIL_DEP_REMAIN) */
-	    break;
+		str = MSG_FIL_DEP_REMAIN;
+		break;
 	case DBG_DEP_ORPHAN:
-	    str = MSG_FIL_DEP_ORPHAN;	/* MSG_INTL(MSG_FIL_DEP_ORPHAN) */
-	    break;
+		str = MSG_FIL_DEP_ORPHAN;
+		break;
 	case DBG_DEP_REINST:
-	    str = MSG_FIL_DEP_REINST;	/* MSG_INTL(MSG_FIL_DEP_REINST) */
-	    break;
+		str = MSG_FIL_DEP_REINST;
+		break;
 	default:
-	    return;
+		return;
 	}
 
 	if ((type == DBG_DEP_ADD) && flags)
-		group = conv_grpdesc_flags(flags);
+		group = conv_grpdesc_flags(flags, &grpdesc_flags_buf);
 	else
 		group = MSG_ORIG(MSG_STR_EMPTY);
 
@@ -271,6 +295,8 @@
 void
 Dbg_file_bind_entry(Lm_list *lml, Bnd_desc *bdp)
 {
+	Conv_bnd_type_buf_t bnd_type_buf;
+
 	if (DBG_NOTCLASS(DBG_C_FILES))
 		return;
 	if (DBG_NOTDETAIL())
@@ -282,12 +308,14 @@
 	Dbg_util_nl(lml, DBG_NL_STD);
 	dbg_print(lml, MSG_INTL(MSG_FIL_BND_ADD), NAME(bdp->b_caller));
 	dbg_print(lml, MSG_INTL(MSG_FIL_BND_FILE), NAME(bdp->b_depend),
-	    conv_bnd_type(bdp->b_flags));
+	    conv_bnd_type(bdp->b_flags, &bnd_type_buf));
 }
 
 void
 Dbg_file_bindings(Rt_map *lmp, int flag)
 {
+	Conv_bnd_obj_buf_t	bnd_obj_buf;
+	Conv_bnd_type_buf_t	bnd_type_buf;
 	const char	*str;
 	Rt_map		*tlmp;
 	Lm_list		*lml = LIST(lmp);
@@ -305,7 +333,7 @@
 
 	Dbg_util_nl(lml, DBG_NL_STD);
 	dbg_print(lml, MSG_INTL(MSG_FIL_DEP_TITLE), str,
-	    conv_bnd_obj(lml->lm_flags));
+	    conv_bnd_obj(lml->lm_flags, &bnd_obj_buf));
 
 	/* LINTED */
 	for (tlmp = lmp; tlmp; tlmp = (Rt_map *)NEXT(tlmp)) {
@@ -345,7 +373,8 @@
 			for (ALIST_TRAVERSE(DEPENDS(tlmp), off, bdpp)) {
 				dbg_print(lml, MSG_INTL(MSG_FIL_BND_FILE),
 				    NAME((*bdpp)->b_depend),
-				    conv_bnd_type((*bdpp)->b_flags));
+				    conv_bnd_type((*bdpp)->b_flags,
+				    &bnd_type_buf));
 			}
 		}
 	}
@@ -355,14 +384,15 @@
 void
 Dbg_file_dlopen(Rt_map *clmp, const char *name, int mode)
 {
-	Lm_list	*lml = LIST(clmp);
+	Conv_dl_mode_buf_t	dl_mode_buf;
+	Lm_list			*lml = LIST(clmp);
 
 	if (DBG_NOTCLASS(DBG_C_FILES))
 		return;
 
 	Dbg_util_nl(lml, DBG_NL_STD);
 	dbg_print(lml, MSG_INTL(MSG_FIL_DLOPEN), name, NAME(clmp),
-	    conv_dl_mode(mode, 1));
+	    conv_dl_mode(mode, 1, &dl_mode_buf));
 }
 
 void
@@ -385,14 +415,15 @@
 void
 Dbg_file_dldump(Rt_map *lmp, const char *path, int flags)
 {
-	Lm_list	*lml = LIST(lmp);
+	Conv_dl_flag_buf_t	dl_flag_buf;
+	Lm_list			*lml = LIST(lmp);
 
 	if (DBG_NOTCLASS(DBG_C_FILES))
 		return;
 
 	Dbg_util_nl(lml, DBG_NL_STD);
 	dbg_print(lml, MSG_INTL(MSG_FIL_DLDUMP), NAME(lmp), path,
-		conv_dl_flag(flags, 0));
+	    conv_dl_flag(flags, 0, &dl_flag_buf));
 }
 
 void
@@ -518,7 +549,8 @@
 void
 Dbg_file_config_dis(Lm_list *lml, const char *config, int features)
 {
-	const char	*str;
+	Conv_config_feat_buf_t	config_feat_buf;
+	const char		*str;
 
 	switch (features & ~CONF_FEATMSK) {
 	case DBG_CONF_IGNORE:
@@ -537,7 +569,7 @@
 		str = MSG_INTL(MSG_FIL_CONFIG_ERR_5);
 		break;
 	default:
-		str = conv_config_feat(features);
+		str = conv_config_feat(features, &config_feat_buf);
 		break;
 	}
 
@@ -578,14 +610,15 @@
 void
 Dbg_file_mode_promote(Rt_map *lmp, int mode)
 {
-	Lm_list	*lml = LIST(lmp);
+	Conv_dl_mode_buf_t	dl_mode_buf;
+	Lm_list			*lml = LIST(lmp);
 
 	if (DBG_NOTCLASS(DBG_C_FILES))
 		return;
 
 	Dbg_util_nl(lml, DBG_NL_STD);
 	dbg_print(lml, MSG_INTL(MSG_FIL_PROMOTE), NAME(lmp),
-	    conv_dl_mode(mode, 0));
+	    conv_dl_mode(mode, 0, &dl_mode_buf));
 	Dbg_util_nl(lml, DBG_NL_STD);
 }
 
@@ -646,12 +679,14 @@
 void
 Dbg_file_generic(Lm_list *lml, Ifl_desc *ifl)
 {
+	Conv_inv_buf_t inv_buf;
+
 	if (DBG_NOTCLASS(DBG_C_FILES))
 		return;
 
 	Dbg_util_nl(lml, DBG_NL_STD);
 	dbg_print(lml, MSG_INTL(MSG_FIL_BASIC), ifl->ifl_name,
-		conv_ehdr_type(ifl->ifl_ehdr->e_type, 0));
+	    conv_ehdr_type(ifl->ifl_ehdr->e_type, 0, &inv_buf));
 }
 
 static const Msg
@@ -674,12 +709,15 @@
 void
 Dbg_file_rejected(Lm_list *lml, Rej_desc *rej)
 {
+	Conv_reject_desc_buf_t rej_buf;
+
 	if (DBG_NOTCLASS(DBG_C_FILES))
 		return;
 
 	Dbg_util_nl(lml, DBG_NL_STD);
 	dbg_print(lml, MSG_INTL(reject[rej->rej_type]), rej->rej_name ?
-	    rej->rej_name : MSG_INTL(MSG_STR_UNKNOWN), conv_reject_desc(rej));
+	    rej->rej_name : MSG_INTL(MSG_STR_UNKNOWN),
+	    conv_reject_desc(rej, &rej_buf));
 	Dbg_util_nl(lml, DBG_NL_STD);
 }
 
--- a/usr/src/cmd/sgs/liblddbg/common/got.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/liblddbg/common/got.c	Thu Jul 26 08:45:42 2007 -0700
@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 #pragma ident	"%Z%%M%	%I%	%E% SMI"
@@ -130,6 +130,7 @@
 	Rela		*rela;
 	Rel		*rel;
 	const char	*str;
+	Conv_inv_buf_t	inv_buf;
 	char		index[INDEX_STR_SIZE];
 
 	(void) snprintf(index, INDEX_STR_SIZE, MSG_ORIG(MSG_GOT_INDEX),
@@ -139,11 +140,11 @@
 		if (type == SHT_RELA) {
 			rela = (Rela *)reloc;
 			str = conv_reloc_type(mach, ELF_R_TYPE(rela->r_info),
-				0);
+			    0, &inv_buf);
 		} else {
 			rel = (Rel *)reloc;
 			str = conv_reloc_type(mach, ELF_R_TYPE(rel->r_info),
-				0);
+			    0, &inv_buf);
 		}
 
 		if (name)
--- a/usr/src/cmd/sgs/liblddbg/common/map.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/liblddbg/common/map.c	Thu Jul 26 08:45:42 2007 -0700
@@ -91,7 +91,8 @@
 void
 Dbg_map_size_old(Ofl_desc *ofl, Sym_desc *sdp)
 {
-	Lm_list	*lml = ofl->ofl_lml;
+	Conv_inv_buf_t	inv_buf;
+	Lm_list		*lml = ofl->ofl_lml;
 
 	if (DBG_NOTCLASS(DBG_C_MAP))
 		return;
@@ -105,13 +106,14 @@
 	Elf_syms_table_entry(lml, ELF_DBG_LD, MSG_INTL(MSG_STR_UP_2),
 	    ofl->ofl_dehdr->e_machine, sdp->sd_sym,
 	    sdp->sd_aux ? sdp->sd_aux->sa_overndx : 0, 0, NULL,
-	    conv_def_tag(sdp->sd_ref));
+	    conv_def_tag(sdp->sd_ref, &inv_buf));
 }
 
 void
 Dbg_map_symbol(Ofl_desc *ofl, Sym_desc *sdp)
 {
-	Lm_list	*lml = ofl->ofl_lml;
+	Conv_inv_buf_t	inv_buf;
+	Lm_list		*lml = ofl->ofl_lml;
 
 	if (DBG_NOTCLASS(DBG_C_MAP))
 		return;
@@ -126,7 +128,7 @@
 		Elf_syms_table_entry(lml, ELF_DBG_LD, MSG_INTL(MSG_STR_ENTERED),
 		    ofl->ofl_dehdr->e_machine, sdp->sd_sym,
 		    sdp->sd_aux ? sdp->sd_aux->sa_overndx : 0, 0, NULL,
-		    conv_def_tag(sdp->sd_ref));
+		    conv_def_tag(sdp->sd_ref, &inv_buf));
 }
 
 void
--- a/usr/src/cmd/sgs/liblddbg/common/phdr.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/liblddbg/common/phdr.c	Thu Jul 26 08:45:42 2007 -0700
@@ -33,10 +33,13 @@
 void
 Elf_phdr(Lm_list *lml, Half mach, Phdr *phdr)
 {
+	Conv_inv_buf_t		inv_buf;
+	Conv_phdr_flags_buf_t	phdr_flags_buf;
+
 	dbg_print(lml, MSG_ORIG(MSG_PHD_VADDR), EC_ADDR(phdr->p_vaddr),
-	    conv_phdr_flags(phdr->p_flags));
+	    conv_phdr_flags(phdr->p_flags, &phdr_flags_buf));
 	dbg_print(lml, MSG_ORIG(MSG_PHD_PADDR), EC_ADDR(phdr->p_paddr),
-	    conv_phdr_type(mach, phdr->p_type, 0));
+	    conv_phdr_type(mach, phdr->p_type, 0, &inv_buf));
 	dbg_print(lml, MSG_ORIG(MSG_PHD_FILESZ), EC_XWORD(phdr->p_filesz),
 	    EC_XWORD(phdr->p_memsz));
 	dbg_print(lml, MSG_ORIG(MSG_PHD_OFFSET), EC_OFF(phdr->p_offset),
--- a/usr/src/cmd/sgs/liblddbg/common/relocate.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/liblddbg/common/relocate.c	Thu Jul 26 08:45:42 2007 -0700
@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 #pragma ident	"%Z%%M%	%I%	%E% SMI"
@@ -199,6 +199,7 @@
 Dbg_reloc_doact(Lm_list *lml, int caller, Half mach, Word type, Word rtype,
     Xword off, Xword value, const char *symname, Os_desc *osp)
 {
+	Conv_inv_buf_t	inv_buf;
 	const char	*secname;
 
 	if (DBG_NOTCLASS(DBG_C_RELOC))
@@ -213,8 +214,8 @@
 		secname = MSG_ORIG(MSG_STR_EMPTY);
 
 	Elf_reloc_entry_2(lml, caller, MSG_ORIG(MSG_STR_EMPTY), type,
-	    conv_reloc_type(mach, rtype, 0), off, value, secname, symname,
-	    MSG_ORIG(MSG_STR_EMPTY));
+	    conv_reloc_type(mach, rtype, 0, &inv_buf),
+	    off, value, secname, symname, MSG_ORIG(MSG_STR_EMPTY));
 }
 
 void
@@ -233,7 +234,8 @@
 void
 Dbg_reloc_discard(Lm_list *lml, Half mach, Rel_desc *rsp)
 {
-	Is_desc	*isp;
+	Conv_inv_buf_t	inv_buf;
+	Is_desc		*isp;
 
 	if (DBG_NOTCLASS(DBG_C_RELOC))
 		return;
@@ -242,23 +244,26 @@
 
 	isp = rsp->rel_isdesc;
 	dbg_print(lml, MSG_INTL(MSG_REL_DISCARDED), isp->is_basename,
-	    isp->is_file->ifl_name, conv_reloc_type(mach, rsp->rel_rtype, 0),
+	    isp->is_file->ifl_name,
+	    conv_reloc_type(mach, rsp->rel_rtype, 0, &inv_buf),
 	    EC_OFF(rsp->rel_roffset));
 }
 
 void
 Dbg_reloc_transition(Lm_list *lml, Half mach, Word rtype, Rel_desc *rsp)
 {
-	Is_desc	*isp;
+	Conv_inv_buf_t	inv_buf1, inv_buf2;
+	Is_desc		*isp;
 
 	if (DBG_NOTCLASS(DBG_C_RELOC))
 		return;
 
 	isp = rsp->rel_isdesc;
 	dbg_print(lml, MSG_INTL(MSG_REL_TRANSITION),
-	    conv_reloc_type(mach, rsp->rel_rtype, 0), isp->is_basename,
-	    isp->is_file->ifl_name, EC_OFF(rsp->rel_roffset), rsp->rel_sname,
-	    conv_reloc_type(mach, rtype, 0));
+	    conv_reloc_type(mach, rsp->rel_rtype, 0, &inv_buf1),
+	    isp->is_basename, isp->is_file->ifl_name,
+	    EC_OFF(rsp->rel_roffset), rsp->rel_sname,
+	    conv_reloc_type(mach, rtype, 0, &inv_buf2));
 }
 
 void
@@ -306,7 +311,7 @@
 		return;
 
 	nfname = (sdp && sdp->sd_file && sdp->sd_file->ifl_name)
-		? sdp->sd_file->ifl_name : MSG_INTL(MSG_STR_NULL);
+	    ? sdp->sd_file->ifl_name : MSG_INTL(MSG_STR_NULL);
 
 	dbg_print(lml, MSG_INTL(MSG_REL_SLOPPYCOMDAT), secname, nfname);
 }
@@ -318,6 +323,7 @@
 Dbg_reloc_ors_entry(Lm_list *lml, int caller, Word type, Half mach,
     Rel_desc *orsp)
 {
+	Conv_inv_buf_t	inv_buf;
 	const char	*secname, *symname;
 
 	if (DBG_NOTCLASS(DBG_C_RELOC))
@@ -346,8 +352,9 @@
 		symname = MSG_ORIG(MSG_STR_EMPTY);
 
 	Elf_reloc_entry_2(lml, caller, MSG_INTL(MSG_STR_OUT), type,
-	    conv_reloc_type(mach, orsp->rel_rtype, 0), orsp->rel_roffset,
-	    orsp->rel_raddend, secname, symname, MSG_ORIG(MSG_STR_EMPTY));
+	    conv_reloc_type(mach, orsp->rel_rtype, 0, &inv_buf),
+	    orsp->rel_roffset, orsp->rel_raddend, secname, symname,
+	    MSG_ORIG(MSG_STR_EMPTY));
 }
 
 /*
@@ -357,6 +364,7 @@
 Dbg_reloc_ars_entry(Lm_list *lml, int caller, Word type, Half mach,
     Rel_desc *arsp)
 {
+	Conv_inv_buf_t	inv_buf;
 	const char	*secname;
 
 	if (DBG_NOTCLASS(DBG_C_RELOC))
@@ -370,9 +378,9 @@
 		secname = arsp->rel_osdesc->os_name;
 
 	Elf_reloc_entry_2(lml, caller, MSG_INTL(MSG_STR_ACT), type,
-	    conv_reloc_type(mach, arsp->rel_rtype, 0), arsp->rel_roffset,
-	    arsp->rel_raddend, secname, arsp->rel_sym->sd_name,
-	    MSG_ORIG(MSG_STR_EMPTY));
+	    conv_reloc_type(mach, arsp->rel_rtype, 0, &inv_buf),
+	    arsp->rel_roffset, arsp->rel_raddend, secname,
+	    arsp->rel_sym->sd_name, MSG_ORIG(MSG_STR_EMPTY));
 }
 
 void
@@ -578,6 +586,7 @@
     Word type, void *reloc, const char *secname, const char *symname,
     const char *poststr)
 {
+	Conv_inv_buf_t	inv_buf;
 	Addr		off;
 	Sxword		add;
 	const char	*str;
@@ -585,13 +594,15 @@
 	if (type == SHT_RELA) {
 		Rela	*rela = (Rela *)reloc;
 
-		str = conv_reloc_type(mach, ELF_R_TYPE(rela->r_info), 0);
+		str = conv_reloc_type(mach, ELF_R_TYPE(rela->r_info),
+		    0, &inv_buf);
 		off = rela->r_offset;
 		add = rela->r_addend;
 	} else {
 		Rel	*rel = (Rel *)reloc;
 
-		str = conv_reloc_type(mach, ELF_R_TYPE(rel->r_info), 0);
+		str = conv_reloc_type(mach, ELF_R_TYPE(rel->r_info),
+		    0, &inv_buf);
 		off = rel->r_offset;
 		add = 0;
 	}
@@ -615,8 +626,10 @@
 Elf_reloc_apply_reg(Lm_list *lml, int caller, Half mach, Xword offset,
     Xword value)
 {
+	Conv_inv_buf_t inv_buf;
+
 	if (caller == ELF_DBG_RTLD)
 		dbg_print(lml, MSG_INTL(MSG_REL_RT_APLREG),
-		    conv_sym_value(mach, STT_SPARC_REGISTER, offset),
-		    EC_XWORD(value));
+		    conv_sym_value(mach, STT_SPARC_REGISTER,
+		    offset, &inv_buf), EC_XWORD(value));
 }
--- a/usr/src/cmd/sgs/liblddbg/common/segments.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/liblddbg/common/segments.c	Thu Jul 26 08:45:42 2007 -0700
@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 #pragma ident	"%Z%%M%	%I%	%E% SMI"
@@ -36,7 +36,8 @@
 void
 Dbg_seg_desc_entry(Lm_list *lml, Half mach, int ndx, Sg_desc *sgp)
 {
-	const char	*str;
+	Conv_seg_flags_buf_t	seg_flags_buf;
+	const char		*str;
 
 	if (sgp->sg_name && *sgp->sg_name)
 		str = sgp->sg_name;
@@ -50,7 +51,7 @@
 
 	dbg_print(lml, MSG_ORIG(MSG_SEG_LENGTH), EC_ADDR(sgp->sg_length));
 	dbg_print(lml, MSG_ORIG(MSG_SEG_FLAGS),
-	    conv_seg_flags(sgp->sg_flags));
+	    conv_seg_flags(sgp->sg_flags, &seg_flags_buf));
 
 	if (sgp->sg_sizesym && sgp->sg_sizesym->sd_name)
 		dbg_print(lml, MSG_ORIG(MSG_SEG_SIZESYM),
@@ -118,6 +119,7 @@
 void
 Dbg_seg_os(Ofl_desc *ofl, Os_desc *osp, int ndx)
 {
+	Conv_inv_buf_t	inv_buf;
 	Lm_list		*lml = ofl->ofl_lml;
 	Listnode	*lnp;
 	Is_desc		*isp;
@@ -134,7 +136,7 @@
 	shdr = osp->os_shdr;
 	data = osp->os_outdata;
 	dbg_print(lml, MSG_INTL(MSG_EDATA_ENTRY), MSG_INTL(MSG_STR_OUT),
-	    EC_ADDR(shdr->sh_addr), conv_elfdata_type(data->d_type),
+	    EC_ADDR(shdr->sh_addr), conv_elfdata_type(data->d_type, &inv_buf),
 	    EC_XWORD(data->d_size), EC_OFF(data->d_off),
 	    EC_XWORD(data->d_align), MSG_ORIG(MSG_STR_EMPTY),
 	    MSG_ORIG(MSG_STR_EMPTY));
@@ -162,7 +164,7 @@
 			file = MSG_ORIG(MSG_STR_EMPTY);
 
 		dbg_print(lml, MSG_INTL(MSG_EDATA_ENTRY), MSG_INTL(MSG_STR_IN),
-		    EC_ADDR(addr), conv_elfdata_type(data->d_type),
+		    EC_ADDR(addr), conv_elfdata_type(data->d_type, &inv_buf),
 		    EC_XWORD(data->d_size), EC_OFF(data->d_off),
 		    EC_XWORD(data->d_align), file, str);
 	}
--- a/usr/src/cmd/sgs/liblddbg/common/shdr.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/liblddbg/common/shdr.c	Thu Jul 26 08:45:42 2007 -0700
@@ -33,12 +33,13 @@
 void
 Elf_shdr(Lm_list *lml, Half mach, Shdr *shdr)
 {
-	Conv_inv_buf_t	link, info;
+	Conv_inv_buf_t		inv_buf1, inv_buf2;
+	Conv_sec_flags_buf_t	sec_flags_buf;
 
 	dbg_print(lml, MSG_ORIG(MSG_SHD_ADDR), EC_ADDR(shdr->sh_addr),
-	    conv_sec_flags(shdr->sh_flags));
+	    conv_sec_flags(shdr->sh_flags, &sec_flags_buf));
 	dbg_print(lml, MSG_ORIG(MSG_SHD_SIZE), EC_XWORD(shdr->sh_size),
-	    conv_sec_type(mach, shdr->sh_type, 0));
+	    conv_sec_type(mach, shdr->sh_type, 0, &inv_buf1));
 	if (shdr->sh_entsize == 0) {
 		dbg_print(lml, MSG_ORIG(MSG_SHD_OFFSET),
 		    EC_OFF(shdr->sh_offset), EC_XWORD(shdr->sh_entsize));
@@ -52,8 +53,8 @@
 		    EC_XWORD(nelts), entstr);
 	}
 	dbg_print(lml, MSG_ORIG(MSG_SHD_LINK),
-	    conv_sec_linkinfo(shdr->sh_link, shdr->sh_flags, link),
-	    conv_sec_linkinfo(shdr->sh_info, shdr->sh_flags, info));
+	    conv_sec_linkinfo(shdr->sh_link, shdr->sh_flags, &inv_buf1),
+	    conv_sec_linkinfo(shdr->sh_info, shdr->sh_flags, &inv_buf2));
 	dbg_print(lml, MSG_ORIG(MSG_SHD_ALIGN), EC_XWORD(shdr->sh_addralign));
 }
 
--- a/usr/src/cmd/sgs/liblddbg/common/syms.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/liblddbg/common/syms.c	Thu Jul 26 08:45:42 2007 -0700
@@ -188,7 +188,8 @@
 void
 Dbg_syms_entered(Ofl_desc *ofl, Sym *sym, Sym_desc *sdp)
 {
-	Lm_list	*lml = ofl->ofl_lml;
+	Conv_inv_buf_t	inv_buf;
+	Lm_list		*lml = ofl->ofl_lml;
 
 	if (DBG_NOTCLASS(DBG_C_SYMBOLS))
 		return;
@@ -198,18 +199,20 @@
 	Elf_syms_table_entry(lml, ELF_DBG_LD, MSG_INTL(MSG_STR_ENTERED),
 	    ofl->ofl_dehdr->e_machine, sym,
 	    sdp->sd_aux ? sdp->sd_aux->sa_overndx : 0, 0, NULL,
-	    conv_def_tag(sdp->sd_ref));
+	    conv_def_tag(sdp->sd_ref, &inv_buf));
 }
 
 void
 Dbg_syms_process(Lm_list *lml, Ifl_desc *ifl)
 {
+	Conv_inv_buf_t	inv_buf;
+
 	if (DBG_NOTCLASS(DBG_C_SYMBOLS))
 		return;
 
 	Dbg_util_nl(lml, DBG_NL_STD);
 	dbg_print(lml, MSG_INTL(MSG_SYM_PROCESS), ifl->ifl_name,
-	    conv_ehdr_type(ifl->ifl_ehdr->e_type, 0));
+	    conv_ehdr_type(ifl->ifl_ehdr->e_type, 0, &inv_buf));
 }
 
 void
@@ -298,6 +301,8 @@
 void
 Dbg_syms_new(Ofl_desc *ofl, Sym *sym, Sym_desc *sdp)
 {
+	Conv_inv_buf_t	inv_buf;
+
 	if (DBG_NOTCLASS(DBG_C_SYMBOLS))
 		return;
 	if (DBG_NOTDETAIL())
@@ -306,13 +311,14 @@
 	Elf_syms_table_entry(ofl->ofl_lml, ELF_DBG_LD, MSG_INTL(MSG_STR_NEW),
 	    ofl->ofl_dehdr->e_machine, sym,
 	    sdp->sd_aux ? sdp->sd_aux->sa_overndx : 0, 0, NULL,
-	    conv_def_tag(sdp->sd_ref));
+	    conv_def_tag(sdp->sd_ref, &inv_buf));
 }
 
 void
 Dbg_syms_updated(Ofl_desc *ofl, Sym_desc *sdp, const char *name)
 {
-	Lm_list	*lml = ofl->ofl_lml;
+	Conv_inv_buf_t	inv_buf;
+	Lm_list		*lml = ofl->ofl_lml;
 
 	if (DBG_NOTCLASS(DBG_C_SYMBOLS))
 		return;
@@ -325,7 +331,7 @@
 	Elf_syms_table_entry(ofl->ofl_lml, ELF_DBG_LD, MSG_ORIG(MSG_STR_EMPTY),
 	    ofl->ofl_dehdr->e_machine, sdp->sd_sym,
 	    sdp->sd_aux ? sdp->sd_aux->sa_overndx : 0, 0, NULL,
-	    conv_def_tag(sdp->sd_ref));
+	    conv_def_tag(sdp->sd_ref, &inv_buf));
 }
 
 void
@@ -364,6 +370,8 @@
 void
 Dbg_syms_resolved(Ofl_desc *ofl, Sym_desc *sdp)
 {
+	Conv_inv_buf_t	inv_buf;
+
 	if (DBG_NOTCLASS(DBG_C_SYMBOLS))
 		return;
 	if (DBG_NOTDETAIL())
@@ -372,13 +380,14 @@
 	Elf_syms_table_entry(ofl->ofl_lml, ELF_DBG_LD,
 	    MSG_INTL(MSG_STR_RESOLVED), ofl->ofl_dehdr->e_machine, sdp->sd_sym,
 	    sdp->sd_aux ? sdp->sd_aux->sa_overndx : 0, 0, NULL,
-	    conv_def_tag(sdp->sd_ref));
+	    conv_def_tag(sdp->sd_ref, &inv_buf));
 }
 
 void
 Dbg_syms_reloc(Ofl_desc *ofl, Sym_desc *sdp)
 {
 	static Boolean	symbol_title = TRUE;
+	Conv_inv_buf_t	inv_buf;
 	Lm_list	*lml = ofl->ofl_lml;
 
 	if (DBG_NOTCLASS(DBG_C_SYMBOLS))
@@ -399,7 +408,7 @@
 	Elf_syms_table_entry(lml, ELF_DBG_LD, MSG_ORIG(MSG_SYM_COPY),
 	    ofl->ofl_dehdr->e_machine, sdp->sd_sym,
 	    sdp->sd_aux ? sdp->sd_aux->sa_overndx : 0, 0, NULL,
-	    conv_def_tag(sdp->sd_ref));
+	    conv_def_tag(sdp->sd_ref, &inv_buf));
 }
 
 void
@@ -520,6 +529,8 @@
 Elf_syms_table_entry(Lm_list *lml, int caller, const char *prestr, Half mach,
     Sym *sym, Versym verndx, int gnuver, const char *sec, const char *poststr)
 {
+	Conv_inv_buf_t	inv_buf1, inv_buf2, inv_buf3;
+	Conv_inv_buf_t	inv_buf4, inv_buf5, inv_buf6;
 	uchar_t		type = ELF_ST_TYPE(sym->st_info);
 	uchar_t		bind = ELF_ST_BIND(sym->st_info);
 	const char	*msg;
@@ -532,11 +543,12 @@
 			msg = MSG_INTL(MSG_SYM_EFL_ENTRY);
 
 		dbg_print(lml, msg, prestr,
-		    conv_sym_value(mach, type, sym->st_value), sym->st_size,
-		    conv_sym_info_type(mach, type, 0),
-		    conv_sym_info_bind(bind, 0), conv_sym_other(sym->st_other),
-		    conv_ver_index(verndx, gnuver),
-		    sec ? sec : conv_sym_shndx(sym->st_shndx),
+		    conv_sym_value(mach, type, sym->st_value, &inv_buf1),
+		    sym->st_size, conv_sym_info_type(mach, type, 0, &inv_buf2),
+		    conv_sym_info_bind(bind, 0, &inv_buf3),
+		    conv_sym_other(sym->st_other, &inv_buf4),
+		    conv_ver_index(verndx, gnuver, &inv_buf5),
+		    sec ? sec : conv_sym_shndx(sym->st_shndx, &inv_buf6),
 		    Elf_demangle_name(poststr));
 	}
 }
--- a/usr/src/cmd/sgs/liblddbg/common/tls.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/liblddbg/common/tls.c	Thu Jul 26 08:45:42 2007 -0700
@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -36,7 +36,7 @@
 
 #define	FLAGSZ	CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
 		MSG_TLS_FLAG_STATIC_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
-		CONV_INV_STRSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
+		CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
 
 static void
 Dbg_tls_modent(Lm_list *lml, TLS_modinfo * tmodent)
--- a/usr/src/cmd/sgs/liblddbg/common/util.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/liblddbg/common/util.c	Thu Jul 26 08:45:42 2007 -0700
@@ -254,7 +254,8 @@
 Dbg_util_edge_in(Lm_list *lml, Rt_map *clmp, uint_t flags, Rt_map *dlmp,
     int ndx, int flag)
 {
-	const char	*str;
+	Conv_bnd_type_buf_t	bnd_type_buf;
+	const char		*str;
 
 	if (DBG_NOTCLASS(DBG_C_INIT))
 		return;
@@ -277,7 +278,7 @@
 		dbg_print(lml, MSG_INTL(MSG_UTL_EDGE_START), ndx, NAME(dlmp));
 	} else
 		dbg_print(lml, MSG_INTL(MSG_UTL_EDGE_IN), ndx, NAME(dlmp),
-		    NAME(clmp), conv_bnd_type(flags));
+		    NAME(clmp), conv_bnd_type(flags, &bnd_type_buf));
 
 	ectoggle = 1;
 }
@@ -334,8 +335,8 @@
 void
 Dbg_util_lcinterface(Rt_map *lmp, int tag, char *val)
 {
-	const char		*str;
-	static Conv_inv_buf_t	string;
+	const char	*str;
+	Conv_inv_buf_t	inv_buf;
 
 	if (DBG_NOTDETAIL())
 		return;
@@ -343,7 +344,7 @@
 	if (tag < CI_MAX)
 		str = MSG_ORIG(tags[tag]);
 	else
-		str = conv_invalid_val(string, CONV_INV_STRSIZE, tag, 0);
+		str = conv_invalid_val(&inv_buf, tag, 0);
 
 	dbg_print(LIST(lmp), MSG_INTL(MSG_UTL_LCINTERFACE), NAME(lmp), str,
 	    EC_NATPTR(val));
@@ -352,8 +353,8 @@
 void
 Dbg_unused_lcinterface(Rt_map *nlmp, Rt_map *olmp, int tag)
 {
-	const char		*str;
-	static Conv_inv_buf_t	string;
+	const char	*str;
+	Conv_inv_buf_t	inv_buf;
 
 	if (DBG_NOTCLASS(DBG_C_UNUSED))
 		return;
@@ -361,7 +362,7 @@
 	if (tag < CI_MAX)
 		str = MSG_ORIG(tags[tag]);
 	else
-		str = conv_invalid_val(string, CONV_INV_STRSIZE, tag, 0);
+		str = conv_invalid_val(&inv_buf, tag, 0);
 
 	dbg_print(LIST(nlmp), MSG_INTL(MSG_USD_LCINTERFACE), NAME(nlmp), str,
 	    NAME(olmp));
--- a/usr/src/cmd/sgs/packages/common/SUNWonld-README	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/packages/common/SUNWonld-README	Thu Jul 26 08:45:42 2007 -0700
@@ -1251,3 +1251,4 @@
 	PSARC/2007/413 Add -zglobalaudit option to ld
 6573641 ld.so.1 does not maintain parent relationship to a dlopen() caller.
 6577462 Additional improvements needed to handling of gcc's symbol versioning
+6583742 ELF string conversion library needs to lose static writable buffers
--- a/usr/src/cmd/sgs/rtld/amd64/amd64_elf.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/rtld/amd64/amd64_elf.c	Thu Jul 26 08:45:42 2007 -0700
@@ -245,8 +245,10 @@
 	 */
 	if ((!lmp) && (pltndx <=
 	    (ulong_t)PLTRELSZ(lmp) / (ulong_t)RELENT(lmp))) {
+		Conv_inv_buf_t inv_buf;
+
 		eprintf(lml, ERR_FATAL, MSG_INTL(MSG_REL_PLTREF),
-		    conv_reloc_amd64_type(R_AMD64_JUMP_SLOT, 0),
+		    conv_reloc_amd64_type(R_AMD64_JUMP_SLOT, 0, &inv_buf),
 		    EC_NATPTR(lmp), EC_XWORD(pltndx), EC_NATPTR(from));
 		rtldexit(lml, 1);
 	}
@@ -1077,5 +1079,7 @@
 const char *
 _conv_reloc_type(uint_t rel)
 {
-	return (conv_reloc_amd64_type(rel, 0));
+	static Conv_inv_buf_t inv_buf;
+
+	return (conv_reloc_amd64_type(rel, 0, &inv_buf));
 }
--- a/usr/src/cmd/sgs/rtld/common/analyze.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/rtld/common/analyze.c	Thu Jul 26 08:45:42 2007 -0700
@@ -892,9 +892,12 @@
 	 * found and the reason for its rejection.
 	 */
 	if (rej) {
+		Conv_reject_desc_buf_t rej_buf;
+
 		/* LINTED */
 		(void) snprintf(_reject, PATH_MAX,
-		    MSG_INTL(ldd_reject[rej->rej_type]), conv_reject_desc(rej));
+		    MSG_INTL(ldd_reject[rej->rej_type]),
+		    conv_reject_desc(rej, &rej_buf));
 		if (rej->rej_name)
 			path = rej->rej_name;
 		reject = (char *)_reject;
@@ -1156,9 +1159,11 @@
 	}
 
 	if (rej->rej_type) {
+		Conv_reject_desc_buf_t rej_buf;
+
 		eprintf(lml, ERR_FATAL, MSG_INTL(err_reject[rej->rej_type]),
 		    rej->rej_name ? rej->rej_name : MSG_INTL(MSG_STR_UNKNOWN),
-		    conv_reject_desc(rej));
+		    conv_reject_desc(rej, &rej_buf));
 		return;
 	}
 
--- a/usr/src/cmd/sgs/rtld/common/cap.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/rtld/common/cap.c	Thu Jul 26 08:45:42 2007 -0700
@@ -93,8 +93,10 @@
 			break;
 
 		if ((val = (cptr->c_un.c_val & ~hwcap)) != 0) {
+			static Conv_cap_val_hw1_buf_t cap_buf;
+
 			rej->rej_type = SGS_REJ_HWCAP_1;
-			rej->rej_str = conv_cap_val_hw1(val, M_MACH);
+			rej->rej_str = conv_cap_val_hw1(val, M_MACH, &cap_buf);
 			return (0);
 		}
 
--- a/usr/src/cmd/sgs/rtld/common/elf.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/rtld/common/elf.c	Thu Jul 26 08:45:42 2007 -0700
@@ -2620,13 +2620,15 @@
 	 * If this isn't a dynamic executable or shared object we can't process
 	 * it.  If this is a dynamic executable then all addresses are fixed.
 	 */
-	if (etype == ET_EXEC)
+	if (etype == ET_EXEC) {
 		fixed = 1;
-	else if (etype == ET_DYN)
+	} else if (etype == ET_DYN) {
 		fixed = 0;
-	else {
+	} else {
+		Conv_inv_buf_t inv_buf;
+
 		eprintf(lml, ERR_ELF, MSG_INTL(MSG_GEN_BADTYPE), pname,
-		    conv_ehdr_type(etype, 0));
+		    conv_ehdr_type(etype, 0, &inv_buf));
 		return (0);
 	}
 
--- a/usr/src/cmd/sgs/rtld/common/setup.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/rtld/common/setup.c	Thu Jul 26 08:45:42 2007 -0700
@@ -414,9 +414,11 @@
 		 */
 		(void) fstat(fd, &status);
 		if ((ftp = are_u_this(&rej, fd, &status, argvname)) == 0) {
+			Conv_reject_desc_buf_t rej_buf;
+
 			eprintf(&lml_main, ERR_FATAL,
 			    MSG_INTL(err_reject[rej.rej_type]), argvname,
-			    conv_reject_desc(&rej));
+			    conv_reject_desc(&rej, &rej_buf));
 			return (0);
 		}
 
@@ -450,7 +452,7 @@
 			if ((FCT(mlmp) == &elf_fct) &&
 			    (ehdr->e_type == ET_EXEC)) {
 				int	i;
-				Phdr *	_phdr = (Phdr *)((uintptr_t)ADDR(mlmp) +
+				Phdr *_phdr = (Phdr *)((uintptr_t)ADDR(mlmp) +
 				    ehdr->e_phoff);
 
 				/*
@@ -703,7 +705,10 @@
 		ulong_t	mhwcap;
 
 		if ((mhwcap = (HWCAP(mlmp) & ~hwcap)) != 0) {
-			const char	*str = conv_cap_val_hw1(mhwcap, M_MACH);
+			Conv_cap_val_hw1_buf_t cap_val_hw1_buf;
+
+			const char *str =
+			    conv_cap_val_hw1(mhwcap, M_MACH, &cap_val_hw1_buf);
 
 			if (lml_main.lm_flags & LML_FLG_TRC_ENABLE) {
 				(void) printf(MSG_INTL(MSG_LDD_GEN_HWCAP_1),
--- a/usr/src/cmd/sgs/rtld/i386/i386_elf.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/rtld/i386/i386_elf.c	Thu Jul 26 08:45:42 2007 -0700
@@ -224,8 +224,10 @@
 	 * over the .got entries or jumped to plt0 out of the blue.
 	 */
 	if (!lmp || ((reloff % sizeof (Rel)) != 0)) {
+		Conv_inv_buf_t inv_buf;
+
 		eprintf(lml, ERR_FATAL, MSG_INTL(MSG_REL_PLTREF),
-		    conv_reloc_386_type(R_386_JMP_SLOT, 0),
+		    conv_reloc_386_type(R_386_JMP_SLOT, 0, &inv_buf),
 		    EC_NATPTR(lmp), EC_XWORD(reloff), EC_NATPTR(from));
 		rtldexit(lml, 1);
 	}
@@ -1115,5 +1117,7 @@
 const char *
 _conv_reloc_type(uint_t rel)
 {
-	return (conv_reloc_386_type(rel, 0));
+	static Conv_inv_buf_t inv_buf;
+
+	return (conv_reloc_386_type(rel, 0, &inv_buf));
 }
--- a/usr/src/cmd/sgs/rtld/mdbmod/common/rtld.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/rtld/mdbmod/common/rtld.c	Thu Jul 26 08:45:42 2007 -0700
@@ -1396,6 +1396,7 @@
 {
 	Dyn		dyn;
 	const char	*dynstr;
+	Conv_inv_buf_t	inv_buf;
 
 	if ((flags & DCMD_ADDRSPEC) == 0)
 		return (DCMD_USAGE);
@@ -1406,7 +1407,7 @@
 	}
 
 	mdb_printf(MSG_ORIG(MSG_ELFDYN_TITLE), addr);
-	dynstr = conv_dyn_tag(dyn.d_tag, M_MACH, 0);
+	dynstr = conv_dyn_tag(dyn.d_tag, M_MACH, 0, &inv_buf);
 	mdb_printf(MSG_ORIG(MSG_ELFDYN_LINE1), addr, dynstr, dyn.d_un.d_ptr);
 
 	mdb_set_dot(addr + sizeof (Dyn));
@@ -1424,9 +1425,12 @@
 /* ARGSUSED2 */
 dcmd_ElfEhdr(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
 {
-	Ehdr		ehdr;
-	Byte		*byte;
-	const char	*flgs;
+	Ehdr			ehdr;
+	Byte			*byte;
+	const char		*flgs;
+	Conv_inv_buf_t		inv_buf1, inv_buf2;
+	Conv_ehdr_flags_buf_t	ehdr_flags_buf;
+
 
 	if ((flags & DCMD_ADDRSPEC) == 0)
 		return (DCMD_USAGE);
@@ -1444,20 +1448,21 @@
 	    (byte[EI_MAG2] ? byte[EI_MAG2] : '0'),
 	    (byte[EI_MAG3] ? byte[EI_MAG3] : '0'));
 	mdb_printf(MSG_ORIG(MSG_EHDR_LINE2),
-	    conv_ehdr_class(ehdr.e_ident[EI_CLASS], 0),
-	    conv_ehdr_data(ehdr.e_ident[EI_DATA], 0));
+	    conv_ehdr_class(ehdr.e_ident[EI_CLASS], 0, &inv_buf1),
+	    conv_ehdr_data(ehdr.e_ident[EI_DATA], 0, &inv_buf2));
 
 	mdb_printf(MSG_ORIG(MSG_EHDR_LINE3),
-	    conv_ehdr_mach(ehdr.e_machine, 0),
-	    conv_ehdr_vers(ehdr.e_version, 0));
-	mdb_printf(MSG_ORIG(MSG_EHDR_LINE4), conv_ehdr_type(ehdr.e_type, 0));
+	    conv_ehdr_mach(ehdr.e_machine, 0, &inv_buf1),
+	    conv_ehdr_vers(ehdr.e_version, 0, &inv_buf2));
+	mdb_printf(MSG_ORIG(MSG_EHDR_LINE4),
+	    conv_ehdr_type(ehdr.e_type, 0, &inv_buf1));
 
 	/*
 	 * Line up the flags differently depending on whether we
 	 * received a numeric (e.g. "0x200") or text representation
 	 * (e.g. "[ EF_SPARC_SUN_US1 ]").
 	 */
-	flgs = conv_ehdr_flags(ehdr.e_machine, ehdr.e_flags);
+	flgs = conv_ehdr_flags(ehdr.e_machine, ehdr.e_flags, &ehdr_flags_buf);
 	if (flgs[0] == '[')
 		mdb_printf(MSG_ORIG(MSG_EHDR_LINE5), flgs);
 	else
@@ -1485,7 +1490,9 @@
 /* ARGSUSED2 */
 dcmd_ElfPhdr(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
 {
-	Phdr	phdr;
+	Phdr			phdr;
+	Conv_inv_buf_t		inv_buf;
+	Conv_phdr_flags_buf_t	phdr_flags_buf;
 
 	if ((flags & DCMD_ADDRSPEC) == 0)
 		return (DCMD_USAGE);
@@ -1498,9 +1505,9 @@
 
 	mdb_printf(MSG_ORIG(MSG_EPHDR_TITLE), addr);
 	mdb_printf(MSG_ORIG(MSG_EPHDR_LINE1), phdr.p_vaddr,
-	    conv_phdr_flags(phdr.p_flags));
+	    conv_phdr_flags(phdr.p_flags, &phdr_flags_buf));
 	mdb_printf(MSG_ORIG(MSG_EPHDR_LINE2), phdr.p_paddr,
-	    conv_phdr_type(M_MACH, phdr.p_type, 0));
+	    conv_phdr_type(M_MACH, phdr.p_type, 0, &inv_buf));
 	mdb_printf(MSG_ORIG(MSG_EPHDR_LINE3), phdr.p_filesz, phdr.p_memsz);
 	mdb_printf(MSG_ORIG(MSG_EPHDR_LINE4), phdr.p_offset, phdr.p_align);
 
--- a/usr/src/cmd/sgs/rtld/sparc/common_sparc.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/rtld/sparc/common_sparc.c	Thu Jul 26 08:45:42 2007 -0700
@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 #pragma ident	"%Z%%M%	%I%	%E% SMI"
@@ -116,9 +116,10 @@
 		 */
 		rsymndx = dyn->d_un.d_val;
 		symdef = (Sym *)((unsigned long)SYMTAB(lmp) +
-				(rsymndx * SYMENT(lmp)));
+		    (rsymndx * SYMENT(lmp)));
 
 		for (rp = reglist; rp; rp = rp->rl_next) {
+			Conv_inv_buf_t	inv_buf;
 			const char	*str, *sym1, *sym2;
 
 			if (rp->rl_sym == symdef) {
@@ -143,13 +144,15 @@
 
 			if (LIST(lmp)->lm_flags & LML_FLG_TRC_WARN) {
 				(void) printf(MSG_INTL(MSG_LDD_REG_SYMCONF),
-				    conv_sym_SPARC_value(symdef->st_value, 0),
-				    NAME(rp->rl_lmp), sym1, NAME(lmp), sym2);
+				    conv_sym_SPARC_value(symdef->st_value,
+				    0, &inv_buf), NAME(rp->rl_lmp),
+				    sym1, NAME(lmp), sym2);
 			} else {
 				eprintf(LIST(lmp), ERR_FATAL,
 				    MSG_INTL(MSG_REG_SYMCONF),
-				    conv_sym_SPARC_value(symdef->st_value, 0),
-				    NAME(rp->rl_lmp), sym1, NAME(lmp), sym2);
+				    conv_sym_SPARC_value(symdef->st_value,
+				    0, &inv_buf), NAME(rp->rl_lmp),
+				    sym1, NAME(lmp), sym2);
 				return (0);
 			}
 		}
--- a/usr/src/cmd/sgs/rtld/sparc/sparc_elf.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/rtld/sparc/sparc_elf.c	Thu Jul 26 08:45:42 2007 -0700
@@ -395,8 +395,10 @@
 	 * over the plt entries or jumped to plt0 out of the blue.
 	 */
 	if (!lmp || ((addr % M_PLT_ENTSIZE) != 0)) {
+		Conv_inv_buf_t	inv_buf;
+
 		eprintf(lml, ERR_FATAL, MSG_INTL(MSG_REL_PLTREF),
-		    conv_reloc_SPARC_type(R_SPARC_JMP_SLOT, 0),
+		    conv_reloc_SPARC_type(R_SPARC_JMP_SLOT, 0, &inv_buf),
 		    EC_NATPTR(lmp), EC_XWORD(pltoff), EC_NATPTR(from));
 		rtldexit(lml, 1);
 	}
@@ -1104,9 +1106,12 @@
 			if ((rtype == R_SPARC_GLOB_DAT) ||
 			    (rtype == R_SPARC_32)) {
 				if (roffset & 0x3) {
+					Conv_inv_buf_t inv_buf;
+
 					eprintf(LIST(lmp), ERR_FATAL,
 					    MSG_INTL(MSG_REL_NONALIGN),
-					    conv_reloc_SPARC_type(rtype, 0),
+					    conv_reloc_SPARC_type(rtype,
+					    0, &inv_buf),
 					    NAME(lmp), demangle(name),
 					    EC_OFF(roffset));
 					ret = 0;
@@ -1157,5 +1162,7 @@
 const char *
 _conv_reloc_type(uint_t rel)
 {
-	return (conv_reloc_SPARC_type(rel, 0));
+	static Conv_inv_buf_t	inv_buf;
+
+	return (conv_reloc_SPARC_type(rel, 0, &inv_buf));
 }
--- a/usr/src/cmd/sgs/rtld/sparcv9/sparc_elf.c	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/cmd/sgs/rtld/sparcv9/sparc_elf.c	Thu Jul 26 08:45:42 2007 -0700
@@ -539,8 +539,10 @@
 	 */
 	if (!lmp || (!farplt && (addr % M_PLT_ENTSIZE) != 0) ||
 	    (farplt && (addr % M_PLT_INSSIZE))) {
+		Conv_inv_buf_t	inv_buf;
+
 		eprintf(lml, ERR_FATAL, MSG_INTL(MSG_REL_PLTREF),
-		    conv_reloc_SPARC_type(R_SPARC_JMP_SLOT, 0),
+		    conv_reloc_SPARC_type(R_SPARC_JMP_SLOT, 0, &inv_buf),
 		    EC_NATPTR(lmp), EC_XWORD(pltoff), EC_NATPTR(from));
 		rtldexit(lml, 1);
 	}
@@ -1368,9 +1370,12 @@
 			if ((rtype == R_SPARC_GLOB_DAT) ||
 			    (rtype == R_SPARC_64)) {
 				if (roffset & 0x7) {
+					Conv_inv_buf_t	inv_buf;
+
 					eprintf(LIST(lmp), ERR_FATAL,
 					    MSG_INTL(MSG_REL_NONALIGN),
-					    conv_reloc_SPARC_type(rtype, 0),
+					    conv_reloc_SPARC_type(rtype,
+					    0, &inv_buf),
 					    NAME(lmp), demangle(name),
 					    EC_OFF(roffset));
 					ret = 0;
@@ -1440,5 +1445,7 @@
 const char *
 _conv_reloc_type(uint_t rel)
 {
-	return (conv_reloc_SPARC_type(rel, 0));
+	static Conv_inv_buf_t	inv_buf;
+
+	return (conv_reloc_SPARC_type(rel, 0, &inv_buf));
 }
--- a/usr/src/uts/common/krtld/reloc.h	Wed Jul 25 22:28:26 2007 -0700
+++ b/usr/src/uts/common/krtld/reloc.h	Thu Jul 26 08:45:42 2007 -0700
@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -259,28 +259,28 @@
 
 #define	REL_ERR_UNSUPSZ(lml, file, sym, rtype, size) \
 	(eprintf(lml, ERR_FATAL, MSG_INTL(MSG_REL_UNSUPSZ), \
-	    conv_reloc_type(M_MACH, (rtype), 0), (file), \
+	    conv_reloc_type_static(M_MACH, (rtype), 0), (file), \
 	    ((sym) ? demangle(sym) : MSG_INTL(MSG_STR_UNKNOWN)), (int)(size)))
 
 #define	REL_ERR_NONALIGN(lml, file, sym, rtype, off) \
 	(eprintf(lml, ERR_FATAL, MSG_INTL(MSG_REL_NONALIGN), \
-	    conv_reloc_type(M_MACH, (rtype), 0), (file), \
+	    conv_reloc_type_static(M_MACH, (rtype), 0), (file), \
 	    ((sym) ? demangle(sym) : MSG_INTL(MSG_STR_UNKNOWN)), EC_OFF((off))))
 
 #define	REL_ERR_UNNOBITS(lml, file, sym, rtype, nbits) \
 	(eprintf(lml, ERR_FATAL, MSG_INTL(MSG_REL_UNNOBITS), \
-	    conv_reloc_type(M_MACH, (rtype), 0), (file), \
+	    conv_reloc_type_static(M_MACH, (rtype), 0), (file), \
 	    ((sym) ? demangle(sym) : MSG_INTL(MSG_STR_UNKNOWN)), (nbits)))
 
 #define	REL_ERR_LOSEBITS(lml, file, sym, rtype, uvalue, nbits, off) \
 	(eprintf(lml, ERR_FATAL,  MSG_INTL(MSG_REL_LOSEBITS), \
-	    conv_reloc_type(M_MACH, (rtype), 0), (file), \
+	    conv_reloc_type_static(M_MACH, (rtype), 0), (file), \
 	    ((sym) ? demangle(sym) : MSG_INTL(MSG_STR_UNKNOWN)), \
 	    EC_XWORD((uvalue)), (nbits), EC_NATPTR((off))))
 
 #define	REL_ERR_NOFIT(lml, file, sym, rtype, uvalue) \
 	(eprintf(lml, ERR_FATAL, MSG_INTL(MSG_REL_NOFIT), \
-	    conv_reloc_type(M_MACH, (rtype), 0), (file), \
+	    conv_reloc_type_static(M_MACH, (rtype), 0), (file), \
 	    ((sym) ? demangle(sym) : MSG_INTL(MSG_STR_UNKNOWN)), \
 	    EC_XWORD((uvalue))))