From 7a9669e977e5f750cf72ccbd2614f8b72ce02c4c Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 22 Sep 2015 03:54:42 +0000 Subject: add general fdpic support in dynamic linker and arch support for sh at this point not all functionality is complete. the dynamic linker itself, and main app if it is also loaded by the kernel, take advantage of fdpic and do not need constant displacement between segments, but additional libraries loaded by the dynamic linker follow normal ELF semantics for mapping still. this fully works, but does not admit shared text on nommu. in terms of actual functional correctness, dlsym's results are presently incorrect for function symbols, RTLD_NEXT fails to identify the caller correctly, and dladdr fails almost entirely. with the dynamic linker entry point working, support for static pie is automatically included, but linking the main application as ET_DYN (pie) probably does not make sense for fdpic anyway. ET_EXEC is equally relocatable but more efficient at representing relocations. --- arch/sh/crt_arch.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'arch/sh/crt_arch.h') diff --git a/arch/sh/crt_arch.h b/arch/sh/crt_arch.h index e9745f9b..b902dcc8 100644 --- a/arch/sh/crt_arch.h +++ b/arch/sh/crt_arch.h @@ -12,7 +12,10 @@ START ": \n" " bsr __fdpic_fixup \n" " add r0, r6 \n" " mov r0, r12 \n" +" mov r10, r5 \n" " mov r15, r4 \n" +" mov.l r9, @-r15 \n" +" mov.l r8, @-r15 \n" " mov #-16, r0 \n" " bsr " START "_c \n" " and r0, r15 \n" -- cgit v1.2.1