From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-4.1 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 2E29F20248 for ; Thu, 7 Mar 2019 01:53:00 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; q=dns; s=default; b=y6AyvDVT DwkRbOpgobvd95U8K650ztSG8zU8JmQjfbfnFuiC2WuiLU7VzVvBSkt7XWEoo0mz CSNC+sjSEElCRfhwLzJusiYqApM/MSwwfY14lwTdqV7oT96NzG9IvTw0vd/TrCii aV1k0WI4kaDF0V+LASZOQ2PA4TO1NKwfgto= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; s=default; bh=KEeePJvwuYVmIA QqRQJ8ycpa3N8=; b=nK7tMKNEF2+gaHCvRuTwFPNF1rL5gUiM4pxU4iPWjBjokV A8K0/AKhoy2EZGaKjssQPFedysGEz8u+FKeiLk9/TlG75529zPcYcEpYi0cW87PR MIIqpfoLakiRcJzLEoA5YDhQAcviCaVhj2lbDA0eFjmn1cViMpaT5BCDixDr0= Received: (qmail 75770 invoked by alias); 7 Mar 2019 01:52:45 -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 Received: (qmail 75566 invoked by uid 89); 7 Mar 2019 01:52:44 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: vmh-VirtualBox From: Mao Han To: libc-alpha@sourceware.org Cc: Mao Han Subject: [PATCH 3/4] C-SKY: mark lr as undefined to stop unwinding Date: Thu, 7 Mar 2019 09:34:05 +0800 Message-Id: <52cd01f3630c1c06c0d526e30acd6f4a0a3c3f4f.1551922357.git.han_mao@c-sky.com> In-Reply-To: References: In-Reply-To: References: Mark the lr register as undefined at the start of execution, so unwind will stop at this frame. run-backtrace-*.sh from elfutils testsuite will fail without this patch. * sysdeps/csky/abiv2/start.S: Likewise. * sysdeps/unix/sysv/linux/csky/abiv1/setcontext.S: Likewise. * sysdeps/unix/sysv/linux/csky/abiv2/setcontext.S: Likewise. --- ChangeLog | 6 ++++++ sysdeps/csky/abiv2/start.S | 4 ++++ sysdeps/unix/sysv/linux/csky/abiv2/clone.S | 7 +++++-- sysdeps/unix/sysv/linux/csky/abiv2/setcontext.S | 2 ++ 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 713e512..c95dfbc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2019-02-15 Mao Han + * sysdeps/csky/abiv2/start.S: Likewise. + * sysdeps/unix/sysv/linux/csky/abiv2/clone.S: Likewise. + * sysdeps/unix/sysv/linux/csky/abiv2/setcontext.S: Likewise. + +2019-02-13 Mao Han + * sysdeps/unix/sysv/linux/csky/sys/procfs.h: Use linux definition directly. * sysdeps/unix/sysv/linux/csky/sys/user.h: Remove user_regs diff --git a/sysdeps/csky/abiv2/start.S b/sysdeps/csky/abiv2/start.S index 324ed69..b1e6152 100644 --- a/sysdeps/csky/abiv2/start.S +++ b/sysdeps/csky/abiv2/start.S @@ -46,6 +46,9 @@ .type _start,@function; .align 4; _start: + cfi_startproc + .cfi_label .Ldummy + cfi_undefined (lr) subi sp, 8 /* Clear the link register since this is the outermost frame. */ movi lr, 0 @@ -96,6 +99,7 @@ _start: /* Should never get here. */ jsri abort #endif /* !SHARED */ + cfi_endproc .size _start,.-_start diff --git a/sysdeps/unix/sysv/linux/csky/abiv2/clone.S b/sysdeps/unix/sysv/linux/csky/abiv2/clone.S index 3e7328a..c1352ee 100644 --- a/sysdeps/unix/sysv/linux/csky/abiv2/clone.S +++ b/sysdeps/unix/sysv/linux/csky/abiv2/clone.S @@ -54,7 +54,7 @@ ENTRY (__clone) btsti a0, 31 /* Check if return is less than zero. */ bt __do_syscall_error cmpnei a0, 0 - bf __child + bf __thread_start rts __error_arg: @@ -81,7 +81,9 @@ __do_syscall_error: rts PSEUDO_END (__clone) -__child: +ENTRY (__thread_start) + .cfi_label .Ldummy + cfi_undefined (lr) ldw a0, (sp, 4) /* Restore args from new sp. */ ldw a1, (sp, 0) /* Restore function from new sp. */ addi sp, 8 @@ -90,6 +92,7 @@ __child: /* exit */ lrw r7, __NR_exit trap 0 +END (__thread_start) libc_hidden_def (__clone) weak_alias (__clone, clone) diff --git a/sysdeps/unix/sysv/linux/csky/abiv2/setcontext.S b/sysdeps/unix/sysv/linux/csky/abiv2/setcontext.S index 6d3f04f..34de6e3 100644 --- a/sysdeps/unix/sysv/linux/csky/abiv2/setcontext.S +++ b/sysdeps/unix/sysv/linux/csky/abiv2/setcontext.S @@ -62,6 +62,8 @@ END (setcontext) weak_alias (__setcontext, setcontext) ENTRY (__startcontext) + .cfi_label .Ldummy + cfi_undefined (lr) mov a0, r9 cmpnei r9, 0 /* r9 was set in makecontext. */ bf 1f /* null, then exit. */ -- 2.7.4