From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Sun, 13 Aug 2006 20:59:15 +0400 From: Alexey Tourbin To: ALT Devel discussion list Message-ID: <20060813165915.GQ24054@localhost.localdomain> Mail-Followup-To: ALT Devel discussion list References: <20060808024052.GA32293@mash.office.altlinux.ru> <20060808115026.GX27285@osdn.org.ua> <20060808123044.GB21964@basalt.office.altlinux.org> <20060808183618.GC16715@localhost.localdomain> <20060808220342.GD16715@localhost.localdomain> <20060808231659.GA11505@basalt.office.altlinux.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qXPE+6hUsFlDAc0e" Content-Disposition: inline In-Reply-To: <20060808231659.GA11505@basalt.office.altlinux.org> Subject: Re: [devel] rpmelfsymv X-BeenThere: devel@lists.altlinux.org X-Mailman-Version: 2.1.7 Precedence: list Reply-To: ALT Devel discussion list List-Id: ALT Devel discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Aug 2006 16:59:29 -0000 Archived-At: List-Archive: List-Post: --qXPE+6hUsFlDAc0e Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 09, 2006 at 03:16:59AM +0400, Dmitry V. Levin wrote: > 000012cc g DO .bss 00000004 (V1) foo > 00000248 g DF .text 00000005 V2 foo 1 2 3 4 5 6 7 =E7=C4=C5 =C2=D9 =D5=DA=CE=C1=D4=D8 =D0=D2=CF =C6=CF=D2=CD=C1=D4 =D7=D9=D7= =CF=C4=C1 objdump -Tw? binutils-*/bfd/elf.c =CE=C5 =D0=D2=C5=C4=CC=C1=C7=C1=D4=D8. 2 -- visibility 3 -- =DE=D4=CF =DC=D4=CF?? > =F4=C1=CB=C9=CD =CF=C2=D2=C1=DA=CF=CD, =CE=D5=D6=CE=CF =C9=D3=D0=CF=CC=D8= =DA=CF=D7=C1=D4=D8 objdump -wT =D7=CD=C5=D3=D4=CF nm -D. =F7=CF=D4 =D4=C1=CB =D7=D2=CF=C4=C5 =D2=C1=C2=CF=D4=C1=C5=D4. --- /home/at/cvs/qa/qa-robot/rpmelfsym 2006-05-27 11:15:29 +0000 +++ /home/at/cvs/qa/qa-robot/rpmelfsymv 2006-08-13 16:57:32 +0000 @@ -1,17 +1,39 @@ #!/bin/sh -ef export LC_ALL=3DC =20 -rpmelfsym() +rpmelfsymv() { rpmfile "$1" >files awk -F'\t' '$NF~/ELF.*(dynamic|shared)/{printf"./%s\0",$1}' files >elfs0 [ -s elfs0 ] || return 0 - rpmpeek "$1" xargs -r0 nm -Do nm.out - awk '{OFS=3D"\t";sub("^./","",$1);sub(":[0-9a-fA-F]*$","",$1);print}' nm.= out + rpmpeek "$1" xargs -r0 objdump -Tw objdump.out + perl -ln - objdump.out <<'__EOF__' +#!/usr/bin/perl=09 + if (/^$/ or /^DYNAMIC SYMBOL TABLE:$/) { next; } + if (s/:\s+file format.+//) { s[^./][]; $f =3D $_; next; } +BEGIN { $x =3D qr/([a-f0-9]+)/; $w =3D qr/(\w+)/; $S =3D qr/(\S+?)/; $s = =3D qr/[ ]+/; } +BEGIN { %T =3D qw(.text T .data D .bss B .rodata R .data.rel.ro D *ABS* A = *UND* U + .init T .fini T __libc_freeres_fn T __libc_thread_freeres_fn T + .interp R text.hot T text.unlikely T); } + if (/^$x$s(?:$w$s)?$w$s$S\t$x$s(?:[(]?$S[)]?$s)?(?:[.0]$w$s)?$S$/) { + $vis =3D $2; $typ =3D $4; $abi =3D $6; $sym =3D $8; + next if $vis eq "l"; + $t =3D $T{$typ} or die "$f: $sym: unknown type $typ\n"; + $vis eq "w" and $t eq "U" and $t =3D "w" or + $vis eq "w" and $t .=3D "W"; + $abi =3D "-" if $abi eq "" or $abi eq "Base"; + print "$f\t$t\t$sym\t$abi"; + next; + } + if (/^$x$s(?:$w$s)?$w$s$S\t$x$s$/) { + next; + } + die "bad objdump output:\n$_"; +__EOF__ } =20 . cmdcache "" -. rpmargs -c "cmdcache rpmelfsym" "$@" +. rpmargs -c "rpmelfsymv" "$@" =20 : <<'__EOF__' =20 --qXPE+6hUsFlDAc0e Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) iD8DBQFE31pjfBKgtDjnu0YRAlc3AKCS3kvwqs/wYjHggFa/alShFqr32wCfcwjX clwjBJr+PPQluvUEnIl/vuE= =sdKF -----END PGP SIGNATURE----- --qXPE+6hUsFlDAc0e--