xref: /titanic_41/usr/src/cmd/sgs/rtld/common/debugdata.c (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright (c) 2001 by Sun Microsystems, Inc.
24  * All rights reserved.
25  */
26 
27 #pragma ident	"%Z%%M%	%I%	%E% SMI"
28 
29 #include "_rtld.h"
30 
31 
32 /*
33  * Note: for initialization of librtld_db - it's required that
34  * the r_debug & rtlddb_priv structures be the *only data item*
35  * in the .data section, this is the only way we can gain
36  * full control over where it is placed.  This section is in turn
37  * placed at the beginning of ld.so.1's data segment (which
38  * AT_SUN_LDDATA points to :)).
39  */
40 
41 /*
42  * Private structure for passing of information between librltd_db
43  * and rtld.
44  *
45  * Note:  Any data that's being 'exported' to librtld_db must not
46  *	  require any 'relocations' before it can be examined.  That's
47  *	  because librtld_db will examine this structure before rtld has
48  *	  started to execute (and before it's relocated itself).  So - all
49  *	  data in this structure must be available at that point.
50  */
51 struct rtld_db_priv r_debug = {
52 	{
53 		R_DEBUG_VERSION,			/* version no. */
54 		0,					/* r_map */
55 		(unsigned long)rtld_db_dlactivity,	/* r_brk */
56 		RT_CONSISTENT,				/* r_state */
57 		0,					/* r_ldbase */
58 		0,					/* r_ldsomap */
59 		RD_NONE,				/* r_rdevent */
60 		RD_FL_NONE				/* r_flags */
61 	},
62 	R_RTLDDB_VERSION,		/* rtd_version */
63 	0,				/* rtd_objpad */
64 	0				/* rtd_dynlmlst */
65 };
66