* [PATCH] Apply i386/profil-counter.h changes to arm, sh and x86_64 too
@ 2002-10-14 7:27 Jakub Jelinek
0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2002-10-14 7:27 UTC (permalink / raw)
To: Ulrich Drepper, Roland McGrath; +Cc: Glibc hackers
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 <jakub@redhat.com>
* 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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-10-13 19:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-14 7:27 [PATCH] Apply i386/profil-counter.h changes to arm, sh and x86_64 too Jakub Jelinek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).