[devel] lorder

Alexey Tourbin =?iso-8859-1?q?at_=CE=C1_altlinux=2Eru?=
Вт Сен 13 20:09:33 MSD 2005


On Tue, Sep 13, 2005 at 06:37:45PM +0400, Dmitry V. Levin wrote:
> См. postfix-lorder.sh в postfix-*.src.rpm

Кстати, в старых юниксах есть такая штатная "бня".

$ find ~/v7 -name '*lorder*'
/home/at/v7/bin/lorder
/home/at/v7/usr/man/man1/lorder.1
$ file /home/at/v7/bin/lorder		-- СЮРПРЫЗ!!
/home/at/v7/bin/lorder: ASCII C++ program text
$ man /home/at/v7/bin/lorder |col -b
LORDER(1)                                                            LORDER(1)

NAME
       lorder - find ordering relation for an object library

SYNOPSIS
       lorder file ...

DESCRIPTION
       The  input  is one or more object or library archive (see ar(1)) files.
       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.  The output may be processed  by  tsort(1)  to  find  an
       ordering of a library suitable for one-pass access by ld(1).

       This  brash one-liner intends to build a new library from existing `.o'
       files.

              ar cr library `lorder *.o | tsort`

FILES
       *symref, *symdef
       nm(1), sed(1), sort(1), join(1)

SEE ALSO
       tsort(1), ld(1), ar(1)

BUGS
       The names of object files, in and out of libraries, must end with `.o';
       nonsense results otherwise.
$
----------- следующая часть -----------
trap "rm -f $$sym?ef; exit" 0 1 2 13 15
case $# in
0)	echo usage: lorder file ...
	exit ;;
1)	case $1 in
	*.o)	set $1 $1
	esac
esac
nm -g $* | sed '
	/^$/d
	/:$/{
		/\.o:/!d
		s/://
		h
		s/.*/& &/
		p
		d
	}
	/[TD] /{
		s/.* //
		G
		s/\n/ /
		w '$$symdef'
		d
	}
	s/.* //
	G
	s/\n/ /
	w '$$symref'
	d
'
sort $$symdef -o $$symdef
sort $$symref -o $$symref
join $$symref $$symdef | sed 's/[^ ]* *//'
----------- следующая часть -----------
Было удалено вложение не в текстовом формате...
Имя     : =?iso-8859-1?q?=CF=D4=D3=D5=D4=D3=D4=D7=D5=C5=D4?=
Тип     : application/pgp-signature
Размер  : 189 байтов
Описание: =?iso-8859-1?q?=CF=D4=D3=D5=D4=D3=D4=D7=D5=C5=D4?=
Url     : <http://lists.altlinux.org/pipermail/devel/attachments/20050913/c8403422/attachment-0001.bin>


Подробная информация о списке рассылки Devel