xref: /titanic_52/usr/src/cmd/sgs/include/dwarf.h (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate  *
4*7c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate  * with the License.
8*7c478bd9Sstevel@tonic-gate  *
9*7c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate  * and limitations under the License.
13*7c478bd9Sstevel@tonic-gate  *
14*7c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate  *
20*7c478bd9Sstevel@tonic-gate  * CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate  */
22*7c478bd9Sstevel@tonic-gate /*	Copyright (c) 1989 AT&T	*/
23*7c478bd9Sstevel@tonic-gate /*	  All Rights Reserved  	*/
24*7c478bd9Sstevel@tonic-gate 
25*7c478bd9Sstevel@tonic-gate 
26*7c478bd9Sstevel@tonic-gate /*
27*7c478bd9Sstevel@tonic-gate  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
28*7c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
29*7c478bd9Sstevel@tonic-gate  */
30*7c478bd9Sstevel@tonic-gate 
31*7c478bd9Sstevel@tonic-gate #ifndef _DWARF_H
32*7c478bd9Sstevel@tonic-gate #define	_DWARF_H
33*7c478bd9Sstevel@tonic-gate 
34*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
35*7c478bd9Sstevel@tonic-gate 
36*7c478bd9Sstevel@tonic-gate #include <sys/types.h>
37*7c478bd9Sstevel@tonic-gate 
38*7c478bd9Sstevel@tonic-gate 
39*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
40*7c478bd9Sstevel@tonic-gate extern "C" {
41*7c478bd9Sstevel@tonic-gate #endif
42*7c478bd9Sstevel@tonic-gate 
43*7c478bd9Sstevel@tonic-gate 
44*7c478bd9Sstevel@tonic-gate 
45*7c478bd9Sstevel@tonic-gate /* dwarf.h - manifest constants used in the .debug section of ELF files */
46*7c478bd9Sstevel@tonic-gate 
47*7c478bd9Sstevel@tonic-gate 
48*7c478bd9Sstevel@tonic-gate /* the "tag" - the first short of any legal record */
49*7c478bd9Sstevel@tonic-gate 
50*7c478bd9Sstevel@tonic-gate #define	TAG_padding			0x0000
51*7c478bd9Sstevel@tonic-gate #define	TAG_array_type			0x0001
52*7c478bd9Sstevel@tonic-gate #define	TAG_class_type			0x0002
53*7c478bd9Sstevel@tonic-gate #define	TAG_entry_point			0x0003
54*7c478bd9Sstevel@tonic-gate #define	TAG_enumeration_type		0x0004
55*7c478bd9Sstevel@tonic-gate #define	TAG_formal_parameter		0x0005
56*7c478bd9Sstevel@tonic-gate #define	TAG_global_subroutine		0x0006
57*7c478bd9Sstevel@tonic-gate #define	TAG_global_variable		0x0007
58*7c478bd9Sstevel@tonic-gate #define	TAG_imported_declaration	0x0008
59*7c478bd9Sstevel@tonic-gate #define	TAG_inline_subroutine		0x0009
60*7c478bd9Sstevel@tonic-gate #define	TAG_label			0x000a
61*7c478bd9Sstevel@tonic-gate #define	TAG_lexical_block		0x000b
62*7c478bd9Sstevel@tonic-gate #define	TAG_local_variable		0x000c
63*7c478bd9Sstevel@tonic-gate #define	TAG_member			0x000d
64*7c478bd9Sstevel@tonic-gate #define	TAG_member_function		0x000e
65*7c478bd9Sstevel@tonic-gate #define	TAG_pointer_type		0x000f
66*7c478bd9Sstevel@tonic-gate #define	TAG_reference_type		0x0010
67*7c478bd9Sstevel@tonic-gate #define	TAG_source_file			0x0011
68*7c478bd9Sstevel@tonic-gate #define	TAG_string_type			0x0012
69*7c478bd9Sstevel@tonic-gate #define	TAG_structure_type		0x0013
70*7c478bd9Sstevel@tonic-gate #define	TAG_subroutine			0x0014
71*7c478bd9Sstevel@tonic-gate #define	TAG_subroutine_type		0x0015
72*7c478bd9Sstevel@tonic-gate #define	TAG_typedef			0x0016
73*7c478bd9Sstevel@tonic-gate #define	TAG_union_type			0x0017
74*7c478bd9Sstevel@tonic-gate #define	TAG_unspecified_parameters	0x0018
75*7c478bd9Sstevel@tonic-gate #define	TAG_variant			0x0019
76*7c478bd9Sstevel@tonic-gate 
77*7c478bd9Sstevel@tonic-gate 
78*7c478bd9Sstevel@tonic-gate /* attribute forms are encoded as part */
79*7c478bd9Sstevel@tonic-gate /* of the attribute name and must fit */
80*7c478bd9Sstevel@tonic-gate /* into 4 bits */
81*7c478bd9Sstevel@tonic-gate 
82*7c478bd9Sstevel@tonic-gate #define	FORM_MASK	0xf
83*7c478bd9Sstevel@tonic-gate 
84*7c478bd9Sstevel@tonic-gate #define	FORM_NONE	0x0	/* error */
85*7c478bd9Sstevel@tonic-gate #define	FORM_ADDR	0x1	/* relocated address */
86*7c478bd9Sstevel@tonic-gate #define	FORM_REF	0x2	/* reference to another .debug entry */
87*7c478bd9Sstevel@tonic-gate #define	FORM_BLOCK2	0x3	/* block with 2-byte length */
88*7c478bd9Sstevel@tonic-gate #define	FORM_BLOCK4	0x4	/* block with 4-byte length (unused) */
89*7c478bd9Sstevel@tonic-gate #define	FORM_DATA2	0x5	/* 2 bytes */
90*7c478bd9Sstevel@tonic-gate #define	FORM_DATA4	0x6	/* 4 bytes */
91*7c478bd9Sstevel@tonic-gate #define	FORM_DATA8	0x7	/* 8 bytes (two 4-byte values) */
92*7c478bd9Sstevel@tonic-gate #define	FORM_STRING	0x8	/* NUL-terminated string */
93*7c478bd9Sstevel@tonic-gate 
94*7c478bd9Sstevel@tonic-gate 
95*7c478bd9Sstevel@tonic-gate /* attribute names, halfwords with low 4 bits indicating the form */
96*7c478bd9Sstevel@tonic-gate 
97*7c478bd9Sstevel@tonic-gate #define	AT_padding	 (0x0000|FORM_NONE)	/* just padding */
98*7c478bd9Sstevel@tonic-gate #define	AT_sibling	 (0x0010|FORM_REF)	/* next owned declaration */
99*7c478bd9Sstevel@tonic-gate #define	AT_location	 (0x0020|FORM_BLOCK2)	/* location description */
100*7c478bd9Sstevel@tonic-gate #define	AT_name		 (0x0030|FORM_STRING)	/* symbol name */
101*7c478bd9Sstevel@tonic-gate #define	AT_dimensions	 (0x0040|FORM_DATA2)	/* array dimensions */
102*7c478bd9Sstevel@tonic-gate #define	AT_fund_type	 (0x0050|FORM_DATA2)	/* fund type enum */
103*7c478bd9Sstevel@tonic-gate #define	AT_mod_fund_type (0x0060|FORM_BLOCK2)	/* modifiers & fund type enum */
104*7c478bd9Sstevel@tonic-gate #define	AT_user_def_type (0x0070|FORM_REF)	/* type entry */
105*7c478bd9Sstevel@tonic-gate #define	AT_mod_u_d_type  (0x0080|FORM_BLOCK2)	/* modifiers & type entry ref */
106*7c478bd9Sstevel@tonic-gate #define	AT_ordering	 (0x0090|FORM_DATA2)	/* array row/column major */
107*7c478bd9Sstevel@tonic-gate #define	AT_subscr_data	 (0x00a0|FORM_BLOCK2)	/* list of array dim info */
108*7c478bd9Sstevel@tonic-gate #define	AT_byte_size	 (0x00b0|FORM_DATA4)	/* number bytes per instance */
109*7c478bd9Sstevel@tonic-gate #define	AT_bit_offset	 (0x00c0|FORM_DATA2)	/* number bits padding */
110*7c478bd9Sstevel@tonic-gate #define	AT_bit_size	 (0x00d0|FORM_DATA4)	/* number bits per instance */
111*7c478bd9Sstevel@tonic-gate #define	AT_deriv_list	 (0x00e0|FORM_BLOCK2)	/* list of base class refs */
112*7c478bd9Sstevel@tonic-gate #define	AT_element_list	 (0x00f0|FORM_BLOCK4)	/* list of enum data elements */
113*7c478bd9Sstevel@tonic-gate #define	AT_stmt_list	 (0x0100|FORM_DATA4)	/* offset in .line sect */
114*7c478bd9Sstevel@tonic-gate #define	AT_low_pc	 (0x0110|FORM_ADDR)	/* first machine instr */
115*7c478bd9Sstevel@tonic-gate #define	AT_high_pc	 (0x0120|FORM_ADDR)	/* beyond last machine instr */
116*7c478bd9Sstevel@tonic-gate #define	AT_language	 (0x0130|FORM_DATA4)	/* compiler enumeration */
117*7c478bd9Sstevel@tonic-gate #define	AT_member	 (0x0140|FORM_REF)	/* class description */
118*7c478bd9Sstevel@tonic-gate #define	AT_discr	 (0x0150|FORM_REF)	/* discriminant entry */
119*7c478bd9Sstevel@tonic-gate #define	AT_discr_value	 (0x0160|FORM_BLOCK2)	/* value of discr */
120*7c478bd9Sstevel@tonic-gate #define	AT_visibility	 (0x0170|FORM_DATA2)	/* visibility enumeration */
121*7c478bd9Sstevel@tonic-gate #define	AT_import	 (0x0180|FORM_REF)	/* imported declaration */
122*7c478bd9Sstevel@tonic-gate #define	AT_string_length (0x0190|FORM_BLOCK2)	/* runtime string size */
123*7c478bd9Sstevel@tonic-gate 
124*7c478bd9Sstevel@tonic-gate 
125*7c478bd9Sstevel@tonic-gate /* atoms which compose a location description; must fit in a byte */
126*7c478bd9Sstevel@tonic-gate 
127*7c478bd9Sstevel@tonic-gate #define	OP_UNK		0x00	/* error */
128*7c478bd9Sstevel@tonic-gate #define	OP_REG		0x01	/* push register (number) */
129*7c478bd9Sstevel@tonic-gate #define	OP_BASEREG	0x02	/* push value of register (number) */
130*7c478bd9Sstevel@tonic-gate #define	OP_ADDR		0x03	/* push address (relocated address) */
131*7c478bd9Sstevel@tonic-gate #define	OP_CONST	0x04	/* push constant (number) */
132*7c478bd9Sstevel@tonic-gate #define	OP_DEREF2	0x05	/* pop, deref and push 2 bytes (as a long) */
133*7c478bd9Sstevel@tonic-gate #define	OP_DEREF4	0x06	/* pop, deref and push 4 bytes (as a long) */
134*7c478bd9Sstevel@tonic-gate #define	OP_ADD		0x07	/* pop top 2 items, add, push result */
135*7c478bd9Sstevel@tonic-gate 
136*7c478bd9Sstevel@tonic-gate /* fundamental types; must fit in two bytes */
137*7c478bd9Sstevel@tonic-gate 
138*7c478bd9Sstevel@tonic-gate #define	FT_none			0x0000	/* error */
139*7c478bd9Sstevel@tonic-gate #define	FT_char			0x0001	/* "plain" char */
140*7c478bd9Sstevel@tonic-gate #define	FT_signed_char		0x0002
141*7c478bd9Sstevel@tonic-gate #define	FT_unsigned_char	0x0003
142*7c478bd9Sstevel@tonic-gate #define	FT_short		0x0004	/* "plain" short */
143*7c478bd9Sstevel@tonic-gate #define	FT_signed_short		0x0005
144*7c478bd9Sstevel@tonic-gate #define	FT_unsigned_short	0x0006
145*7c478bd9Sstevel@tonic-gate #define	FT_integer		0x0007	/* "plain" integer */
146*7c478bd9Sstevel@tonic-gate #define	FT_signed_integer	0x0008
147*7c478bd9Sstevel@tonic-gate #define	FT_unsigned_integer	0x0009
148*7c478bd9Sstevel@tonic-gate #define	FT_long			0x000a	/* "plain" long */
149*7c478bd9Sstevel@tonic-gate #define	FT_signed_long		0x000b
150*7c478bd9Sstevel@tonic-gate #define	FT_unsigned_long	0x000c
151*7c478bd9Sstevel@tonic-gate #define	FT_pointer		0x000d	/* (void *) */
152*7c478bd9Sstevel@tonic-gate #define	FT_float		0x000e
153*7c478bd9Sstevel@tonic-gate #define	FT_dbl_prec_float	0x000f
154*7c478bd9Sstevel@tonic-gate #define	FT_ext_prec_float	0x0010
155*7c478bd9Sstevel@tonic-gate #define	FT_complex		0x0011
156*7c478bd9Sstevel@tonic-gate #define	FT_dbl_prec_complex	0x0012
157*7c478bd9Sstevel@tonic-gate #define	FT_set			0x0013
158*7c478bd9Sstevel@tonic-gate #define	FT_void			0x0014
159*7c478bd9Sstevel@tonic-gate 
160*7c478bd9Sstevel@tonic-gate 
161*7c478bd9Sstevel@tonic-gate /* type modifiers; must fit in a byte */
162*7c478bd9Sstevel@tonic-gate 
163*7c478bd9Sstevel@tonic-gate #define	MOD_none		0x00	/* error */
164*7c478bd9Sstevel@tonic-gate #define	MOD_pointer_to		0x01
165*7c478bd9Sstevel@tonic-gate #define	MOD_reference_to	0x02
166*7c478bd9Sstevel@tonic-gate 
167*7c478bd9Sstevel@tonic-gate 
168*7c478bd9Sstevel@tonic-gate /* the "format" byte for array descriptions; formed from three */
169*7c478bd9Sstevel@tonic-gate /* one-bit fields */
170*7c478bd9Sstevel@tonic-gate 
171*7c478bd9Sstevel@tonic-gate #define	FMT_FT	0		/* fundamental type */
172*7c478bd9Sstevel@tonic-gate #define	FMT_UDT	1		/* user-defined type */
173*7c478bd9Sstevel@tonic-gate 
174*7c478bd9Sstevel@tonic-gate #define	FMT_CONST	0	/* 4-byte constant */
175*7c478bd9Sstevel@tonic-gate #define	FMT_EXPR	1	/* block with 2-byte length (loc descr) */
176*7c478bd9Sstevel@tonic-gate 
177*7c478bd9Sstevel@tonic-gate #define	FMT_FT_C_C	((FMT_FT <<2) | (FMT_CONST<<1) | (FMT_CONST))
178*7c478bd9Sstevel@tonic-gate #define	FMT_FT_C_X	((FMT_FT <<2) | (FMT_CONST<<1) | (FMT_EXPR))
179*7c478bd9Sstevel@tonic-gate #define	FMT_FT_X_C	((FMT_FT <<2) | (FMT_EXPR <<1) | (FMT_CONST))
180*7c478bd9Sstevel@tonic-gate #define	FMT_FT_X_X	((FMT_FT <<2) | (FMT_EXPR <<1) | (FMT_EXPR))
181*7c478bd9Sstevel@tonic-gate #define	FMT_UT_C_C	((FMT_UDT<<2) | (FMT_CONST<<1) | (FMT_CONST))
182*7c478bd9Sstevel@tonic-gate #define	FMT_UT_C_X	((FMT_UDT<<2) | (FMT_CONST<<1) | (FMT_EXPR))
183*7c478bd9Sstevel@tonic-gate #define	FMT_UT_X_C	((FMT_UDT<<2) | (FMT_EXPR <<1) | (FMT_CONST))
184*7c478bd9Sstevel@tonic-gate #define	FMT_UT_X_X	((FMT_UDT<<2) | (FMT_EXPR <<1) | (FMT_EXPR))
185*7c478bd9Sstevel@tonic-gate 
186*7c478bd9Sstevel@tonic-gate #define	FMT_ET		8	/* element type */
187*7c478bd9Sstevel@tonic-gate 
188*7c478bd9Sstevel@tonic-gate 
189*7c478bd9Sstevel@tonic-gate /* ordering of arrays */
190*7c478bd9Sstevel@tonic-gate 
191*7c478bd9Sstevel@tonic-gate #define	ORD_row_major	0
192*7c478bd9Sstevel@tonic-gate #define	ORD_col_major	1
193*7c478bd9Sstevel@tonic-gate 
194*7c478bd9Sstevel@tonic-gate 
195*7c478bd9Sstevel@tonic-gate /* visibility values */
196*7c478bd9Sstevel@tonic-gate 
197*7c478bd9Sstevel@tonic-gate #define	VIS_local	0	/* for static functions in C */
198*7c478bd9Sstevel@tonic-gate #define	VIS_exported	1	/* for Modula */
199*7c478bd9Sstevel@tonic-gate 
200*7c478bd9Sstevel@tonic-gate /*
201*7c478bd9Sstevel@tonic-gate  * DWARF Exception Header Encoding
202*7c478bd9Sstevel@tonic-gate  *
203*7c478bd9Sstevel@tonic-gate  * The DWARF Exception Header Encoding is used to describe the type of data
204*7c478bd9Sstevel@tonic-gate  * used in the .eh_frame_hdr section. The upper 4 bits indicate how the value
205*7c478bd9Sstevel@tonic-gate  * is to be applied. The lower 4 bits indicate the format of the data.
206*7c478bd9Sstevel@tonic-gate  */
207*7c478bd9Sstevel@tonic-gate 
208*7c478bd9Sstevel@tonic-gate /*
209*7c478bd9Sstevel@tonic-gate  * Dwarf Exception Header Value format
210*7c478bd9Sstevel@tonic-gate  */
211*7c478bd9Sstevel@tonic-gate #define	DW_EH_PE_omit		0xff    /* No value is present. */
212*7c478bd9Sstevel@tonic-gate #define	DW_EH_PE_absptr		0x00    /* Value is a void* */
213*7c478bd9Sstevel@tonic-gate #define	DW_EH_PE_uleb128	0x01    /* Unsigned value is encoded using */
214*7c478bd9Sstevel@tonic-gate 					/*   the Little Endian */
215*7c478bd9Sstevel@tonic-gate 					/*   Base 128 (LEB128) */
216*7c478bd9Sstevel@tonic-gate #define	DW_EH_PE_udata2		0x02    /* A 2 bytes unsigned value. */
217*7c478bd9Sstevel@tonic-gate #define	DW_EH_PE_udata4		0x03    /* A 4 bytes unsigned value. */
218*7c478bd9Sstevel@tonic-gate #define	DW_EH_PE_udata8		0x04    /* An 8 bytes unsigned value. */
219*7c478bd9Sstevel@tonic-gate #define	DW_EH_PE_signed		0x08	/* bit on for all signed encodings */
220*7c478bd9Sstevel@tonic-gate #define	DW_EH_PE_sleb128	0x09	/* Signed value is encoded using */
221*7c478bd9Sstevel@tonic-gate 					/*   the Little Endian */
222*7c478bd9Sstevel@tonic-gate 					/*   Base 128 (LEB128) */
223*7c478bd9Sstevel@tonic-gate #define	DW_EH_PE_sdata2		0x0a	/* A 2 bytes signed value. */
224*7c478bd9Sstevel@tonic-gate #define	DW_EH_PE_sdata4		0x0b	/* A 4 bytes signed value. */
225*7c478bd9Sstevel@tonic-gate #define	DW_EH_PE_sdata8		0x0c	/* An 8 bytes signed value. */
226*7c478bd9Sstevel@tonic-gate 
227*7c478bd9Sstevel@tonic-gate /*
228*7c478bd9Sstevel@tonic-gate  * Dwarf Exception Header application
229*7c478bd9Sstevel@tonic-gate  */
230*7c478bd9Sstevel@tonic-gate #define	DW_EH_PE_absptr		0x00	/* Value is used with no */
231*7c478bd9Sstevel@tonic-gate 					/*  modification. */
232*7c478bd9Sstevel@tonic-gate #define	DW_EH_PE_pcrel		0x10	/* Value is reletive to the location */
233*7c478bd9Sstevel@tonic-gate 					/*  of itself */
234*7c478bd9Sstevel@tonic-gate #define	DW_EH_PE_textrel	0x20
235*7c478bd9Sstevel@tonic-gate #define	DW_EH_PE_datarel	0x30	/* Value is reletive to the beginning */
236*7c478bd9Sstevel@tonic-gate 					/*  of the eh_frame_hdr segment */
237*7c478bd9Sstevel@tonic-gate 					/*  ( segment type PT_AMD64_UNWIND ) */
238*7c478bd9Sstevel@tonic-gate #define	DW_EH_PE_funcrel	0x40
239*7c478bd9Sstevel@tonic-gate #define	DW_EH_PE_aligned	0x50	/* value is an aligned void* */
240*7c478bd9Sstevel@tonic-gate #define	DW_EH_PE_indirect	0x80	/* bit to signal indirection after */
241*7c478bd9Sstevel@tonic-gate 					/*  relocation */
242*7c478bd9Sstevel@tonic-gate 
243*7c478bd9Sstevel@tonic-gate 
244*7c478bd9Sstevel@tonic-gate /* language/compiler enumeration */
245*7c478bd9Sstevel@tonic-gate 
246*7c478bd9Sstevel@tonic-gate typedef enum _LANG {
247*7c478bd9Sstevel@tonic-gate 	LANG_UNK = 0,
248*7c478bd9Sstevel@tonic-gate 	LANG_ANSI_C_V1 = 1
249*7c478bd9Sstevel@tonic-gate } LANG;
250*7c478bd9Sstevel@tonic-gate 
251*7c478bd9Sstevel@tonic-gate /*
252*7c478bd9Sstevel@tonic-gate  * Little Endian Base 128 (leb128) encoding/decoding routines
253*7c478bd9Sstevel@tonic-gate  */
254*7c478bd9Sstevel@tonic-gate extern	uint64_t	uleb_extract(unsigned char *, uint64_t *);
255*7c478bd9Sstevel@tonic-gate extern	int64_t		sleb_extract(unsigned char *, uint64_t *);
256*7c478bd9Sstevel@tonic-gate extern	uint64_t	dwarf_ehe_extract(unsigned char *, uint64_t *,
257*7c478bd9Sstevel@tonic-gate 				uint_t, unsigned char *, uint64_t);
258*7c478bd9Sstevel@tonic-gate 
259*7c478bd9Sstevel@tonic-gate /*
260*7c478bd9Sstevel@tonic-gate  * LSB32EXTRACT()
261*7c478bd9Sstevel@tonic-gate  *
262*7c478bd9Sstevel@tonic-gate  * Extract a LSB encoded int which may or may not be
263*7c478bd9Sstevel@tonic-gate  * aligned on a 4 byte boundary.  This macro will work
264*7c478bd9Sstevel@tonic-gate  * on either a MSB or LSB based system.
265*7c478bd9Sstevel@tonic-gate  */
266*7c478bd9Sstevel@tonic-gate #define	LSB32EXTRACT(lsbptr)	((unsigned int)(\
267*7c478bd9Sstevel@tonic-gate 				((unsigned const char *)(lsbptr))[0] + \
268*7c478bd9Sstevel@tonic-gate 				(((unsigned const char *)(lsbptr))[1] << 8) + \
269*7c478bd9Sstevel@tonic-gate 				(((unsigned const char *)(lsbptr))[2] << 16) + \
270*7c478bd9Sstevel@tonic-gate 				(((unsigned const char *)(lsbptr))[3] << 24)))
271*7c478bd9Sstevel@tonic-gate 
272*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
273*7c478bd9Sstevel@tonic-gate }
274*7c478bd9Sstevel@tonic-gate #endif
275*7c478bd9Sstevel@tonic-gate 
276*7c478bd9Sstevel@tonic-gate 
277*7c478bd9Sstevel@tonic-gate #endif /* _DWARF_H */
278