diff options
author | Lang Hames <lhames@gmail.com> | 2019-05-12 22:26:33 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2019-05-12 22:26:33 +0000 |
commit | 23085ec36d0821d4e3d69f4acf75d47ed0789837 (patch) | |
tree | 0e41d4e6eb344061df212db7ed029ae9d799e295 /llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp | |
parent | 27415e7a92fa7e7676e486e7f95dbd922d8b22ed (diff) | |
download | bcm5719-llvm-23085ec36d0821d4e3d69f4acf75d47ed0789837.tar.gz bcm5719-llvm-23085ec36d0821d4e3d69f4acf75d47ed0789837.zip |
[JITLink] Add a test for zero-filled content.
Also updates RuntimeDyldChecker and llvm-rtdyld to support zero-fill tests by
returning a content address of zero (but no error) for zero-fill atoms, and
treating loads from zero as returning zero.
llvm-svn: 360547
Diffstat (limited to 'llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp')
-rw-r--r-- | llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp b/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp index d8382a1d29f..a52650b941d 100644 --- a/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp +++ b/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp @@ -774,7 +774,7 @@ static int linkAndVerify() { // First get the target address. if (auto InternalSymbol = Dyld.getSymbol(Symbol)) - SymInfo.TargetAddress = InternalSymbol.getAddress(); + SymInfo.setTargetAddress(InternalSymbol.getAddress()); else { // Symbol not found in RuntimeDyld. Fall back to external lookup. #ifdef _MSC_VER @@ -799,7 +799,7 @@ static int linkAndVerify() { auto I = Result->find(Symbol); assert(I != Result->end() && "Expected symbol address if no error occurred"); - SymInfo.TargetAddress = I->second.getAddress(); + SymInfo.setTargetAddress(I->second.getAddress()); } // Now find the symbol content if possible (otherwise leave content as a @@ -810,7 +810,7 @@ static int linkAndVerify() { char *CSymAddr = static_cast<char *>(SymAddr); StringRef SecContent = Dyld.getSectionContent(SectionID); uint64_t SymSize = SecContent.size() - (CSymAddr - SecContent.data()); - SymInfo.Content = StringRef(CSymAddr, SymSize); + SymInfo.setContent(StringRef(CSymAddr, SymSize)); } } return SymInfo; @@ -824,7 +824,7 @@ static int linkAndVerify() { logAllUnhandledErrors(SymInfo.takeError(), errs(), "RTDyldChecker: "); return false; } - return SymInfo->TargetAddress != 0; + return SymInfo->getTargetAddress() != 0; }; FileToSectionIDMap FileToSecIDMap; @@ -836,8 +836,8 @@ static int linkAndVerify() { if (!SectionID) return SectionID.takeError(); RuntimeDyldChecker::MemoryRegionInfo SecInfo; - SecInfo.TargetAddress = Dyld.getSectionLoadAddress(*SectionID); - SecInfo.Content = Dyld.getSectionContent(*SectionID); + SecInfo.setTargetAddress(Dyld.getSectionLoadAddress(*SectionID)); + SecInfo.setContent(Dyld.getSectionContent(*SectionID)); return SecInfo; }; @@ -854,10 +854,10 @@ static int linkAndVerify() { inconvertibleErrorCode()); auto &SI = StubMap[StubContainer][SymbolName]; RuntimeDyldChecker::MemoryRegionInfo StubMemInfo; - StubMemInfo.TargetAddress = - Dyld.getSectionLoadAddress(SI.SectionID) + SI.Offset; - StubMemInfo.Content = - Dyld.getSectionContent(SI.SectionID).substr(SI.Offset); + StubMemInfo.setTargetAddress(Dyld.getSectionLoadAddress(SI.SectionID) + + SI.Offset); + StubMemInfo.setContent( + Dyld.getSectionContent(SI.SectionID).substr(SI.Offset)); return StubMemInfo; }; |