summaryrefslogtreecommitdiff
path: root/usr/src/man/man1/pvs.1
blob: b6ea0d52d80209ce5b0fd66047ed5dd04914f343 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
'\" te
.\"  Copyright (c) 2008, Sun Microsystems, Inc.
.\" Copyright 2019 Joyent, Inc.
.\"  All Rights Reserved
.\" 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.
.\" 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.
.\" 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]
.TH PVS 1 "Dec 19, 2018"
.SH NAME
pvs \- display the internal version information of dynamic objects
.SH SYNOPSIS
.LP
.nf
\fBpvs\fR [\fB-Cdlnorsv\fR] [\fB-I\fR \fIindex-expr\fR] [\fB-N\fR \fIname\fR] \fIfile\fR...
.fi

.SH DESCRIPTION
.LP
The \fBpvs\fR utility displays any internal version information contained
within an \fBELF\fR file. Commonly, these files are dynamic executables and
shared objects, and possibly relocatable objects. This version information can
fall into one of two categories:
.RS +4
.TP
.ie t \(bu
.el o
version definitions
.RE
.RS +4
.TP
.ie t \(bu
.el o
version dependencies
.RE
.sp
.LP
Version \fIdefinitions\fR describe the interfaces that are made available by an
\fBELF\fR file. Each version definition is associated to a set of global
symbols provided by the file.  Version definitions can be assigned to a file
during its creation by the link-editor using the \fB-M\fR option and the
associated \fImapfile\fR directives. See the \fILinker and Libraries Guide\fR
for more details.
.sp
.LP
Version \fIdependencies\fR describe the binding requirements of dynamic objects
on the version definitions of any shared object dependencies. When a dynamic
object is built with a shared object, the link-editor records information
within the dynamic object indicating that the shared object is a dependency.
This dependency must be satisfied at runtime.  If the shared object also
contains version \fIdefinitions\fR, then those version definitions that satisfy
the global symbol requirements of the dynamic object are also recorded in the
dynamic object being created. At process initialization, the runtime linker
uses any version \fIdependencies\fR as a means of validating the interface
requirements of the dynamic objects used to construct the process.
.SH OPTIONS
.LP
The following options are supported. If neither the \fB-d\fR or \fB-r\fR
options are specified, both are enabled.
.sp
.ne 2
.na
\fB\fB-C\fR\fR
.ad
.RS 18n
Demangles symbol names.
.RE

.sp
.ne 2
.na
\fB\fB-d\fR\fR
.ad
.RS 18n
Prints version definition information.
.RE

.sp
.ne 2
.na
\fB\fB-I\fR  \fIindex-expr\fR\fR
.ad
.RS 18n
Qualifies the versions to examine with a specific version index or index range.
For example, the version with index 3 in an object can be displayed using:
.sp
.in +2
.nf
example% \fBpvs -I 3 \fIfilename\fR\fR
.fi
.in -2
.sp

An \fIindex-expr\fR can be a single non-negative integer value that specifies a
specific version, as shown in the previous example. Alternatively, an
\fIindex-expr\fR can consist of two such values separated by a colon (:),
indicating a range of versions. The following example displays the versions 3,
4, and 5 in a file:
.sp
.in +2
.nf
example% \fBpvs -I 3:5 \fIfilename\fR\fR
.fi
.in -2
.sp

When specifying an index range, the second value can be omitted to indicate the
final item in the file. For example, the following statement lists all versions
from the tenth to the end:
.sp
.in +2
.nf
example% \fBpvs -I 10: \fIfilename\fR\fR
.fi
.in -2
.sp

See Matching Options for additional information about the matching options
(\fB-I\fR, \fB-N\fR).
.RE

.sp
.ne 2
.na
\fB\fB-l\fR\fR
.ad
.RS 18n
Prints any symbols that have been reduced from global to local binding due to
versioning. By convention, these symbol entries are located in the
\fI\&.symtab\fR section, and fall between the \fIFILE\fR symbol representing
the output file, and the \fIFILE\fR symbol representing the first input file
used to generate the output file.  These reduced symbol entries are assigned
the fabricated version definition \fB_LOCAL_\fR. No reduced symbols will be
printed if the file has been stripped (see \fBstrip\fR(1)), or if the symbol
entry convention cannot be determined.
.sp
Use of the \fB-l\fR option implicitly enables the \fB-s\fR option
.RE

.sp
.ne 2
.na
\fB\fB-n\fR\fR
.ad
.RS 18n
Normalizes version definition information. By default, all version definitions
within the object are displayed. However, version definitions can inherit other
version definitions. Under normalization, only the head of each inheritance
list is displayed.
.RE

.sp
.ne 2
.na
\fB\fB-N\fR \fIname\fR\fR
.ad
.RS 18n
When used with the \fB-d\fR option, \fB-N\fR prints only the information for
the given version definition \fIname\fR and any of its inherited version
definitions.
.sp
When used with the \fB-r\fR option, \fB-N\fR prints only the information for
the given dependency file \fIname\fR. It is possible to qualify a specific
version from the dependency file by including the version in parenthesis
following the file name:
.sp
.in +2
.nf
example% \fBpvs -N 'dependency (version)' \fIfilename\fR\fR
.fi
.in -2
.sp

See Matching Options for additional information about the matching options
(\fB-I\fR, \fB-N\fR).
.RE

.sp
.ne 2
.na
\fB\fB-o\fR\fR
.ad
.RS 18n
Creates one-line version definition output. By default, file, version
definitions, and any symbol output is indented to ease human inspection. This
option prefixes each output line with the file and version definition name and
can be more useful for analysis with automated  tools.
.RE

.sp
.ne 2
.na
\fB\fB-r\fR\fR
.ad
.RS 18n
Prints version dependency (requirements) information.
.RE

.sp
.ne 2
.na
\fB\fB-s\fR\fR
.ad
.RS 18n
Prints the symbols associated with each version definition. Any data symbols
from versions defined by the object are accompanied with the size, in bytes, of
the data item.
.RE

.sp
.ne 2
.na
\fB\fB-v\fR\fR
.ad
.RS 18n
Verbose output. Indicates any weak version definitions, and any version
definition inheritance. When used with the \fB-N\fR and \fB-d\fR options, the
inheritance of the base version definition is also shown. When used with the
\fB-s\fR option, the version symbol definition is also shown.
.RE

.SH OPERANDS
.LP
The following operands are supported.
.sp
.ne 2
.na
\fB\fIfile\fR\fR
.ad
.RS 8n
The  \fBELF\fR file about which internal version information is displayed.
.RE

.SH USAGE
.SS "Matching Options"
.LP
The \fB-I\fR and \fB-N\fR options are collectively referred to as the
\fBmatching options\fR. These options are used to narrow the range of versions
to examine, by index or by name.
.sp
.LP
Any number and type of matching option can be mixed in a given invocation of
\fBpvs\fR. In this case, \fBpvs\fR displays the superset of all versions
matched by any of the matching options used. This feature allows for the
selection of complex groupings of items using the most convenient form for
specifying each item.
.SH EXAMPLES
.LP
\fBExample 1 \fRDisplaying version definitions
.sp
.LP
The following example displays the version definitions of \fBlibelf.so.1\fR:

.sp
.in +2
.nf
% \fBpvs -d /lib/libelf.so.1\fR
	libelf.so.1;
	SUNW_1.1
.fi
.in -2
.sp

.LP
\fBExample 2 \fRCreating a one-liner display
.sp
.LP
A normalized, one-liner display, suitable for creating a \fImapfile\fR version
control directive, can be created using the \fB-n\fR and \fB-o\fR options:

.sp
.in +2
.nf
% \fBpvs -don /lib/libelf.so.1\fR
/lib/libelf.so.1 -	SUNW_1.1;
.fi
.in -2
.sp

.LP
\fBExample 3 \fRDisplaying version requirements
.sp
.LP
The following example displays the version requirements of \fBldd\fR and
\fBpvs\fR:

.sp
.in +2
.nf
% \fBpvs -r /usr/bin/ldd /usr/bin/pvs\fR
/usr/bin/ldd:
	libelf.so.1 (SUNW_1.1);
	libc.so.1 (SUNW_1.1);
/usr/bin/pvs:
	libelf.so.1 (SUNW_1.1);
	libc.so.1 (SUNW_1.1);
.fi
.in -2
.sp

.LP
\fBExample 4 \fRDetermining a dependency symbol version
.sp
.LP
The following example displays the shared object from which the \fBldd\fR
command expects to find the printf function at runtime, as well as the version
it belongs to:

.sp
.in +2
.nf
% \fBpvs -ors /usr/bin/ldd | grep ' printf'\fR
/usr/bin/ldd -  libc.so.1 (SYSVABI_1.3): printf;
.fi
.in -2
.sp

.LP
\fBExample 5 \fRDetermine all dependency symbols from a specific version
.sp
.LP
The \fB-N\fR option can be used to obtain a list of all the symbols from a
dependency that belong to a specific version. To determine the symbols that
\fBldd\fR will find from version \fBSYSVABI_1.3\fR of \fBlibc.so.1\fR:

.sp
.in +2
.nf
% \fBpvs -s -N 'libc.so.1 (SYSVABI_1.3)' /usr/bin/ldd\fR

       libc.so.1 (SYSVABI_1.3):
               _exit;
               strstr;
               printf;
               __fpstart;
               strncmp;
               lseek;
               strcmp;
               getopt;
               execl;
               close;
               fflush;
               wait;
               strerror;
               putenv;
               sprintf;
               getenv;
               open;
               perror;
               fork;
               strlen;
               geteuid;
               access;
               setlocale;
               atexit;
               fprintf;
               exit;
               read;
               malloc;
.fi
.in -2
.sp

.sp
.LP
Note that the specific list of symbols used by \fBldd\fR may change between
Solaris releases.

.LP
\fBExample 6 \fRDisplay base defined version by index
.sp
.LP
By convention, the base global version defined by an object has the name of the
object. For example, the base version of \fBpvs\fR is named \fB\&'pvs'\fR. The
base version of any object is always version index 1. Therefore, the \fB-I\fR
option can be used to display the base version of any object without having to
specify its name:

.sp
.in +2
.nf
% \fBpvs -v -I 1 /usr/bin/pvs\fR
       pvs [BASE];
.fi
.in -2
.sp

.SH EXIT STATUS
.LP
If the requested version information is not found, a non-zero value is
returned. Otherwise, a \fB0\fR value is returned.
.sp
.LP
Version information is determined not found when any of the following is true:
.RS +4
.TP
.ie t \(bu
.el o
the \fB-d\fR option is specified and no version definitions are found.
.RE
.RS +4
.TP
.ie t \(bu
.el o
the \fB-r\fR option is specified and no version requirements are found.
.RE
.RS +4
.TP
.ie t \(bu
.el o
neither the \fB-d\fR nor \fB-r\fR option is specified and no version
definitions or version requirements are found.
.RE
.SH SEE ALSO
.LP
\fBelfdump\fR(1), \fBld\fR(1), \fBldd\fR(1), \fBstrip\fR(1), \fBelf\fR(3ELF),
\fBattributes\fR(5)
.sp
.LP
\fILinker and Libraries Guide\fR