mailing list of musl libc
 help / color / mirror / code / Atom feed
* [PATCH 1/3] PIE support for arm
@ 2013-07-10 13:38 Timo Teräs
  2013-07-10 13:39 ` [PATCH 2/3] Unwind support for ARM EABI Timo Teräs
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Timo Teräs @ 2013-07-10 13:38 UTC (permalink / raw)
  To: musl; +Cc: Timo Teräs

---
Originally based on the glibc's implementation, but as this is
very short function (of which only maybe 10 lines are from the
original work), and the rest is modified to suit musl. I believe
we could just place on public domain.

 crt/arm/Scrt1.s | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 crt/arm/Scrt1.s

diff --git a/crt/arm/Scrt1.s b/crt/arm/Scrt1.s
new file mode 100644
index 0000000..b8fdfda
--- /dev/null
+++ b/crt/arm/Scrt1.s
@@ -0,0 +1,34 @@
+.weak _init
+.weak _fini
+.text
+.global _start
+_start:
+        mov fp,#0
+        mov lr,#0
+
+        pop { a2 }
+        mov a3, sp
+        push { a3 }
+        push { a1 }
+
+        ldr sl, .L_GOT
+        adr a4, .L_GOT
+        add sl, sl, a4
+        ldr ip, .L_GOT+4
+        ldr ip, [sl, ip]
+        push { ip }
+        ldr a4, .L_GOT+8
+        ldr a4, [sl, a4]
+        ldr a1, .L_GOT+12
+        ldr a1, [sl, a1]
+
+        bl __libc_start_main(PLT)
+1:      b 1b
+
+        .align 2
+.L_GOT:
+        .word _GLOBAL_OFFSET_TABLE_ - .L_GOT
+        .word _fini(GOT)
+        .word _init(GOT)
+        .word main(GOT)
+
-- 
1.8.3.2



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2013-07-10 21:03 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-10 13:38 [PATCH 1/3] PIE support for arm Timo Teräs
2013-07-10 13:39 ` [PATCH 2/3] Unwind support for ARM EABI Timo Teräs
2013-07-10 17:35   ` Timo Teras
2013-07-10 18:05     ` Rich Felker
2013-07-10 18:41       ` [PATCH v2] " Timo Teräs
2013-07-10 19:55         ` [PATCH v3] " Timo Teräs
2013-07-10 13:39 ` [PATCH 3/3] [FYI] fix dynamic linker dso loading Timo Teräs
2013-07-10 15:00   ` Rich Felker
2013-07-10 15:47     ` Timo Teras
2013-07-10 16:52       ` Richard Felker
2013-07-10 19:23 ` [PATCH 1/3] PIE support for arm (copyright...) Isaac
2013-07-10 19:28   ` Rich Felker
2013-07-10 21:03     ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).