[llvm-commits] [llvm] r141884 - /llvm/trunk/lib/Object/COFFObjectFile.cpp
Michael J. Spencer
bigcheesegs at gmail.com
Thu Oct 13 13:36:54 PDT 2011
Author: mspencer
Date: Thu Oct 13 15:36:54 2011
New Revision: 141884
URL: http://llvm.org/viewvc/llvm-project?rev=141884&view=rev
Log:
COFF: Implement sectionContainsSymbol for relocatable files only.
Modified:
llvm/trunk/lib/Object/COFFObjectFile.cpp
Modified: llvm/trunk/lib/Object/COFFObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/COFFObjectFile.cpp?rev=141884&r1=141883&r2=141884&view=diff
==============================================================================
--- llvm/trunk/lib/Object/COFFObjectFile.cpp (original)
+++ llvm/trunk/lib/Object/COFFObjectFile.cpp Thu Oct 13 15:36:54 2011
@@ -369,8 +369,14 @@
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;
}
More information about the llvm-commits
mailing list