update copyright date
[unix-history] / usr / src / usr.bin / lorder / lorder.sh
CommitLineData
2a50b0b4
KB
1#!/bin/sh -
2#
3# Copyright (c) 1988 Regents of the University of California.
4# All rights reserved. The Berkeley software License Agreement
5# specifies the terms and conditions for redistribution.
6#
7# @(#)lorder.sh 5.1 (Berkeley) %G%
8#
9
10trap "rm -f $$sym?ef; exit" 0 1 2 13 15
11case $# in
120) echo usage: lorder file ...
13 exit ;;
141) case $1 in
15 *.o) set $1 $1
16 esac
17esac
18nm -g $* | sed '
19 /^$/d
20 /:$/{
21 /\.o:/!d
22 s/://
23 h
24 s/.*/& &/
25 p
26 d
27 }
28 /[TD] /{
29 s/.* //
30 G
31 s/\n/ /
32 w '$$symdef'
33 d
34 }
35 s/.* //
36 G
37 s/\n/ /
38 w '$$symref'
39 d
40'
41sort $$symdef -o $$symdef
42sort $$symref -o $$symref
43join $$symref $$symdef | sed 's/[^ ]* *//'