diff options
author | Christophe Lyon <christophe.lyon@st.com> | 2013-03-28 10:46:55 +0100 |
---|---|---|
committer | Waldemar Brodkorb <wbrodkorb@conet.de> | 2018-08-10 16:02:45 +0200 |
commit | 6618d5aa2feedded6358ba9c3d50cb8ee08fbd20 (patch) | |
tree | dd693c70e275a2b435b097900688db59bb830381 /ldso/ldso/arm/resolve.S | |
parent | 448a986954f65cc8c41f227bdf171d8e0d0b4c7d (diff) |
rtld: Add lazy binding support
Add support for R_ARM_FUNCDESC_VALUE and implement _dl_linux_resolver
for FDPIC on ARM.
* ldso/ldso/arm/elfinterp.c (_dl_linux_resolver): Support __FDPIC__.
(_dl_do_lazy_reloc): Likewise.
* ldso/ldso/arm/resolve.S (_dl_linux_resolve): Likewise.
Signed-off-by: Mickaël Guêné <mickael.guene@st.com>
Signed-off-by: Christophe Lyon <christophe.lyon@st.com>
Diffstat (limited to 'ldso/ldso/arm/resolve.S')
-rw-r--r-- | ldso/ldso/arm/resolve.S | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/ldso/ldso/arm/resolve.S b/ldso/ldso/arm/resolve.S index 2a516436e..039a6b788 100644 --- a/ldso/ldso/arm/resolve.S +++ b/ldso/ldso/arm/resolve.S @@ -107,6 +107,27 @@ .type _dl_linux_resolve,%function .align 4; +#if __FDPIC__ +/* + * _dl_linux_resolve() FDPIC version receives the following parameters from + * lazy PLT entry: + * R12: GOT address for the resolver GOT + * SP[0]: funcdesc_value_reloc_offset(foo) + * R9: GOT address for the caller GOT + * _dl_linux_resolver() will return a function descriptor address in R0. + */ +_dl_linux_resolve: + push {r0, r1, r2, r3, r14} + ldr r0, [r9, #8] + ldr r1, [sp, #20] + mov r9, r12 + blx _dl_linux_resolver + ldr r9, [r0, #4] + ldr r12, [r0] + pop {r0, r1, r2, r3, r14} + add sp, sp, #4 + bx r12 +#else _dl_linux_resolve: @ _dl_linux_resolver is a standard subroutine call, therefore it @ preserves everything except r0-r3 (a1-a4), ip and lr. This @@ -129,6 +150,7 @@ _dl_linux_resolve: ldmia sp!, {r0, r1, r2, r3, r4, lr} BX(ip) +#endif /* __FDPIC__ */ #else @ In the thumb case _dl_linux_resolver is thumb. If a bl is used @ from arm code the linker will insert a stub call which, with |