Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Wed, 10 Jul 2013 16:38:59 +0300
From: Timo Teräs <timo.teras@....fi>
To: musl@...ts.openwall.com
Cc: Timo Teräs <timo.teras@....fi>
Subject: [PATCH 1/3] PIE support for arm

---
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

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.