From ad5d8a2bf3526bce4317055612709ac076b5c4c3 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sat, 12 Sep 2015 02:50:28 +0000 Subject: make sh crti/crtn init/fini fragments setup proper stack frame for fdpic support is is essential that the got pointer be saved at a known, ABI-dictated offset from the frame pointer, since there is no way to recover it once it's lost. --- crt/sh/crtn.s | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'crt/sh/crtn.s') diff --git a/crt/sh/crtn.s b/crt/sh/crtn.s index dde633b0..958ce951 100644 --- a/crt/sh/crtn.s +++ b/crt/sh/crtn.s @@ -1,9 +1,13 @@ .section .init lds.l @r15+, pr + mov.l @r15+, r14 + mov.l @r15+, r12 rts - nop + add #4, r15 .section .fini lds.l @r15+, pr + mov.l @r15+, r14 + mov.l @r15+, r12 rts - nop + add #4, r15 -- cgit v1.2.1