From 3f31fa05d5471deeee6164a8bdcfe75ca004e062 Mon Sep 17 00:00:00 2001 From: Andrew Kaylor Date: Wed, 10 Oct 2012 01:41:33 +0000 Subject: This patch adds new functions to the SectionRef and ObjectFile interfaces to determine whether or not a section is meant to be read-only. These functions will be used by the MCJIT RuntimeDyld to give hints to the memory manager during the object loading process in a future patch. Patch by Ashok Thirumurthi. llvm-svn: 165586 --- llvm/lib/Object/MachOObjectFile.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'llvm/lib/Object/MachOObjectFile.cpp') diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp index d229671954f..ed9449c50d3 100644 --- a/llvm/lib/Object/MachOObjectFile.cpp +++ b/llvm/lib/Object/MachOObjectFile.cpp @@ -612,6 +612,17 @@ error_code MachOObjectFile::isSectionZeroInit(DataRefImpl DRI, return object_error::success; } +error_code MachOObjectFile::isSectionReadOnlyData(DataRefImpl Sec, + bool &Result) const { + // Consider using the code from isSectionText to look for __const sections. + // Alternately, emit S_ATTR_PURE_INSTRUCTIONS and/or S_ATTR_SOME_INSTRUCTIONS + // to use section attributes to distinguish code from data. + + // FIXME: Unimplemented. + Result = false; + return object_error::success; +} + error_code MachOObjectFile::sectionContainsSymbol(DataRefImpl Sec, DataRefImpl Symb, bool &Result) const { -- cgit v1.2.3