xref: /onnv-gate/usr/src/cmd/sgs/libconv/common/map.c (revision 11734:d29dc9c2b6c5)
1*11734SAli.Bahrami@Sun.COM /*
2*11734SAli.Bahrami@Sun.COM  * CDDL HEADER START
3*11734SAli.Bahrami@Sun.COM  *
4*11734SAli.Bahrami@Sun.COM  * The contents of this file are subject to the terms of the
5*11734SAli.Bahrami@Sun.COM  * Common Development and Distribution License (the "License").
6*11734SAli.Bahrami@Sun.COM  * You may not use this file except in compliance with the License.
7*11734SAli.Bahrami@Sun.COM  *
8*11734SAli.Bahrami@Sun.COM  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*11734SAli.Bahrami@Sun.COM  * or http://www.opensolaris.org/os/licensing.
10*11734SAli.Bahrami@Sun.COM  * See the License for the specific language governing permissions
11*11734SAli.Bahrami@Sun.COM  * and limitations under the License.
12*11734SAli.Bahrami@Sun.COM  *
13*11734SAli.Bahrami@Sun.COM  * When distributing Covered Code, include this CDDL HEADER in each
14*11734SAli.Bahrami@Sun.COM  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*11734SAli.Bahrami@Sun.COM  * If applicable, add the following below this CDDL HEADER, with the
16*11734SAli.Bahrami@Sun.COM  * fields enclosed by brackets "[]" replaced with your own identifying
17*11734SAli.Bahrami@Sun.COM  * information: Portions Copyright [yyyy] [name of copyright owner]
18*11734SAli.Bahrami@Sun.COM  *
19*11734SAli.Bahrami@Sun.COM  * CDDL HEADER END
20*11734SAli.Bahrami@Sun.COM  */
21*11734SAli.Bahrami@Sun.COM 
22*11734SAli.Bahrami@Sun.COM /*
23*11734SAli.Bahrami@Sun.COM  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
24*11734SAli.Bahrami@Sun.COM  * Use is subject to license terms.
25*11734SAli.Bahrami@Sun.COM  */
26*11734SAli.Bahrami@Sun.COM 
27*11734SAli.Bahrami@Sun.COM /*
28*11734SAli.Bahrami@Sun.COM  * String conversion routines for mapfile related items.
29*11734SAli.Bahrami@Sun.COM  * These items are not ELF constructs. However, we have a need
30*11734SAli.Bahrami@Sun.COM  * to display them.
31*11734SAli.Bahrami@Sun.COM  */
32*11734SAli.Bahrami@Sun.COM #include	<stdio.h>
33*11734SAli.Bahrami@Sun.COM #include	<_conv.h>
34*11734SAli.Bahrami@Sun.COM #include	<map_msg.h>
35*11734SAli.Bahrami@Sun.COM 
36*11734SAli.Bahrami@Sun.COM const char *
conv_mapfile_version(Word version,Conv_fmt_flags_t fmt_flags,Conv_inv_buf_t * inv_buf)37*11734SAli.Bahrami@Sun.COM conv_mapfile_version(Word version, Conv_fmt_flags_t fmt_flags,
38*11734SAli.Bahrami@Sun.COM     Conv_inv_buf_t *inv_buf)
39*11734SAli.Bahrami@Sun.COM {
40*11734SAli.Bahrami@Sun.COM 	static const Msg	versions[] = {
41*11734SAli.Bahrami@Sun.COM 		MSG_VER_NONE,	MSG_VER_SYSV,	MSG_VER_SOLARIS
42*11734SAli.Bahrami@Sun.COM 	};
43*11734SAli.Bahrami@Sun.COM #if MFV_NUM != (MFV_SOLARIS + 1)
44*11734SAli.Bahrami@Sun.COM #error "NT_NUM has grown. Update mapfile versions[]"
45*11734SAli.Bahrami@Sun.COM #endif
46*11734SAli.Bahrami@Sun.COM 	static const conv_ds_msg_t ds_versions = {
47*11734SAli.Bahrami@Sun.COM 	    CONV_DS_MSG_INIT(MFV_NONE, versions) };
48*11734SAli.Bahrami@Sun.COM 	static const conv_ds_t	*ds[] = { CONV_DS_ADDR(ds_versions), NULL };
49*11734SAli.Bahrami@Sun.COM 
50*11734SAli.Bahrami@Sun.COM 	return (conv_map_ds(ELFOSABI_NONE, EM_NONE, version, ds, fmt_flags,
51*11734SAli.Bahrami@Sun.COM 	    inv_buf));
52*11734SAli.Bahrami@Sun.COM }
53