summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2011-04-07 11:51:04 +0200
committeraxis <qt-info@nokia.com>2011-04-07 11:51:04 +0200
commit7433709193db3e2e9adf4960ec9eceedcacc1721 (patch)
tree2dfae5510c360384fadd50951fa537b9175b9738 /bin
parentfc3e7b45774ac6f3ae8fe6295c57681e86a421bf (diff)
downloadqt4-tools-7433709193db3e2e9adf4960ec9eceedcacc1721.tar.gz
Added a consistency check for number of missing symbols in elf2e32.
Reviewed-by: Trust me
Diffstat (limited to 'bin')
-rwxr-xr-xbin/elf2e32_qtwrapper.pl39
1 files changed, 35 insertions, 4 deletions
diff --git a/bin/elf2e32_qtwrapper.pl b/bin/elf2e32_qtwrapper.pl
index 8b8eab9f65..24b910b868 100755
--- a/bin/elf2e32_qtwrapper.pl
+++ b/bin/elf2e32_qtwrapper.pl
@@ -108,10 +108,33 @@ sub printRecordedDefFiles {
}
}
+sub missingSymbolMismatch
+{
+ my $missingSymbolSum = $_[0];
+
+ printRecordedDefFiles;
+
+ print("Bug in the native elf2e32 tool: Number of missing symbols does not\n");
+ print("match number of removed symbols in the output DEF file.\n\n");
+
+ print("Original elf2e32 output:\n");
+ print(" $missingSymbolSum Frozen Export\(s\) missing from the ELF file\n\n");
+
+ print("However $defoutput[1] contains more missing entries than that.\n\n");
+
+ print("This needs to be fixed manually in the DEF file.\n");
+ exit(2);
+}
+
+if ($debugScript) {
+ print("PATH: $ENV{PATH}\n");
+ print("EPOCROOT: $ENV{EPOCROOT}\n");
+}
+
while (1) {
if (++$runCount > 2) {
+ printRecordedDefFiles if ($debugScript);
print("Internal error in $0, link succeeded, but exports may be wrong.\n");
- printRecordedDefFiles;
last;
}
@@ -124,6 +147,8 @@ while (1) {
my %fixupSymbols;
my $foundBrokenSymbols = 0;
+ my $missingSymbolSum = 0;
+ my $missingSymbolCount = 0;
my $errors = 0;
while (<$elf2e32Pipe>) {
print;
@@ -132,14 +157,17 @@ while (1) {
} elsif (/symbol ([a-z0-9_]+) absent in the DEF file, but present in the ELF file/io) {
$fixupSymbols{$1} = 1;
$foundBrokenSymbols = 1;
- } elsif (/[0-9]+ Frozen Export\(s\) missing from the ELF file/io) {
+ } elsif (/([0-9]+) Frozen Export\(s\) missing from the ELF file/io) {
+ $missingSymbolSum = $1;
$foundBrokenSymbols = 1;
}
}
close($elf2e32Pipe);
- recordDefFile("Run no $runCount, elf2e32 DEF file input", "$definput[1]");
- recordDefFile("Run no $runCount, elf2e32 DEF file output", "$defoutput[1]");
+ if ($debugScript) {
+ recordDefFile("Run no $runCount, elf2e32 DEF file input", "$definput[1]");
+ recordDefFile("Run no $runCount, elf2e32 DEF file output", "$defoutput[1]");
+ }
if ($errors) {
$returnCode = 1;
@@ -240,6 +268,9 @@ while (1) {
} elsif ($defLine =~ s/; MISSING://) {
# Auto-absent symbols.
$extraData .= " ABSENT";
+ if (++$missingSymbolCount > $missingSymbolSum) {
+ missingSymbolMismatch($missingSymbolSum);
+ }
}
print($tmpDefFile "\t$sym \@ $ordinal $extraData\n") or die("Could not write to temporary DEF file: $!");
}