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 2008 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
30 #pragma ident "%Z%%M% %I% %E% SMI"
33 * Local include file for elfwrap.
40 * Define a target descriptor to hold target specific information.
43 uchar_t td_class
; /* target class (32-bit/64-bit) */
44 uchar_t td_data
; /* target data (LSB/MSB) */
45 ushort_t td_mach
; /* target machine (sparc, i386, etc.) */
46 size_t td_align
; /* target data buffer alignment */
47 size_t td_symsz
; /* target symbol table entry size */
51 * Define a descriptor for each ELF section being output to the new file.
54 const char *os_name
; /* section name */
55 Word os_type
; /* section type */
56 Xword os_flags
; /* section flags */
57 size_t os_ndx
; /* section index (input file) */
58 off_t os_size
; /* section size (input file) */
59 void *os_addr
; /* section address (input file) */
60 Shdr
*os_shdr
; /* section header (output file) */
61 Elf_Data
*os_data
; /* section data (output file) */
64 #define AL_CNT_WOSECS 10 /* default number of input sections */
67 * Define a standard section descriptor.
70 const char *ss_name
; /* section name */
71 Word ss_type
; /* section type */
72 Xword ss_flags
; /* section flags */
76 * Define a descriptor to maintain section information.
79 Alist
*od_outsecs
; /* list of output sections */
80 size_t od_symtabno
; /* number of symbol table entries */
81 size_t od_strtabsz
; /* string table size */
82 size_t od_shstrtabsz
; /* section header string table size */
86 * Define all external interfaces.
88 extern int input32(int, char **, const char *, const char *, ObjDesc_t
*);
89 extern int input64(int, char **, const char *, const char *, ObjDesc_t
*);
90 extern int output32(const char *, int, const char *, ushort_t
,
92 extern int output64(const char *, int, const char *, ushort_t
,
96 extern void target_init(TargDesc_t
*);
98 extern void target_init_sparc(TargDesc_t
*);
99 extern void target_init_sparcv9(TargDesc_t
*);
100 extern void target_init_i386(TargDesc_t
*);
101 extern void target_init_amd64(TargDesc_t
*);
112 #endif /* __ELFWRAP_H */