4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
30 #pragma ident "%Z%%M% %I% %E% SMI"
42 * Define a cache structure that is used to retain all elf section information.
44 typedef struct cache
{
53 #define FLG_C_EXCLUDE 1 /* exclude section from output image */
54 #define FLG_C_HEAP 2 /* heap section (addition) */
55 #define FLG_C_RELOC 3 /* relocation section requiring */
57 #define FLG_C_SHSTR 4 /* section header string table */
58 #define FLG_C_END 5 /* null terminating section marker */
62 * Define a structure for maintaining relocation information. During the first
63 * pass through an input files relocation records, counts are maintained of the
64 * number of relocations to recreate in the output image. The intent is to
65 * localize any remaining relocation records. The relocation structure
66 * indicates the actions that must be performed on the output images relocation
69 typedef struct reloc
{
71 Xword r_pltndx
; /* pltndx if a JMP relocation */
72 Addr r_value
; /* value to apply to relocation */
73 unsigned long r_size
; /* size (used for copy relocations) */
74 const char *r_name
; /* relocation symbol */
77 #define FLG_R_UNDO 0x01 /* undo any relocation offset value */
78 #define FLG_R_CLR 0x02 /* clear the relocation record */
79 #define FLG_R_INC 0x04 /* increment the relocation offset */
80 /* (uses new fixed addr) */
81 #define FLG_R_APPLY 0x08 /* apply the relocation */
85 * Define any local prototypes.
87 extern void apply_reloc(void *, Reloc
*, const char *, uchar_t
*, Rt_map
*);
88 extern void clear_reloc(void *);
89 extern int count_reloc(Cache
*, Cache
*, Rt_map
*, int, Addr
, Xword
*,
90 Xword
*, Xword
*, Alist
*);
91 extern void inc_reloc(void *, void *, Reloc
*, uchar_t
*, uchar_t
*);
92 extern int syminfo(Cache
*, Alist
**);
93 extern void undo_reloc(void *, uchar_t
*, uchar_t
*, Reloc
*);
94 extern int update_dynamic(Cache
*, Cache
*, Rt_map
*, int, Addr
, Off
,
95 const char *, Xword
, Xword
, Xword
, Xword
, Xword
);
96 extern void update_reloc(Cache
*, Cache
*, Cache
*, const char *,
97 Rt_map
*, Rel
**, Rel
**, Rel
**);
98 extern void update_sym(Cache
*, Cache
*, Addr
, Half
, Addr
);
104 #endif /* __LIBRTLD_H */