3 # Copyright (C) 2012-2013 Red Hat, Inc.
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License, or (at your option) any later version.
10 # This library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library. If not, see
17 # <http://www.gnu.org/licenses/>.
19 die "syntax: $0 SYMFILE ELFLIB(S)" unless int(@ARGV) >= 2;
21 my $symfile = shift @ARGV;
29 open SYMFILE
, $symfile or die "cannot read $symfile: $!";
40 die "malformed line $_" unless /^\s*(\S+);$/;
42 if (exists $wantsyms{$1}) {
43 print STDERR
"Symbol $1 is listed twice\n";
51 foreach my $elflib (@elflibs) {
52 open NM
, "-|", "nm", $elflib or die "cannot run 'nm $elflib': $!";
55 next unless /^\S+\s(?:[TBD])\s(\S+)\s*$/;
63 foreach my $sym (keys(%wantsyms)) {
64 next if exists $gotsyms{$sym};
66 print STDERR
"Expected symbol $sym is not in ELF library\n";