#!/usr/bin/perl
# Copyright (c) 2003, Pavel Roskin
# The Midnight Commander is free software: you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 3 of the License,
# or (at your option) any later version.
#
# The Midnight Commander is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
# Run this script on the map with cross-reference generated by GNU ld,
# and it will generate a list of symbols that don't need to be global.
# To create the map, run something like this:
# make LDFLAGS=-Wl,-Map,output.map,--cref
use strict;
my %symbols;
my %syms;
my %objs;
if ($#ARGV != 0) {
print "Usage: unrefglobals.pl mapfile\n";
exit 1;
}
if (!open (MAP, "$ARGV[0]")) {
print "Cannot open file \"$ARGV[0]\"\n";
exit 1;
}
my $line;
my $next_line =