3 # This script takes rpm package files, finds *.so.N files in them,
4 # and runs objdump --dynamic-syms on them. The arguments are rpm file
5 # names. For each rpm, it creates an output file with the name
6 # "NAME-VERSION-RELEASE.ARCH.dynsym", the variable parts being extracted
7 # from the rpm's headers (not its file name). Each file contains the
8 # collected objdump output for all the *.so.N files in the corresponding rpm.
9 # This can be processed with abilist.awk or sent to someone who will do that.
10 # This does not do a lot of error-checking, so you should always watch stderr
11 # and sanity-check the resulting output files.
14 RPM2CPIO
=${RPM2CPIO:-rpm2cpio}
16 OBJDUMP
=${OBJDUMP:-objdump}
18 unpackdir
=/tmp
/rpm2dynsym$$
19 trap 'rm -rf $unpackdir' 0 1 2 15
22 name
=`$RPM -qp $rpm --queryformat '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n'`
23 mkdir
$unpackdir ||
exit
26 $CPIO -i -d --no-absolute-filenames -uv '*.so.*' '*.so' 2>&1 |
28 test x
"$b" = x ||
break
30 *.so.
[0-9]*) $OBJDUMP --dynamic-syms $file ;;
34 echo wrote
$name.dynsym
for $rpm