From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/5680 Path: news.gmane.org!not-for-mail From: "Weiming Zhao" Newsgroups: gmane.linux.lib.musl.general Subject: static PIE Date: Wed, 30 Jul 2014 12:19:03 -0700 Message-ID: <000001cfac2b$2030bd30$60923790$@codeaurora.org> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0001_01CFABF0.73D3B9F0" X-Trace: ger.gmane.org 1406747997 30075 80.91.229.3 (30 Jul 2014 19:19:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 30 Jul 2014 19:19:57 +0000 (UTC) To: "'Rich Felker'" , Original-X-From: musl-return-5685-gllmg-musl=m.gmane.org@lists.openwall.com Wed Jul 30 21:19:52 2014 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 1XCZPC-0001pt-2S for gllmg-musl@plane.gmane.org; Wed, 30 Jul 2014 21:19:18 +0200 Original-Received: (qmail 22408 invoked by uid 550); 30 Jul 2014 19:19:17 -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 22397 invoked from network); 30 Jul 2014 19:19:16 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-caf-smtp.dmz.codeaurora.org X-Spam-Level: * X-Spam-Status: No, score=1.2 required=2.0 tests=ALL_TRUSTED,BAYES_40, HTML_MESSAGE,TVD_RCVD_SINGLE autolearn=no version=3.3.1 X-Mailer: Microsoft Outlook 15.0 Thread-Index: Ac+sKx9p6+GuIv+DQnqpCJ+qpxkfOQ== Content-Language: en-us X-Virus-Scanned: ClamAV using ClamSMTP Xref: news.gmane.org gmane.linux.lib.musl.general:5680 Archived-At: This is a multipart message in MIME format. ------=_NextPart_000_0001_01CFABF0.73D3B9F0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi Rich, I just find a very interesting article written by you: http://www.openwall.com/lists/musl/2012/05/24/1 I want to do the similar thing on ARM linux. I see _static_pie_reloc does the relocation, which would be done by loader in dynamic PIE. But with "-static", those reloc entries has already been fixed by ld. Without that, my code can still run but at fixed address space. To get the benefit of PIE, there should be address randomization (at least for data sections), which should be done in startup code. Is my understanding right? Thanks, weiming ------=_NextPart_000_0001_01CFABF0.73D3B9F0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi Rich,

 

I just find = a very interesting article written by you:

http://www.openw= all.com/lists/musl/2012/05/24/1

 

I want to do = the similar thing on ARM linux. I see _static_pie_reloc does the = relocation, which would be done by loader in dynamic = PIE.

 

But with “-static”, those reloc entries = has already been fixed by ld. Without that, my code can still run but at = fixed address space.

 

To get the = benefit of PIE, there should be address randomization (at least for data = sections), which should be done in startup code. Is my understanding = right?

 

Thanks,

weiming

------=_NextPart_000_0001_01CFABF0.73D3B9F0--