From f6f3e81c0756246d2488f6a81b1f9100416fbfdb Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Fri, 15 Jul 2011 18:39:21 +0000 Subject: ObjectFile: Add a method to check whether a section contains a symbol. - No ELF or COFF implementation yet, I don't have a way to test that. Should be straightforward to add though. llvm-svn: 135288 --- llvm/lib/Object/ELFObjectFile.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'llvm/lib/Object/ELFObjectFile.cpp') diff --git a/llvm/lib/Object/ELFObjectFile.cpp b/llvm/lib/Object/ELFObjectFile.cpp index edf9824..e2ff4df 100644 --- a/llvm/lib/Object/ELFObjectFile.cpp +++ b/llvm/lib/Object/ELFObjectFile.cpp @@ -235,6 +235,8 @@ protected: virtual error_code getSectionSize(DataRefImpl Sec, uint64_t &Res) const; virtual error_code getSectionContents(DataRefImpl Sec, StringRef &Res) const; virtual error_code isSectionText(DataRefImpl Sec, bool &Res) const; + virtual error_code sectionContainsSymbol(DataRefImpl Sec, DataRefImpl Symb, + bool &Result) const; public: ELFObjectFile(MemoryBuffer *Object, error_code &ec); @@ -496,6 +498,16 @@ error_code ELFObjectFile } template +error_code ELFObjectFile + ::sectionContainsSymbol(DataRefImpl Sec, + DataRefImpl Symb, + bool &Result) const { + // FIXME: Unimplemented. + Result = false; + return object_error::success; +} + +template ELFObjectFile::ELFObjectFile(MemoryBuffer *Object , error_code &ec) : ObjectFile(Binary::isELF, Object, ec) -- cgit v1.1