summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bytecode/Archive/ArchiveReader.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-11-15 01:40:20 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-11-15 01:40:20 +0000
commitcbd9aeb5876b97711910f5450bb30e5fca79cc56 (patch)
tree0ca918fa86a14a968ffc2036dae6b561f7938f8a /llvm/lib/Bytecode/Archive/ArchiveReader.cpp
parentfcf5ef7a4a1014c821ad3a549a1ca20715c72d62 (diff)
downloadbcm5719-llvm-cbd9aeb5876b97711910f5450bb30e5fca79cc56.tar.gz
bcm5719-llvm-cbd9aeb5876b97711910f5450bb30e5fca79cc56.zip
* Make sure the string table gets read even if there isn't a foreign
symbol table. * Make sure we update the file pointer for each member when rebuilding the symbol table. llvm-svn: 17812
Diffstat (limited to 'llvm/lib/Bytecode/Archive/ArchiveReader.cpp')
-rw-r--r--llvm/lib/Bytecode/Archive/ArchiveReader.cpp28
1 files changed, 20 insertions, 8 deletions
diff --git a/llvm/lib/Bytecode/Archive/ArchiveReader.cpp b/llvm/lib/Bytecode/Archive/ArchiveReader.cpp
index 794e1b271f3..7f85894072a 100644
--- a/llvm/lib/Bytecode/Archive/ArchiveReader.cpp
+++ b/llvm/lib/Bytecode/Archive/ArchiveReader.cpp
@@ -309,18 +309,25 @@ Archive::loadSymbolTable() {
if (mbr->isForeignSymbolTable()) {
// Skip the foreign symbol table, we don't do anything with it
At += mbr->getSize();
+ if (mbr->getSize() % 2 != 0)
+ At++;
delete mbr;
- // See if there's a string table too
+ // Read the next one
+ FirstFile = At;
+ mbr = parseMemberHeader(At,End);
+ }
+
+ if (mbr->isStringTable()) {
+ // Process the string table entry
+ strtab.assign((const char*)mbr->getData(),mbr->getSize());
+ At += mbr->getSize();
+ if (mbr->getSize() % 2 != 0)
+ At++;
+ delete mbr;
+ // Get the next one
FirstFile = At;
mbr = parseMemberHeader(At,End);
- if (mbr->isStringTable()) {
- strtab.assign((const char*)mbr->getData(),mbr->getSize());
- At += mbr->getSize();
- delete mbr;
- FirstFile = At;
- mbr = parseMemberHeader(At,End);
- }
}
// See if its the symbol table
@@ -432,6 +439,11 @@ Archive::findModulesDefiningSymbols(const std::set<std::string>& symbols,
mbr->getPath().get();
}
}
+
+ // Go to the next file location
+ At += mbr->getSize();
+ if (mbr->getSize() % 2 != 0)
+ At++;
}
}
OpenPOWER on IntegriCloud