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
|
'\" te
.\" Copyright (c) 2007, Sun Microsystems, 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 NLIST 3UCB "Oct 30, 2007"
.SH NAME
nlist \- get entries from symbol table
.SH SYNOPSIS
.LP
.nf
\fB/usr/ucb/cc\fR [ \fIflag\fR ... ] \fIfile\fR ...
#include <nlist.h>
\fBint\fR \fBnlist\fR(\fIfilename\fR, \fInl\fR)
\fBchar *\fR\fIfilename\fR;
\fBstruct nlist *\fR\fInl\fR;
.fi
.SH DESCRIPTION
.sp
.LP
\fBnlist()\fR examines the symbol table from the executable image whose name is
pointed to by \fIfilename\fR, and selectively extracts a list of values and
puts them in the array of \fBnlist\fR structures pointed to by \fInl\fR. The
name list pointed to by \fInl\fR consists of an array of structures containing
names, types and values. The \fBn_name\fR field of each such structure is taken
to be a pointer to a character string representing a symbol name. The list is
terminated by an entry with a \fINULL\fR pointer (or a pointer to a \fINULL\fR
string) in the \fBn_name\fR field. For each entry in \fInl\fR, if the named
symbol is present in the executable image's symbol table, its value and type
are placed in the \fBn_value\fR and \fBn_type\fR fields. If a symbol cannot be
located, the corresponding \fBn_type\fR field of \fInl\fR is set to zero.
.SH RETURN VALUES
.sp
.LP
Upon normal completion, \fBnlist()\fR returns the number of symbols that were
not located in the symbol table. If an error occurs, \fBnlist()\fR returns
\(mi1 and sets all of the \fBn_type\fR fields in members of the array pointed
to by \fInl\fR to zero.
.SH SEE ALSO
.sp
.LP
\fBnlist\fR(3ELF), \fBa.out\fR(4)
.SH NOTES
.sp
.LP
Use of these interfaces should be restricted to only applications written on
BSD platforms. Use of these interfaces with any of the system libraries or in
multi-thread applications is unsupported.
.sp
.LP
Only the \fBn_value\fR field is compatibly set. Other fields in the
\fBnlist\fR structure are filled with the ELF (Executable and Linking Format)
values (see \fBnlist\fR(3ELF) and \fBa.out\fR(4)).
|