summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/COFFObjectFile.cpp
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
commit9a28851e52c17541256a672b619af07af07a6bc6 (patch)
tree616f302aab00f01fe27564ee3aa9d12bbcd76746 /llvm/lib/Object/COFFObjectFile.cpp
parent596fa16dd3dd1454a89fa01613fedee12d852278 (diff)
downloadbcm5719-llvm-9a28851e52c17541256a672b619af07af07a6bc6.tar.gz
bcm5719-llvm-9a28851e52c17541256a672b619af07af07a6bc6.zip
COFF: Implement sectionContainsSymbol for relocatable files only.
llvm-svn: 141884
Diffstat (limited to 'llvm/lib/Object/COFFObjectFile.cpp')
-rw-r--r--llvm/lib/Object/COFFObjectFile.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/llvm/lib/Object/COFFObjectFile.cpp b/llvm/lib/Object/COFFObjectFile.cpp
index e84eb914fc7..750c34d12a1 100644
--- a/llvm/lib/Object/COFFObjectFile.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud