Print this page
file: support DT_SUNW_KMOD usefully
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/file/elf_read.h
+++ new/usr/src/cmd/file/elf_read.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
↓ open down ↓ |
18 lines elided |
↑ open up ↑ |
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
23 23 * Use is subject to license terms.
24 24 */
25 25
26 26 #ifndef _ELF_READ_H
27 27 #define _ELF_READ_H
28 28
29 -#pragma ident "%Z%%M% %I% %E% SMI"
30 -
31 29 #define BUFSZ 128
32 30 typedef struct Elf_Info {
33 31 boolean_t dynamic; /* dymanically linked? */
34 32 unsigned core_type; /* core? what type of core? */
35 33 unsigned stripped; /* symtab, debug info */
36 34 unsigned flags; /* e_flags */
37 35 unsigned machine; /* e_machine */
38 36 unsigned type; /* e_type */
39 37 int elffd; /* fd of file being processed */
40 38 char fname[PRFNSZ]; /* name of process that dumped core */
41 39 char cap_str[BUFSZ]; /* hw/sw capabilities */
42 40 char *file; /* file being processed */
41 + boolean_t kmod;
43 42 } Elf_Info;
44 43
45 44 /* values for Elf_Info.stripped */
46 45 #define E_DBGINF 0x01
47 46 #define E_SYMTAB 0x02
48 47 #define E_NOSTRIP 0x03
49 48
50 49 /* values for Elf_Info.core_type; */
51 50 #define EC_NOTCORE 0x0
52 51 #define EC_OLDCORE 0x1
53 52 #define EC_NEWCORE 0x2
54 53
55 54 /* elf file processing errors */
56 -#define ELF_ERR_ELFCAP1 gettext("%s: %s zero size or zero entry ELF " \
57 - "section - ELF capabilities ignored\n")
58 -#define ELF_ERR_ELFCAP2 gettext("%s: %s: can't read ELF capabilities " \
59 - "data - ELF capabilities ignored\n")
55 +#define ELF_ERR_ELFCAP1 gettext("%s: %s zero size or zero entry ELF " \
56 + "section - ELF capabilities ignored\n")
57 +#define ELF_ERR_ELFCAP2 gettext("%s: %s: can't read ELF capabilities " \
58 + "data - ELF capabilities ignored\n")
59 +#define ELF_ERR_DYNAMIC1 gettext("%s: %s zero size or zero entry ELF " \
60 + "section - ELF dynamic tags ignored\n")
61 +#define ELF_ERR_DYNAMIC2 gettext("%s: %s: can't read ELF dynamic " \
62 + "data - ELF dynamic tags ignored\n")
60 63
61 64 extern int is_in_list(char *str);
62 65
63 66 /* return status for elf_read and its helper functions */
64 67 #define ELF_READ_OKAY 1
65 68 #define ELF_READ_FAIL 0
66 69
67 70 #if defined(_ELF64)
68 71
69 72 #define Elf_Ehdr Elf64_Ehdr
70 73 #define Elf_Shdr Elf64_Shdr
71 74 #define Elf_Phdr Elf64_Phdr
72 75 #define Elf_Cap Elf64_Cap
73 76 #define Elf_Nhdr Elf64_Nhdr
74 77 #define Elf_Word Elf64_Word
78 +#define Elf_Dyn Elf64_Dyn
75 79
76 80 #define elf_read elf_read64
77 81 #define elf_xlatetom elf64_xlatetom
78 82 #define elf_fsize elf64_fsize
79 83 #define get_class get_class64
80 84 #define get_version get_version64
81 85 #define get_format get_format64
82 86
83 87 #else
84 88
85 89 #define Elf_Ehdr Elf32_Ehdr
86 90 #define Elf_Shdr Elf32_Shdr
87 91 #define Elf_Phdr Elf32_Phdr
88 92 #define Elf_Cap Elf32_Cap
89 93 #define Elf_Nhdr Elf32_Nhdr
90 94 #define Elf_Word Elf32_Word
95 +#define Elf_Dyn Elf32_Dyn
91 96
92 97 #define elf_read elf_read32
93 98 #define elf_xlatetom elf32_xlatetom
94 99 #define elf_fsize elf32_fsize
95 100 #define get_class get_class32
96 101 #define get_version get_version32
97 102 #define get_format get_format32
98 103
99 104 #endif
100 105
101 106 /* so lint can understand elf_read64 is defined */
102 107 #ifdef lint
103 108 #define elf_read64 elf_read
104 109 #endif /* lint */
105 110
106 111 #endif /* _ELF_READ_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX