aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2011-10-13 20:36:54 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2011-10-13 20:36:54 +0000
commitbff6f8679a3e4006653157ca11cee9dc58c68f8b (patch)
tree5a481e3cc5c8ebe02001af51f2cfc717fc1a47d4
parent7f1653a7aee0c30adfa948ad5bdbf12c7cc1e519 (diff)
downloadexternal_llvm-bff6f8679a3e4006653157ca11cee9dc58c68f8b.zip
external_llvm-bff6f8679a3e4006653157ca11cee9dc58c68f8b.tar.gz
external_llvm-bff6f8679a3e4006653157ca11cee9dc58c68f8b.tar.bz2
COFF: Implement sectionContainsSymbol for relocatable files only.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141884 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Object/COFFObjectFile.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/Object/COFFObjectFile.cpp b/lib/Object/COFFObjectFile.cpp
index e84eb91..750c34d 100644
--- a/lib/Object/COFFObjectFile.cpp
+++ b/lib/Object/COFFObjectFile.cpp
@@ -369,8 +369,14 @@ error_code COFFObjectFile::isSectionBSS(DataRefImpl Sec,
error_code COFFObjectFile::sectionContainsSymbol(DataRefImpl Sec,
DataRefImpl Symb,
bool &Result) const {
- // FIXME: Unimplemented.
- Result = false;
+ const coff_section *sec = toSec(Sec);
+ const coff_symbol *symb = toSymb(Symb);
+ const coff_section *symb_sec;
+ if (error_code ec = getSection(symb->SectionNumber, symb_sec)) return ec;
+ if (symb_sec == sec)
+ Result = true;
+ else
+ Result = false;
return object_error::success;
}