[cfe-dev] [llvm-dev] [RFC][ARM] Add support for embedded position-independent code (ROPI/RWPI)

Oliver Stannard via cfe-dev cfe-dev at lists.llvm.org
Fri Dec 4 09:41:03 PST 2015

> On 4 December 2015 at 05:46, Oliver Stannard via llvm-dev
> <llvm-dev at lists.llvm.org> 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.


More information about the cfe-dev mailing list