summaryrefslogtreecommitdiffstats
path: root/src/util/symcheck.pl
diff options
context:
space:
mode:
authorMichael Brown2007-07-17 02:39:06 +0200
committerMichael Brown2007-07-17 02:39:06 +0200
commit19904804da505ab8896fc0179aec3452dc9a88b5 (patch)
tree3074091ba9288b21761e75fdb91e5c78b4724b6d /src/util/symcheck.pl
parentAdded symbols that the DBG() macros will use. (diff)
downloadipxe-19904804da505ab8896fc0179aec3452dc9a88b5.tar.gz
ipxe-19904804da505ab8896fc0179aec3452dc9a88b5.tar.xz
ipxe-19904804da505ab8896fc0179aec3452dc9a88b5.zip
Restore the "shared symbol found only in a single object should be
treated as being provided by that object" code.
Diffstat (limited to 'src/util/symcheck.pl')
-rwxr-xr-xsrc/util/symcheck.pl11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/util/symcheck.pl b/src/util/symcheck.pl
index e0099c41..8925ca62 100755
--- a/src/util/symcheck.pl
+++ b/src/util/symcheck.pl
@@ -97,7 +97,7 @@ while ( ( my $object, my $symbols ) = each %$symtab ) {
} else {
$category = "provides";
}
- $globals->{$symbol}->{$category}->{$object} = $info->{section};
+ $globals->{$symbol}->{$category}->{$object} = 1;
}
}
}
@@ -110,6 +110,13 @@ while ( ( my $symbol, my $info ) = each %$globals ) {
my @requires = keys %{$info->{requires}};
my @shares = keys %{$info->{shares}};
+ if ( ( @provides == 0 ) && ( @shares == 1 ) ) {
+ # A symbol "shared" by just a single file is actually being
+ # provided by that file; it just doesn't have an initialiser.
+ @provides = @shares;
+ @shares = ();
+ }
+
if ( ( @requires > 0 ) && ( @provides == 0 ) && ( @shares == 0 ) ) {
# No object provides this symbol, but some objects require it.
$problems->{$_}->{nonexistent}->{$symbol} = 1 foreach @requires;
@@ -120,7 +127,7 @@ while ( ( my $symbol, my $info ) = each %$globals ) {
foreach my $provide ( @provides ) {
if ( $provide eq "LINKER" ) {
# Linker-provided symbols are exempt from this check.
- } elsif ( $info->{provides}->{$provide} =~ /^\.tbl\./ ) {
+ } elsif ( $symtab->{$provide}->{$symbol}->{section} =~ /^\.tbl\./ ) {
# Linker tables are exempt from this check.
} else {
$problems->{$provide}->{unused}->{$symbol} = 1;