xref: /freebsd/usr.bin/lorder/lorder.1 (revision 4d65a7c6951cea0333f1a0c1b32c38489cdfa6c5)
1.\" Copyright (c) 1990, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\" 3. Neither the name of the University nor the names of its contributors
13.\"    may be used to endorse or promote products derived from this software
14.\"    without specific prior written permission.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.Dd March 21, 2023
29.Dt LORDER 1
30.Os
31.Sh NAME
32.Nm lorder
33.Nd list dependencies for object files
34.Sh DEPRECATION NOTICE
35.Nm
36is obsolete and may not be present in
37.Fx 14
38and later.
39.Sh SYNOPSIS
40.Nm
41.Ar
42.Sh DESCRIPTION
43The
44.Nm
45utility uses
46.Xr nm 1
47to determine interdependencies in the list of object files
48and library archives
49specified on the command line.
50The
51.Nm
52utility outputs a list of file names where the first file contains a symbol
53which is defined by the second file.
54.Pp
55The output is normally used with
56.Xr tsort 1
57when a library is created to determine the optimum ordering of the
58object modules so that all references may be resolved in a single
59pass of the loader.
60.Pp
61When linking static binaries,
62.Nm
63and
64.Xr tsort 1
65can be used to properly order library archives automatically.
66.Pp
67The use of
68.Nm
69is not required by contemporary linkers, and
70.Nm
71may be removed from a future version of
72.Fx .
73.Sh ENVIRONMENT
74.Bl -tag -width indent
75.It Ev NM
76Path to the
77.Xr nm 1
78binary, defaults to
79.Dq Li nm .
80.It Ev NMFLAGS
81Flags to pass to
82.Xr nm 1 .
83.El
84.Sh EXAMPLES
85.Bd -literal -offset indent
86ar cr library.a `lorder ${OBJS} | tsort`
87cc -o foo ${OBJS} `lorder ${STATIC_LIBS} | tsort`
88.Ed
89.Sh SEE ALSO
90.Xr ar 1 ,
91.Xr ld 1 ,
92.Xr nm 1 ,
93.Xr ranlib 1 ,
94.Xr tsort 1
95.Sh HISTORY
96A
97.Nm
98utility appeared in
99.At v7 .
100