From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 71645 invoked by alias); 16 Jul 2018 19:11:33 -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 71621 invoked by uid 89); 16 Jul 2018 19:11:32 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.6 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_SHORT,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=2017-2018, 20172018, adress X-HELO: mx0a-001b2d01.pphosted.com From: Tulio Magno Quites Machado Filho To: Rogerio Alves , libc-alpha@sourceware.org Cc: Florian Weimer , Alexander Monakov Subject: Re: [RFC] powerpc: restore TOC when static longjmp to shared object In-Reply-To: <106d886e-719e-c2a8-fd98-39e5ff5ebf36@linux.vnet.ibm.com> References: <4c67a306-d447-1158-1b92-22ed1cfcfa0a@linux.vnet.ibm.com> <8ac334c6-bcf4-7c72-8d28-900fdd3b0bc4@linux.vnet.ibm.com> <2b5a4221-f766-0f57-1aa5-94991c4dfa8e@linux.vnet.ibm.com> <4de7760b-04a9-855c-34ac-1565c5532fb9@linux.vnet.ibm.com> <90c62dd8-876c-81d9-c816-ede6882b8e70@redhat.com> <106d886e-719e-c2a8-fd98-39e5ff5ebf36@linux.vnet.ibm.com> User-Agent: Notmuch/0.27 (http://notmuchmail.org) Emacs/25.3.1 (x86_64-redhat-linux-gnu) Date: Mon, 16 Jul 2018 19:11:00 -0000 MIME-Version: 1.0 Content-Type: text/plain x-cbid: 18071619-0004-0000-0000-000014641F45 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009375; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01061752; UDB=6.00545109; IPR=6.00839656; MB=3.00022160; MTD=3.00000008; XFM=3.00000015; UTC=2018-07-16 19:11:27 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18071619-0005-0000-0000-0000881C2F43 Message-Id: <87zhyrxag5.fsf@linux.ibm.com> X-SW-Source: 2018-07/txt/msg00459.txt.bz2 Rogerio Alves writes: > I've make the changes you asked for. Thank you for your review. Patch v4 > is attached. I understand this patch solved all the requested changes. I found some minor issues, which I fixed myself and pushed it. > Subject: [PATCH v4] powerpc: Always restore TOC on longjmp. We usually mention the bug report in the commit title, e.g.: [PATCH v4] powerpc: Always restore TOC on longjmp [BZ #21895] > This patch change longjmp to always restore the TOC pointer (r2 register) > to the caller frame on powerpc. This is related to bug 21895[1] that reports > a situation where you have a static longjmp to a shared object file. > > [1] https://sourceware.org/bugzilla/show_bug.cgi?id=21895 > > 2018-05-16 Rogerio A. Cardoso Added 2 spaces around your name. We also mention the bug report in the ChangeLog entry, e.g.: [BZ #21895] > > *sysdeps/powerpc/powerpc64/__longjmp-common.S: Remove condition code for ^ Missing space here. > diff --git a/sysdeps/powerpc/powerpc64/setjmp-bug21895.c b/sysdeps/powerpc/powerpc64/setjmp-bug21895.c > new file mode 100644 > index 0000000..9e65f23 > --- /dev/null > +++ b/sysdeps/powerpc/powerpc64/setjmp-bug21895.c > @@ -0,0 +1,52 @@ > +/* Shared object part of test for setjmp interoperability with static > + dlopen BZ #21895. > + Copyright (C) 2017-2018 Free Software Foundation, Inc. > + This file is part of the GNU C Library. > + > + The GNU C Library is free software; you can redistribute it and/or > + modify it under the terms of the GNU Lesser General Public > + License as published by the Free Software Foundation; either > + version 2.1 of the License, or (at your option) any later version. > + > + The GNU C Library is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + Lesser General Public License for more details. > + > + You should have received a copy of the GNU Lesser General Public > + License along with the GNU C Library; if not, see > + . */ > + > +#include > +#include > + > +/* Copy r1 adress to a local variable. */ > +#define GET_STACK_POINTER(sp) \ > + ({ \ > + asm volatile ("mr %0, 1\n\t" \ > + : "=r" (sp) \ > + ); \ Replaced 8 spaces with tabs. > diff --git a/sysdeps/powerpc/powerpc64/tst-setjmp-bug21895-static.c b/sysdeps/powerpc/powerpc64/tst-setjmp-bug21895-static.c > new file mode 100644 > index 0000000..235ba50 > --- /dev/null > +++ b/sysdeps/powerpc/powerpc64/tst-setjmp-bug21895-static.c > @@ -0,0 +1,81 @@ > +/* Test setjmp interoperability with static dlopen BZ #21895. > + Copyright (C) 2017-2018 Free Software Foundation, Inc. > + This file is part of the GNU C Library. > + > + The GNU C Library is free software; you can redistribute it and/or > + modify it under the terms of the GNU Lesser General Public > + License as published by the Free Software Foundation; either > + version 2.1 of the License, or (at your option) any later version. > + > + The GNU C Library is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + Lesser General Public License for more details. > + > + You should have received a copy of the GNU Lesser General Public > + License along with the GNU C Library; if not, see > + . */ > + > +#include > +#include > +#include > +#include > + > +/* Set TOC area pointed by sp to zero. */ > +#define SET_TOC_TO_ZERO(sp) \ > + ({ \ > + unsigned int zero = 0; \ > + asm volatile( \ Likewise. > +/* Make sure the test will not stuck if jmp fails and fall into one of > + for(;;). */ > +#define TIMEOUT 100 I don't think this test needs 100s. I confirmed the default timeout (20s) is enough for this test and removed these 3 lines. Thanks! -- Tulio Magno