lorder(1)

lorder1

List dependencies for object files

Usage

lorder file ...

Overview

The lorder utility uses nm(1) to determine interdependencies in the list of object files and library archives specified on the command line. The lorder utility outputs a list of file names where the first file contains a symbol which is defined by the second file.

The output is normally used with tsort(1) when a library is created to determine the optimum ordering of the object modules so that all references may be resolved in a single pass of the loader.

When linking static binaries, lorder and tsort(1) can be used to properly order library archives automatically.

Environment

NM

Path to the nm(1) binary, defaults to “nm”.

NMFLAGS

Flags to pass to nm(1).

Examples

ar cr library.a `lorder ${OBJS} | tsort`
cc -o foo ${OBJS} `lorder ${STATIC_LIBS} | tsort`

Releases

15 releases since Debian 1.1 (Buzz); the text changed 4 times.

  1. 1.1–1.3
  2. 2.0–5.0
  3. 6.0–8
  4. 9
  5. 10

History

A lorder utility appeared in Version 7 AT&T UNIX.

From bsdmainutils 11.1.2+b1 in Debian 10 (Buster). Parsed by carta from the page's mdoc source.