From patchwork Thu Mar 1 23:08:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Jarno X-Patchwork-Id: 26148 Received: (qmail 10039 invoked by alias); 1 Mar 2018 23:09:03 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 10029 invoked by uid 89); 1 Mar 2018 23:09:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=halt, H*r:120, outermost X-HELO: hall.aurel32.net From: Aurelien Jarno To: libc-alpha@sourceware.org Cc: Aurelien Jarno Subject: [PATCH] alpha: Add cfi information for _startcontext routines to stop unwinding [BZ#22910] Date: Fri, 2 Mar 2018 00:08:56 +0100 Message-Id: <20180301230856.18317-1-aurelien@aurel32.net> Starting with GCC 8, libgc1c is better at unwinding on alpha. This causes backtrace called within a context created by makecontext to yield infinite backtrace. This patch adds cfi information for _startcontext and ra which marks the frame as outermost frame. This fixes tst-makecontext for alpha. --- ChangeLog | 6 ++++++ sysdeps/unix/sysv/linux/alpha/makecontext.S | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index 4b7e0a0261..8ea10886e3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2018-03-01 Aurelien Jarno + + [BZ #22910] + * sysdeps/unix/sysv/linux/alpha/setcontext.S (__startcontext): Set + up CFI directive to forbid further backtracing. + 2018-03-01 Maciej W. Rozycki * nptl_db/td_ta_thr_iter.c (iterate_thread_list): Remove diff --git a/sysdeps/unix/sysv/linux/alpha/makecontext.S b/sysdeps/unix/sysv/linux/alpha/makecontext.S index cae2144e03..cc824dfe25 100644 --- a/sysdeps/unix/sysv/linux/alpha/makecontext.S +++ b/sysdeps/unix/sysv/linux/alpha/makecontext.S @@ -138,10 +138,14 @@ weak_alias (__makecontext, makecontext) .align 4 .ent __startcontext + cfi_startproc __startcontext: .frame $31, 0, $31, 0 .prologue 0 + /* Mark ra as undefined in order to stop unwinding here. */ + cfi_undefined(ra) + jsr $26, ($27), 0 ldgp $29, 0($26) mov $9, $16 @@ -160,4 +164,5 @@ __startcontext: halt + cfi_endproc .end __startcontext