Browse Source

Restore the "shared symbol found only in a single object should be

treated as being provided by that object" code.
tags/v0.9.3
Michael Brown 17 years ago
parent
commit
19904804da
1 changed files with 9 additions and 2 deletions
  1. 9
    2
      src/util/symcheck.pl

+ 9
- 2
src/util/symcheck.pl View File

97
       } else {
97
       } else {
98
 	$category = "provides";
98
 	$category = "provides";
99
       }
99
       }
100
-      $globals->{$symbol}->{$category}->{$object} = $info->{section};
100
+      $globals->{$symbol}->{$category}->{$object} = 1;
101
     }
101
     }
102
   }
102
   }
103
 }
103
 }
110
   my @requires = keys %{$info->{requires}};
110
   my @requires = keys %{$info->{requires}};
111
   my @shares = keys %{$info->{shares}};
111
   my @shares = keys %{$info->{shares}};
112
 
112
 
113
+  if ( ( @provides == 0 ) && ( @shares == 1 ) ) {
114
+    # A symbol "shared" by just a single file is actually being
115
+    # provided by that file; it just doesn't have an initialiser.
116
+    @provides = @shares;
117
+    @shares = ();
118
+  }
119
+
113
   if ( ( @requires > 0 ) && ( @provides == 0 ) && ( @shares == 0 ) ) {
120
   if ( ( @requires > 0 ) && ( @provides == 0 ) && ( @shares == 0 ) ) {
114
     # No object provides this symbol, but some objects require it.
121
     # No object provides this symbol, but some objects require it.
115
     $problems->{$_}->{nonexistent}->{$symbol} = 1 foreach @requires;
122
     $problems->{$_}->{nonexistent}->{$symbol} = 1 foreach @requires;
120
     foreach my $provide ( @provides ) {
127
     foreach my $provide ( @provides ) {
121
       if ( $provide eq "LINKER" ) {
128
       if ( $provide eq "LINKER" ) {
122
 	# Linker-provided symbols are exempt from this check.
129
 	# Linker-provided symbols are exempt from this check.
123
-      } elsif ( $info->{provides}->{$provide} =~ /^\.tbl\./ ) {
130
+      } elsif ( $symtab->{$provide}->{$symbol}->{section} =~ /^\.tbl\./ ) {
124
 	# Linker tables are exempt from this check.
131
 	# Linker tables are exempt from this check.
125
       } else {
132
       } else {
126
 	$problems->{$provide}->{unused}->{$symbol} = 1;
133
 	$problems->{$provide}->{unused}->{$symbol} = 1;

Loading…
Cancel
Save