[llvm-commits] [PATCH] Fix MCJIT running global constructors

Amara Emerson amara.emerson at arm.com
Fri Nov 16 02:17:24 PST 2012


Hi,

Currently MCJIT on ARM cannot handle R_ARM_TARGET1 relocations which are
needed for relocating .init_array, and so C++ static global constructors do
not run.

The attached patch adds support for this relocation, and also fixes another
bug which prevents the global ctors from running. Currently the RuntimeDyld
adds only _global_ symbols to the GlobalSymbolAddress data structure during
symbol reading, however I believe this is meant to be interpreted as (global
(symbol table)) rather than ((global symbol) table). Since clang emits the
constructors with internal linkage, the ExecutionEngine fails to find the
constructor and dies.

Test case included. Ok to commit?

Amara
-------------- next part --------------
A non-text attachment was scrubbed...
Name: llvm365-wtest.patch
Type: application/octet-stream
Size: 2216 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121116/151f3e47/attachment.obj>


More information about the llvm-commits mailing list