From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/3604 Path: news.gmane.org!not-for-mail From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Newsgroups: gmane.linux.lib.musl.general Subject: [PATCH 1/3] PIE support for arm Date: Wed, 10 Jul 2013 16:38:59 +0300 Message-ID: <1373463541-17170-1-git-send-email-timo.teras@iki.fi> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1373463539 16236 80.91.229.3 (10 Jul 2013 13:38:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 10 Jul 2013 13:38:59 +0000 (UTC) Cc: =?UTF-8?q?Timo=20Ter=C3=A4s?= To: musl@lists.openwall.com Original-X-From: musl-return-3606-gllmg-musl=m.gmane.org@lists.openwall.com Wed Jul 10 15:38:59 2013 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1Uwube-0008Gi-UT for gllmg-musl@plane.gmane.org; Wed, 10 Jul 2013 15:38:55 +0200 Original-Received: (qmail 32706 invoked by uid 550); 10 Jul 2013 13:38:54 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 32698 invoked from network); 10 Jul 2013 13:38:54 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer; bh=ED0VVOt7cdLFtMzjvx1w2hewp9t2UlbpwzbIaxB0uPs=; b=Bm6d906ekht8ea/7Q+4parVC5lGXha+RdjphkKCCTOwwrTaBY2Ut3ilIjEe3WIg4vB ZktZh1xnus2Zc2PC+cNlGlskcNuET1zxZe9Mn6OuA+dXoNkiPfaqvcjZWiFUZ8OXb2xR 8/MzK2dNqayj8Kji7Irt5mT+R5/fAUkfv8P+Ku5Xxh5QQnzkPGuXA2z4kjw5XpscB52i 5WN6uuuzJ/a3AB/hl3B2+KC1Oz2TPxX7i0WwAOKaesxc5sU8mGYAaAxhzHNn0coxwWBi UgD/Y9jQ+a2cTlG6JY8MieZGY5Zg9apQDfNtqWvWXis53uS6gYfIcCtk44s1XQBOl1Wx txOw== X-Received: by 10.15.50.132 with SMTP id l4mr35450560eew.122.1373463522625; Wed, 10 Jul 2013 06:38:42 -0700 (PDT) Original-Sender: =?UTF-8?Q?Timo_Ter=C3=A4s?= X-Mailer: git-send-email 1.8.3.2 Xref: news.gmane.org gmane.linux.lib.musl.general:3604 Archived-At: --- 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