From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/11769 Path: news.gmane.org!.POSTED!not-for-mail From: Alexander Monakov Newsgroups: gmane.linux.lib.musl.general Subject: Re: possible bug in setjmp implementation for ppc64 Date: Tue, 1 Aug 2017 08:28:27 +0300 (MSK) Message-ID: References: <1501520360.0.593167188853569@go.bunnymail.go> <20170731203007.GB1627@brightrain.aerifal.cx> <20170801051042.GA14914@dora.lan> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Trace: blaine.gmane.org 1501565336 475 195.159.176.226 (1 Aug 2017 05:28:56 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 1 Aug 2017 05:28:56 +0000 (UTC) User-Agent: Alpine 2.20.13 (LNX 116 2015-12-14) To: musl@lists.openwall.com Original-X-From: musl-return-11782-gllmg-musl=m.gmane.org@lists.openwall.com Tue Aug 01 07:28:42 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1dcPjT-0007oL-KU for gllmg-musl@m.gmane.org; Tue, 01 Aug 2017 07:28:39 +0200 Original-Received: (qmail 7361 invoked by uid 550); 1 Aug 2017 05:28:43 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 7335 invoked from network); 1 Aug 2017 05:28:43 -0000 In-Reply-To: <20170801051042.GA14914@dora.lan> Xref: news.gmane.org gmane.linux.lib.musl.general:11769 Archived-At: On Tue, 1 Aug 2017, Bobby Bingham wrote: > I think this either requires having different versions of setjmp/longjmp > for static and dynamic libc, Do you mean for non-pic vs pic objects? As I understand, when libc.a is built with -fpic (so it's suitable for static-pie), setjmp-longjmp need to preserve saved TOC at (r1+24). So presumably source code would need to test #ifdef __PIC__? > or to increase the size of jmpbuf so we can always save/restore both > r2 and the value on the stack, but this would be an ABI change. Would that work for non-pic, i.e. is (r1+24) a reserved location even in non-pic mode? If not, you can't overwrite it from longjmp. Alexander