5 # Synopsis: Generate a list of the libraries in which a symbol is defined or
8 # Syntax: findsym.pl <directory_with_libraries_in_it> <symbol>
11 # Give first option a name.
12 my $Directory = $ARGV[0];
13 my $Symbol = $ARGV[1];
15 # Open the directory and read its contents, sorting by name and differentiating
16 # by whether its a library (.a) or an object file (.o)
17 opendir DIR,$Directory;
18 my @files = readdir DIR;
20 @objects = grep(/l?i?b?LLVM.*\.[oa]$/,sort(@files));
22 # Gather definitions from the libraries
23 foreach $lib (@objects) {
26 "nm $Directory/$lib | grep '$Symbol' | sort --key=3 | uniq |";
28 if (!$head) { print "$lib:\n"; $head = 1; }