From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4408 invoked by alias); 13 Oct 2002 19:59:00 -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 4388 invoked from network); 13 Oct 2002 19:59:00 -0000 Received: from unknown (HELO sunsite.mff.cuni.cz) (195.113.19.66) by sources.redhat.com with SMTP; 13 Oct 2002 19:59:00 -0000 Received: (from jakub@localhost) by sunsite.mff.cuni.cz (8.11.6/8.11.6) id g9DJwu905534; Sun, 13 Oct 2002 21:58:56 +0200 Date: Mon, 14 Oct 2002 07:27:00 -0000 From: Jakub Jelinek To: Ulrich Drepper , Roland McGrath Cc: Glibc hackers Subject: [PATCH] Apply i386/profil-counter.h changes to arm, sh and x86_64 too Message-ID: <20021013215856.E3451@sunsite.ms.mff.cuni.cz> Reply-To: Jakub Jelinek Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i X-SW-Source: 2002-10/txt/msg00053.txt.bz2 Hi! These 3 arches apparently use some struct instead of struct * as argument to profil_counter, thus might see the same problem. Am not exactly sure whether all of the arches support sibcall already, at least x86_64 doesn't yet but probably will do soon, but it is better to do this now IMHO than to forget about it. 2002-10-13 Jakub Jelinek * sysdeps/unix/sysv/linux/arm/profil-counter.h (profil_counter): Add hack to prevent the compiler from clobbering the signal context. * sysdeps/unix/sysv/linux/sh/profil-counter.h (profil_counter): Likewise. * sysdeps/unix/sysv/linux/x86_64/profil-counter.h (profil_counter): Likewise. --- libc/sysdeps/unix/sysv/linux/sh/profil-counter.h.jj 2001-08-23 18:51:29.000000000 +0200 +++ libc/sysdeps/unix/sysv/linux/sh/profil-counter.h 2002-10-13 22:03:51.000000000 +0200 @@ -1,5 +1,5 @@ /* Low-level statistical profiling support function. Linux/SH version. - Copyright (C) 1996, 1997, 1998, 2000 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998, 2000, 2002 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 @@ -25,4 +25,9 @@ profil_counter (int signo, int _a2, int void *pc; pc = (void *) sc.sc_pc; profil_count (pc); + + /* This is a hack to prevent the compiler from implementing the + above function call as a sibcall. The sibcall would overwrite + the signal context. */ + asm volatile (""); } --- libc/sysdeps/unix/sysv/linux/arm/profil-counter.h.jj 2001-08-23 18:50:48.000000000 +0200 +++ libc/sysdeps/unix/sysv/linux/arm/profil-counter.h 2002-10-13 22:02:09.000000000 +0200 @@ -1,5 +1,5 @@ /* Low-level statistical profiling support function. Linux/ARM version. - Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998, 2002 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 @@ -29,4 +29,9 @@ profil_counter (int signo, int _a2, int else pc = (void *) sc.v21.arm_pc; profil_count (pc); + + /* This is a hack to prevent the compiler from implementing the + above function call as a sibcall. The sibcall would overwrite + the signal context. */ + asm volatile (""); } --- libc/sysdeps/unix/sysv/linux/x86_64/profil-counter.h.jj 2001-09-19 12:32:01.000000000 +0200 +++ libc/sysdeps/unix/sysv/linux/x86_64/profil-counter.h 2002-10-13 22:05:17.000000000 +0200 @@ -1,5 +1,5 @@ /* Low-level statistical profiling support function. Linux/x86-64 version. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001, 2002 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 @@ -24,4 +24,9 @@ static void profil_counter (int signo, SIGCONTEXT scp) { profil_count ((void *) GET_PC (scp)); + + /* This is a hack to prevent the compiler from implementing the + above function call as a sibcall. The sibcall would overwrite + the signal context. */ + asm volatile (""); } Jakub