From: David Majnemer Date: Wed, 18 Nov 2015 04:35:32 +0000 (+0000) Subject: Fix LLD testsuite fallout from r253429 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=35da61aba143cc6d35224ed008b30e07bc6486c3;p=oota-llvm.git Fix LLD testsuite fallout from r253429 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253432 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/llvm-objdump/llvm-objdump.cpp b/tools/llvm-objdump/llvm-objdump.cpp index df6e2a45862..54f24d7a00f 100644 --- a/tools/llvm-objdump/llvm-objdump.cpp +++ b/tools/llvm-objdump/llvm-objdump.cpp @@ -964,9 +964,9 @@ static void DisassembleObject(const ObjectFile *Obj, bool InlineRelocs) { uint64_t Address = Symb.first; StringRef Name = Symb.second; if (Name.startswith("$d")) - DataMappingSymsAddr.push_back(Address); + DataMappingSymsAddr.push_back(Address - SectionAddr); if (Name.startswith("$x")) - TextMappingSymsAddr.push_back(Address); + TextMappingSymsAddr.push_back(Address - SectionAddr); } } @@ -1000,7 +1000,7 @@ static void DisassembleObject(const ObjectFile *Obj, bool InlineRelocs) { // If the section has no symbol at the start, just insert a dummy one. if (Symbols.empty() || Symbols[0].first != 0) - Symbols.insert(Symbols.begin(), std::make_pair(0, name)); + Symbols.insert(Symbols.begin(), std::make_pair(SectionAddr, name)); SmallString<40> Comments; raw_svector_ostream CommentStream(Comments); @@ -1127,7 +1127,7 @@ static void DisassembleObject(const ObjectFile *Obj, bool InlineRelocs) { const std::pair &RHS) { return LHS < RHS.first; }); - if (TargetSym != Symbols.begin()) { + if (TargetSym != TargetSectionSymbols->begin()) { --TargetSym; uint64_t TargetAddress = std::get<0>(*TargetSym); StringRef TargetName = std::get<1>(*TargetSym);