Add an option to MCJIT to have it forward all sections to the
authorLang Hames <lhames@gmail.com>
Thu, 20 Mar 2014 21:06:46 +0000 (21:06 +0000)
committerLang Hames <lhames@gmail.com>
Thu, 20 Mar 2014 21:06:46 +0000 (21:06 +0000)
commit20425d92dfb39377e6b8eb111971d5ac3042421a
tree108613187a8bd7d182f7d7499f011d8288e4e1c1
parentee3242ed0b25f1b2d53d47eabe727035f387123a
Add an option to MCJIT to have it forward all sections to the
RTDyldMemoryManager, regardless of whether it thinks they're "required for
execution".

Currently, RuntimeDyld only passes sections that are "required for execution"
to the RTDyldMemoryManager, and takes "required for execution" to mean exactly
"contains symbols or relocations". There are two problems with this:
(1) It can drop sections with anonymous data that is referenced by code.
(2) It leaves the JIT client no way to inspect interesting sections that aren't
    actually required to run the program (e.g dwarf sections).

A test case is still in the works.

Future work: We may want to replace this with a generic section filtering
mechanism, but that will require more consideration. For now, this flag at least
allows clients to volunteer to do the filtering themselves.

Fixes <rdar://problem/15177691>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204398 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ExecutionEngine/ExecutionEngine.h
include/llvm/ExecutionEngine/RuntimeDyld.h
lib/ExecutionEngine/MCJIT/MCJIT.h
lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h