From 07ea23aa2d17f701fa125442c20c1eba75b55fdb 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135288 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Object/ELFObjectFile.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib/Object/ELFObjectFile.cpp') diff --git a/lib/Object/ELFObjectFile.cpp b/lib/Object/ELFObjectFile.cpp index edf9824d3d..e2ff4dfc03 100644 --- a/lib/Object/ELFObjectFile.cpp +++ b/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); @@ -495,6 +497,16 @@ error_code ELFObjectFile return object_error::success; } +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) -- cgit v1.2.3-18-g5258