1pvs(1)                           User Commands                          pvs(1)
2
3
4

NAME

6       pvs - display the internal version information of dynamic objects
7

SYNOPSIS

9       pvs [-Cdlnorsv] [-I index-expr] [-N name] file...
10
11

DESCRIPTION

13       The  pvs  utility  displays  any internal version information contained
14       within an ELF file. Commonly, these files are dynamic  executables  and
15       shared objects, and possibly relocatable objects. This version informa‐
16       tion can fall into one of two categories:
17
18           o      version definitions
19
20           o      version dependencies
21
22
23       Version definitions describe the interfaces that are made available  by
24       an  ELF  file. Each version definition is associated to a set of global
25       symbols provided by the file.  Version definitions can be assigned to a
26       file during its creation by the link-editor using the -M option and the
27       associated mapfile directives. See the Linker and Libraries  Guide  for
28       more details.
29
30
31       Version  dependencies  describe  the  binding  requirements  of dynamic
32       objects on the version definitions of any shared  object  dependencies.
33       When  a  dynamic  object is built with a shared object, the link-editor
34       records information within  the  dynamic  object  indicating  that  the
35       shared  object  is  a  dependency. This dependency must be satisfied at
36       runtime.  If the shared object also contains version definitions,  then
37       those  version  definitions that satisfy the global symbol requirements
38       of the dynamic object are also recorded in  the  dynamic  object  being
39       created. At process initialization, the runtime linker uses any version
40       dependencies as a means of validating the interface requirements of the
41       dynamic objects used to construct the process.
42

OPTIONS

44       The  following  options  are supported. If neither the -d or -r options
45       are specified, both are enabled.
46
47       -C                Demangles C++ symbol names.
48
49
50       -d                Prints version definition information.
51
52
53       -I  index-expr    Qualifies the versions to  examine  with  a  specific
54                         version  index  or index range. For example, the ver‐
55                         sion with index 3  in  an  object  can  be  displayed
56                         using:
57
58                           example% pvs -I 3 filename
59
60
61                         An  index-expr  can  be a single non-negative integer
62                         value that specifies a specific version, as shown  in
63                         the  previous  example.  Alternatively, an index-expr
64                         can consist of two such values separated by  a  colon
65                         (:),  indicating  a  range of versions. The following
66                         example displays the versions 3, 4, and 5 in a file:
67
68                           example% pvs -I 3:5 filename
69
70
71                         When specifying an index range, the second value  can
72                         be  omitted  to  indicate the final item in the file.
73                         For example, the following statement lists  all  ver‐
74                         sions from the tenth to the end:
75
76                           example% pvs -I 10: filename
77
78
79                         See Matching Options for additional information about
80                         the matching options (-I, -N).
81
82
83       -l                Prints any symbols that have been reduced from global
84                         to  local  binding  due to versioning. By convention,
85                         these symbol entries are located in the .symtab  sec‐
86                         tion,  and  fall between the FILE symbol representing
87                         the output file, and the FILE symbol representing the
88                         first  input  file  used to generate the output file.
89                         These reduced symbol entries are assigned the  fabri‐
90                         cated  version definition _LOCAL_. No reduced symbols
91                         will be printed if the file has  been  stripped  (see
92                         strip(1)),  or  if the symbol entry convention cannot
93                         be determined.
94
95                         Use of the -l option implicitly enables the -s option
96
97
98       -n                Normalizes   version   definition   information.   By
99                         default,  all  version  definitions within the object
100                         are  displayed.  However,  version  definitions   can
101                         inherit  other  version definitions. Under normaliza‐
102                         tion, only the head of each inheritance list is  dis‐
103                         played.
104
105
106       -N name           When  used  with  the  -d  option, -N prints only the
107                         information for the given version definition name and
108                         any of its inherited version definitions.
109
110                         When  used  with  the  -r  option, -N prints only the
111                         information for the given dependency file name. It is
112                         possible  to  qualify  a  specific  version  from the
113                         dependency file by including the version in parenthe‐
114                         sis following the file name:
115
116                           example% pvs -N 'dependency (version)' filename
117
118
119                         See Matching Options for additional information about
120                         the matching options (-I, -N).
121
122
123       -o                Creates  one-line  version  definition   output.   By
124                         default,  file,  version  definitions, and any symbol
125                         output is indented to  ease  human  inspection.  This
126                         option  prefixes  each  output line with the file and
127                         version definition name and can be  more  useful  for
128                         analysis with automated  tools.
129
130
131       -r                Prints version dependency (requirements) information.
132
133
134       -s                Prints the symbols associated with each version defi‐
135                         nition. Any data symbols from versions defined by the
136                         object  are  accompanied  with the size, in bytes, of
137                         the data item.
138
139
140       -v                Verbose output. Indicates any  weak  version  defini‐
141                         tions,  and  any version definition inheritance. When
142                         used with the -N and -d options, the  inheritance  of
143                         the  base version definition is also shown. When used
144                         with the -s option, the version symbol definition  is
145                         also shown.
146
147

OPERANDS

149       The following operands are supported.
150
151       file    The   ELF file about which internal version information is dis‐
152               played.
153
154

USAGE

156   Matching Options
157       The -I and -N options are collectively  referred  to  as  the  matching
158       options.  These  options  are  used  to narrow the range of versions to
159       examine, by index or by name.
160
161
162       Any number and type of matching option can be mixed in a given  invoca‐
163       tion  of  pvs.  In this case, pvs displays the superset of all versions
164       matched by any of the matching options used. This  feature  allows  for
165       the  selection  of complex groupings of items using the most convenient
166       form for specifying each item.
167

EXAMPLES

169       Example 1 Displaying version definitions
170
171
172       The following example displays the version definitions of libelf.so.1:
173
174
175         % pvs -d /lib/libelf.so.1
176              libelf.so.1;
177              SUNW_1.1
178
179
180
181       Example 2 Creating a one-liner display
182
183
184       A normalized, one-liner display, suitable for creating a  mapfile  ver‐
185       sion control directive, can be created using the -n and -o options:
186
187
188         % pvs -don /lib/libelf.so.1
189         /lib/libelf.so.1 -  SUNW_1.1;
190
191
192
193       Example 3 Displaying version requirements
194
195
196       The following example displays the version requirements of ldd and pvs:
197
198
199         % pvs -r /usr/bin/ldd /usr/bin/pvs
200         /usr/bin/ldd:
201              libelf.so.1 (SUNW_1.1);
202              libc.so.1 (SUNW_1.1);
203         /usr/bin/pvs:
204              libelf.so.1 (SUNW_1.1);
205              libc.so.1 (SUNW_1.1);
206
207
208
209       Example 4 Determining a dependency symbol version
210
211
212       The  following  example  displays  the shared object from which the ldd
213       command expects to find the printf function at runtime, as well as  the
214       version it belongs to:
215
216
217         % pvs -ors /usr/bin/ldd | grep ' printf'
218         /usr/bin/ldd -  libc.so.1 (SYSVABI_1.3): printf;
219
220
221
222       Example 5 Determine all dependency symbols from a specific version
223
224
225       The  -N  option  can be used to obtain a list of all the symbols from a
226       dependency that belong to a specific version. To determine the  symbols
227       that ldd will find from version SYSVABI_1.3 of libc.so.1:
228
229
230         % pvs -s -N 'libc.so.1 (SYSVABI_1.3)' /usr/bin/ldd
231
232                libc.so.1 (SYSVABI_1.3):
233                        _exit;
234                        strstr;
235                        printf;
236                        __fpstart;
237                        strncmp;
238                        lseek;
239                        strcmp;
240                        getopt;
241                        execl;
242                        close;
243                        fflush;
244                        wait;
245                        strerror;
246                        putenv;
247                        sprintf;
248                        getenv;
249                        open;
250                        perror;
251                        fork;
252                        strlen;
253                        geteuid;
254                        access;
255                        setlocale;
256                        atexit;
257                        fprintf;
258                        exit;
259                        read;
260                        malloc;
261
262
263
264
265       Note  that  the specific list of symbols used by ldd may change between
266       Solaris releases.
267
268
269       Example 6 Display base defined version by index
270
271
272       By convention, the base global version defined by  an  object  has  the
273       name  of  the  object.  For  example,  the base version of pvs is named
274       'pvs'. The base version of any object is always version index 1. There‐
275       fore,  the  -I  option  can  be used to display the base version of any
276       object without having to specify its name:
277
278
279         % pvs -v -I 1 /usr/bin/pvs
280                pvs [BASE];
281
282
283

EXIT STATUS

285       If the requested version information is not found, a non-zero value  is
286       returned. Otherwise, a 0 value is returned.
287
288
289       Version  information  is determined not found when any of the following
290       is true:
291
292           o      the -d option is specified and no  version  definitions  are
293                  found.
294
295           o      the  -r  option is specified and no version requirements are
296                  found.
297
298           o      neither the -d nor -r option is  specified  and  no  version
299                  definitions or version requirements are found.
300

ATTRIBUTES

302       See attributes(5) for descriptions of the following attributes:
303
304
305
306
307       ┌─────────────────────────────┬─────────────────────────────┐
308       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
309       ├─────────────────────────────┼─────────────────────────────┤
310       │Availability                 │SUNWtoo                      │
311       └─────────────────────────────┴─────────────────────────────┘
312

SEE ALSO

314       elfdump(1), ld(1), ldd(1), strip(1), elf(3ELF), attributes(5)
315
316
317       Linker and Libraries Guide
318
319
320
321SunOS 5.11                        25 Sep 2008                           pvs(1)
Impressum