mailing list of musl libc
 help / color / mirror / code / Atom feed
From: "Timo Teräs" <timo.teras@iki.fi>
To: musl@lists.openwall.com
Cc: "Timo Teräs" <timo.teras@iki.fi>
Subject: [PATCH 1/3] PIE support for arm
Date: Wed, 10 Jul 2013 16:38:59 +0300	[thread overview]
Message-ID: <1373463541-17170-1-git-send-email-timo.teras@iki.fi> (raw)

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



             reply	other threads:[~2013-07-10 13:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-10 13:38 Timo Teräs [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1373463541-17170-1-git-send-email-timo.teras@iki.fi \
    --to=timo.teras@iki.fi \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).