From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 129848 invoked by alias); 23 May 2018 14:25:31 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 129588 invoked by uid 89); 23 May 2018 14:25:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1055 X-HELO: smtp.ispras.ru Date: Wed, 23 May 2018 14:25:00 -0000 From: Alexander Monakov To: Rogerio Alves cc: libc-alpha@sourceware.org Subject: Re: [RFC] powerpc: restore TOC when static longjmp to shared object In-Reply-To: <8ac334c6-bcf4-7c72-8d28-900fdd3b0bc4@linux.vnet.ibm.com> Message-ID: References: <4c67a306-d447-1158-1b92-22ed1cfcfa0a@linux.vnet.ibm.com> <8ac334c6-bcf4-7c72-8d28-900fdd3b0bc4@linux.vnet.ibm.com> User-Agent: Alpine 2.20.13 (LNX 116 2015-12-14) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-SW-Source: 2018-05/txt/msg00759.txt.bz2 On Wed, 23 May 2018, Rogerio Alves wrote: > I don't think that alloca/memset should destroy the caller stack like is > happening but, also I think we have to restore TOC to the caller frame after > the longjmp in that case also. I don't know if there's any other more direct > and robust ways to checking if TOC is correctly restored. I can't think in > anything easier than always restore. I'm not challenging the idea that "always restoring" is an appropriate fix. My question was about *verifying* that TOC register is restored as it ought to, i.e. how the testcase needs to work. Right now, the test uses my code from Bugzilla that worked okay for demonstration purposes, but has issues as a long-term testsuite addition: * it demonstrates the issue in a very intransparent fashion, relying on non-obvious interaction with alloca-memset part of the test; * when GCC manages to optimize out the alloca-memset part, the test will cease to work for the intended purpose. Alexander