Print this page
4023 - Typo in file(1) manpage and various others
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man1/elfwrap.1
+++ new/usr/src/man/man1/elfwrap.1
1 1 '\" te
2 2 .\" Copyright (c) 2008 by Sun Microsystems, Inc. All rights reserved.
3 3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 -.TH ELFWRAP 1 "Mar 17, 2008"
6 +.TH ELFWRAP 1 "Sep 10, 2013"
7 7 .SH NAME
8 8 elfwrap \- wrap data in an \fBELF\fR file
9 9 .SH SYNOPSIS
10 10 .LP
11 11 .nf
12 12 \fBelfwrap\fR [\fB-64\fR] [\fB-o\fR \fIrelobj-file\fR] [\fB-z\fR target=\fBsparc\fR | \fBx86\fR]
13 13 \fIdata-file\fR...
14 14 .fi
15 15
16 16 .SH DESCRIPTION
17 17 .sp
18 18 .LP
19 19 The \fBelfwrap\fR utility creates an \fBELF\fR relocatable object file from one
20 20 or more data files. The relocatable object encapsulates each data file within
21 21 an individual section, together with symbols that can be used to reference the
22 22 section. The relocatable object is appropriate for inclusion with a subsequent
23 23 link-edit. Users can reference the encapsulated data using the associated
24 24 symbols.
25 25 .sp
26 26 .LP
27 27 By default, a 32-bit \fBELF\fR relocatable object is created that is
28 28 appropriate for the machine on which \fBelfwrap\fR is executed. The \fB-64\fR
29 29 option can be used to create a 64-bit \fBELF\fR relocatable object. The \fB-z
30 30 target\fR option can be used to create a relocatable object for a specific
31 31 machine type.
32 32 .LP
33 33 Note -
34 34 .sp
35 35 .RS 2
36 36 Any data encapsulated with \fBelfwrap\fR must be in a format appropriate for
37 37 the destination target.
38 38 .RE
39 39 .sp
40 40 .LP
41 41 By default, the relocatable object \fBa.wrap.o\fR is created. The \fB-o\fR
42 42 option can be used to specify an alternative relocatable object name.
43 43 .sp
44 44 .LP
45 45 The \fBbasename\fR(1) of each data file is used to create various pieces of
46 46 \fBELF\fR information. For example, if the input data file is
47 47 \fBISV/isv-data\fR, the following \fBELF\fR information is created within the
48 48 relocatable object.
49 49 .sp
50 50 .ne 2
51 51 .na
52 52 \fBAn \fBELF\fR section named \fB\&.isv-data\fR\fR
53 53 .ad
54 54 .sp .6
55 55 .RS 4n
56 56 This section contains the entire contents of the input data file.
57 57 .RE
58 58
59 59 .sp
60 60 .ne 2
61 61 .na
62 62 \fBAn \fBELF\fR symbol named \fBisv-data_start\fR\fR
63 63 .ad
64 64 .sp .6
65 65 .RS 4n
66 66 This symbol reflects the starting address of the \fB\&.isv-data\fR section.
67 67 .RE
68 68
69 69 .sp
70 70 .ne 2
71 71 .na
72 72 \fBAn \fBELF\fR symbol named \fBisv-data_end\fR\fR
73 73 .ad
74 74 .sp .6
75 75 .RS 4n
76 76 This symbol reflects the address of the first location after the
77 77 \fB\&.isv-data\fR section.
78 78 .RE
79 79
80 80 .SH OPTIONS
81 81 .sp
82 82 .LP
83 83 The following options are supported:
84 84 .sp
85 85 .ne 2
86 86 .na
87 87 \fB\fB-64\fR\fR
88 88 .ad
89 89 .sp .6
90 90 .RS 4n
91 91 Create a 64-bit \fBELF\fR relocatable object.
92 92 .RE
93 93
94 94 .sp
95 95 .ne 2
96 96 .na
97 97 \fB\fB-o\fR \fIrelobj-file\fR\fR
98 98 .ad
99 99 .sp .6
100 100 .RS 4n
101 101 Produce a relocatable object that is named \fIrelobj-file\fR.
102 102 .RE
103 103
104 104 .sp
105 105 .ne 2
106 106 .na
107 107 \fB\fB-z\fR target=\fBsparc\fR | \fBx86\fR\fR
108 108 .ad
109 109 .sp .6
110 110 .RS 4n
111 111 Specifies the machine type for the output relocatable object. Supported targets
112 112 are \fBsparc\fR and \fBx86\fR. The 32-bit machine type for the specified target
113 113 is used unless the \fB-64\fR option is also present, in which case the
114 114 corresponding 64-bit machine type is used. By default, the relocatable object
115 115 that is generated is 32-bit for the machine one which \fBelfwrap\fR is
116 116 executed.
117 117 .RE
118 118
119 119 .SH EXAMPLES
120 120 .sp
121 121 .LP
122 122 The following example encapsulates the system \fBpasswd\fR file and the system
123 123 \fBgroup\fR file within a relocatable object \fBpassgroup.o\fR.
124 124 .sp
125 125 .in +2
126 126 .nf
127 127 example% \fBelfwrap -o passgroup.o /etc/passwd /etc/group\fR
128 128 example% \fBelfdump -s passgroup.o | egrep "passwd|group"\fR
129 129 [2] 0x00000000 0x00000000 SECT LOCL D 0 .passwd
130 130 [3] 0x00000000 0x00000000 SECT LOCL D 0 .group
131 131 [7] 0x00000000 0x000002f0 OBJT GLOB D 0 .passwd passwd_start
132 132 [8] 0x000002f0 0x00000000 OBJT GLOB D 0 .passwd passwd_end
133 133 [9] 0x00000000 0x00000121 OBJT GLOB D 0 .group group_start
134 134 [10] 0x00000121 0x00000000 OBJT GLOB D 0 .group group_end
135 135 example% \fBstrings -N.passwd passgroup.o | head -1\fR
136 136 root:x:0:0:Super-User:/:/sbin/sh
137 137 example% \fBstrings -N.group passgroup.o | head -1\fR
138 138 root::0:
139 139 .fi
140 140 .in -2
141 141 .sp
142 142
143 143 .sp
144 144 .LP
145 145 This relocatable object can be referenced from the following user code.
146 146 .sp
147 147 .in +2
148 148 .nf
149 149 example% \fBcat main.c\fR
↓ open down ↓ |
133 lines elided |
↑ open up ↑ |
150 150 #include <stdio.h>
151 151
152 152 extern char passwd_start, passwd_end;
153 153
154 154 void main()
155 155 {
156 156 char *pstart = &passwd_start, *pend = &passwd_end;
157 157 char *str, *lstr;
158 158
159 159 for (lstr = str = pstart; str < pend; str++) {
160 - if ((*str == '\n') && (str != (pend - 1))) {
160 + if ((*str == '\en') && (str != (pend - 1))) {
161 161 (void) printf("%.*s", (++str - lstr), lstr);
162 162 lstr = str;
163 163 }
164 164 }
165 165 }
166 166 example% \fBcc -o main main.c passgroup.o\fR
167 167 example% \fB\&./main\fR
168 168 root:x:0:0:Super-User:/:/sbin/sh
169 169 \&....
170 170 nobody4:x:65534:65534:SunOS 4.x NFS Anonymous Access User:/:
171 171 .fi
172 172 .in -2
173 173 .sp
174 174
175 175 .SH FILES
176 176 .sp
177 177 .ne 2
178 178 .na
179 179 \fB\fBa.wrap.o\fR\fR
180 180 .ad
181 181 .RS 12n
182 182 The default relocatable object file created.
183 183 .RE
184 184
185 185 .SH ATTRIBUTES
186 186 .sp
187 187 .LP
188 188 See \fBattributes\fR(5) for descriptions of the following attributes:
189 189 .sp
190 190
191 191 .sp
192 192 .TS
193 193 box;
194 194 c | c
195 195 l | l .
196 196 ATTRIBUTE TYPE ATTRIBUTE VALUE
197 197 _
198 198 Interface Stability Committed
199 199 .TE
200 200
201 201 .SH SEE ALSO
202 202 .sp
203 203 .LP
204 204 \fBelfdump\fR(1), \fBld\fR(1), \fBstrings\fR(1), \fBelf\fR(3ELF),
205 205 \fBattributes\fR(5), \fBddi_modopen\fR(9F)
206 206 .sp
207 207 .LP
208 208 \fILinker and Libraries Guide\fR
↓ open down ↓ |
38 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX