You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 5404 Reporter: meurer Assigned to:@lefessan Status: closed (set by @lefessan on 2012-01-17T10:05:03Z) Resolution: fixed Priority: normal Severity: feature Version: 3.12.1 Category: ~DO NOT USE (was: OCaml general) Duplicate of:#5433 Monitored by: tgazagna @glondu@hcarty
I spent some time fixing the ARM compiler part to emit position-independent code in order to get proper support for natdynlink on ARM. The critical part is fixing the generated branches to use the PLT (cf. issue 5049), the other relocations seem to be handled properly, hence there's no need to use the GOT to access global variables. That does however require changes to the runtime interface as r12 is used as scratch register for the PLT slots. I fixed these by introducing two additional functions caml_invoke_gc and caml_c_invoke, which are similar to their caml_call_gc and caml_c_call counterparts, but do not use r12 for parameter passing. The old functions are provided for compatibility with existing code/libraries (and are used by the code generator when appropriate).
The attached patch contains the required changes to the runtime and the compiler toolchain. So far the stuff was tested with Debian squeeze armel running on QEMU and a NanosG20 SBC (ARM926EJ-S rev 5 (v5l)).
I did some tests on the ARM926EJ-S, and there seems to be no noticable performance hit (OLD is OCaml 3.12.1 without the patch, NEW is the patched OCaml generating PIC code):