Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > L


HP-UX 11i Version 3: February 2007

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index


lorder — find ordering relation for an object library


lorder [files]


The input consists of one or more object or archive library files (see ar(1)) placed on the command line or read from standard input. The standard output is a list of pairs of object file names, meaning that the first file of the pair refers to external identifiers defined in the second. Output can be processed by tsort to find an ordering of a library suitable for one-pass access by ld (see tsort(1) and ld(1)). Note that the link editor ld is capable of multiple passes over an archive in the archive format and does not require that lorder be used when building an archive. Using the lorder command may, however, allow for a slightly more efficient access of the archive during the link edit process.

The symbol table maintained by ar allows ld to randomly access symbols and files in the archive, making the use of lorder unnecessary when building archive libraries (see ar(1)).


Environment Variables

The following internationalization variables affect the execution of lorder:


Determines the locale category for native language, local customs and coded character set in the absence of LC_ALL and other LC_* environment variables. If LANG is not specified or is set to the empty string, a default of C (see lang(5)) is used instead of LANG.


Determines the values for all locale categories and has precedence over LANG and other LC_* environment variables.


Determines the locale category for character collation.


Determines the locale category for character handling functions.


Determines the locale that should be used to affect the format and contents of diagnostic messages written to standard error.


Determines the locale category for numeric formatting.


Determines the location of message catalogues for the processing of LC_MESSAGES.

If any internationalization variable contains an invalid setting, lorder behaves as if all internationalization variables are set to C. See environ(5).

International Code Set Support

Single- and multi-byte character code sets are supported.


Build a new library from existing .o files:

ar cr library `lorder *.o | tsort`

When creating libraries with so many objects that the shell cannot properly handle the *.o expansion, the following technique may prove useful:

ls | grep '.o$' | lorder | tsort | xargs ar cq library


Object files whose names do not end with .o are overlooked, even when contained in library archives. Their global symbols and references are attributed to some other file.



temporary files



System Tools:


create archived libraries


invoke the link editor



produce an ordered list of items (topological sort)


lorder: SVID2, SVID3, XPG2, XPG4

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.