[llvm-dev] [RFC][ARM] Add support for embedded position-independent code (ROPI/RWPI)
Amit Aryeh Levy via llvm-dev
llvm-dev at lists.llvm.org
Tue Mar 15 07:24:40 PDT 2016
Has anything progressed with this? We would also like to use this to help dynamically load applications on an embedded platform.
We're currently doing this with GCC, which has exactly this functionality in the form of -msingle-pic-base -mno-pic-data-is-text-relative, but we'd prefer to switch back to LLVM, in particular because it would allow us to support higher level languages that use LLVM.
I'm happy to help test this patch on some real code if that would help.
~Amit
> >/On 4 December 2015 at 05:46, Oliver Stannard via llvm-dev /> >/<llvm-dev at lists.llvm.org
<http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev>> wrote: /> >/> SysV-style PIC solves this by having the dynamic linker fix up any /> >/> relocations on the data segment. Since these modes are trying to avoid /> >/> the need for a dynamic linker, we instead have the compiler emit code to /> >/> initialise these variables at startup time. These initiailisers are /> >/> expected to be rare, so the dynamic initiaslisers will be smaller than /> >/> the equivalent dynamic linker plus relocation and symbol tables. /> >//> >/What does armcc do here? It's been a while but I thought it was part /> >/of the scatter-loading initialisation, with some kind of compressed /> >/representation in the final linked image. />
> armcc does the same thing as this patch: emit dynamic initialisers which get called from .init_array at startup.
>
> Oliver
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160315/416e435c/attachment.sig>
More information about the llvm-dev
mailing list