Object, COFF: Tighten the object file parser

We were a little lax in a few areas:
- We pretended that import libraries were like any old COFF file, they
  are not.  In fact, they aren't really COFF files at all, we should
  probably grow some specialized functionality to handle them smarter.
- Our symbol iterators were more than happy to attempt to go past the
  end of the symbol table if you had a symbol with a bad list of
  auxiliary symbols.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222124 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Majnemer
2014-11-17 11:17:17 +00:00
parent d9d2703b71
commit a18e46cbc9
5 changed files with 82 additions and 54 deletions

View File

@ -307,8 +307,7 @@ static void DisassembleObject(const ObjectFile *Obj, bool InlineRelocs) {
}
for (const SectionRef &Section : Obj->sections()) {
bool Text = Section.isText();
if (!Text)
if (!Section.isText() || Section.isVirtual())
continue;
uint64_t SectionAddr = Section.getAddress();