From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28041 invoked by alias); 29 Mar 2003 06:59:49 -0000 Mailing-List: contact libc-hacker-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sources.redhat.com Received: (qmail 28025 invoked from network); 29 Mar 2003 06:59:48 -0000 Received: from unknown (HELO palrel10.hp.com) (156.153.255.245) by sources.redhat.com with SMTP; 29 Mar 2003 06:59:48 -0000 Received: from hplms2.hpl.hp.com (hplms2.hpl.hp.com [15.0.152.33]) by palrel10.hp.com (Postfix) with ESMTP id 7B92B1C0121C for ; Fri, 28 Mar 2003 22:59:48 -0800 (PST) Received: from napali.hpl.hp.com (napali.hpl.hp.com [15.4.89.123]) by hplms2.hpl.hp.com (8.10.2/8.10.2 HPL-PA Hub) with ESMTP id h2T6xlA15697 for ; Fri, 28 Mar 2003 22:59:48 -0800 (PST) Received: from napali.hpl.hp.com (localhost [127.0.0.1]) by napali.hpl.hp.com (8.12.3/8.12.3/Debian-5) with ESMTP id h2T6xlLA002987 for ; Fri, 28 Mar 2003 22:59:47 -0800 Received: (from davidm@localhost) by napali.hpl.hp.com (8.12.3/8.12.3/Debian-5) id h2T6xlPU002983; Fri, 28 Mar 2003 22:59:47 -0800 Date: Sat, 29 Mar 2003 19:20:00 -0000 From: David Mosberger Message-Id: <200303290659.h2T6xlPU002983@napali.hpl.hp.com> To: libc-hacker@sources.redhat.com Subject: ia64: a few more unwind-related fixes Reply-To: davidm@hpl.hp.com X-SW-Source: 2003-03/txt/msg00138.txt.bz2 Below are a couple of more unwind-related fixes to ia64-specific code. "make check" passes as before. --david 2003-03-27 David Mosberger * sysdeps/ia64/dl-machine.h (RTLD_START): Wrap ".save rp, r0" directive into empty .prologue region to ensure that call-chain is terminated even for the first instruction. * sysdeps/ia64/elf/start.S (_start): Use ".save rp, r0" idiom to terminate call-chain right from the get-go. * sysdeps/unix/sysv/linux/ia64/fork.S (fork): Remove unnecessary stop bit between compare & branch. * sysdeps/unix/sysv/linux/ia64/sysdep.S (__syscall_error): Bring register usage in sync with unwind info (ar.pfs is saved in r33, according to unwind info). Index: sysdeps/ia64/dl-machine.h =================================================================== RCS file: /cvs/glibc/libc/sysdeps/ia64/dl-machine.h,v retrieving revision 1.22 diff -u -r1.22 dl-machine.h --- sysdeps/ia64/dl-machine.h 12 Jan 2003 08:54:00 -0000 1.22 +++ sysdeps/ia64/dl-machine.h 29 Mar 2003 06:53:06 -0000 @@ -301,8 +301,10 @@ "_start:\n" \ "0: { .mii\n" \ " .prologue\n" \ -" .save ar.pfs, r32\n" \ " .save rp, r0\n" \ +" .body\n" \ +" .prologue\n" \ +" .save ar.pfs, r32\n" \ " alloc loc0 = ar.pfs, 0, 3, 4, 0\n" \ " .body\n" \ " mov r2 = ip\n" \ @@ -332,8 +334,10 @@ " .proc _dl_start_user#\n" \ "_dl_start_user:\n" \ " .prologue\n" \ -" .save ar.pfs, r32\n" \ " .save rp, r0\n" \ +" .body\n" \ +" .prologue\n" \ +" .save ar.pfs, r32\n" \ " .body\n" \ " { .mii\n" \ " /* Save the pointer to the user entry point fptr in loc2. */\n" \ Index: sysdeps/ia64/elf/start.S =================================================================== RCS file: /cvs/glibc/libc/sysdeps/ia64/elf/start.S,v retrieving revision 1.11 diff -u -r1.11 start.S --- sysdeps/ia64/elf/start.S 9 Dec 2002 20:37:21 -0000 1.11 +++ sysdeps/ia64/elf/start.S 29 Mar 2003 06:53:06 -0000 @@ -40,6 +40,9 @@ .type _start,@function _start: .prologue + .save rp, r0 + .body + .prologue { .mlx alloc r2 = ar.pfs,0,0,7,0 movl r3 = FPSR_DEFAULT @@ -76,8 +79,7 @@ { .mmi ld8 out3 = [out3] /* pointer to `init' function descriptor */ ld8 out4 = [out4] /* pointer to `fini' function descriptor */ - .save rp, r4 - mov r4 = r0 /* terminate unwind chain with a NULL return-pointer */ + nop 0 } .body { .mib Index: sysdeps/unix/sysv/linux/ia64/fork.S =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/ia64/fork.S,v retrieving revision 1.6 diff -u -r1.6 fork.S --- sysdeps/unix/sysv/linux/ia64/fork.S 31 Dec 2002 20:37:30 -0000 1.6 +++ sysdeps/unix/sysv/linux/ia64/fork.S 29 Mar 2003 06:53:07 -0000 @@ -32,7 +32,6 @@ ;; DO_CALL (SYS_ify (clone)) cmp.eq p6,p0=-1,r10 - ;; (p6) br.cond.spnt.few __syscall_error ret PSEUDO_END(__libc_fork) Index: sysdeps/unix/sysv/linux/ia64/sysdep.S =================================================================== RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/ia64/sysdep.S,v retrieving revision 1.5 diff -u -r1.5 sysdep.S --- sysdeps/unix/sysv/linux/ia64/sysdep.S 11 Oct 2002 10:51:24 -0000 1.5 +++ sysdeps/unix/sysv/linux/ia64/sysdep.S 29 Mar 2003 06:53:07 -0000 @@ -1,4 +1,4 @@ -/* Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1999, 2000, 2001, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by David Mosberger-Tang . @@ -23,18 +23,19 @@ ENTRY(__syscall_error) #ifdef _LIBC_REENTRANT .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(0) - alloc r35=ar.pfs, 0, 4, 0, 0 + alloc r33=ar.pfs, 0, 4, 0, 0 mov r32=rp - mov r33=r8 + .body + mov r35=r8 mov r34=r1 ;; - br.call.sptk.many b0 = __errno_location# + br.call.sptk.many b0 = __errno_location .Lret0: /* force new bundle */ - st4 [r8]=r33 + st4 [r8]=r35 mov r1=r34 mov rp=r32 mov r8=-1 - mov ar.pfs=r35 + mov ar.pfs=r33 #else /* _LIBC_REENTRANT */ /* * Note that the gp has to be set properly for this to work.