mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-05 21:00:05 +00:00
(profil_counter): Add hack to prevent the compiler from clobbering the signal context.
This commit is contained in:
parent
4083e0ec25
commit
5e3ab761da
@ -1,5 +1,5 @@
|
|||||||
/* Low-level statistical profiling support function. Linux/ARM version.
|
/* 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.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -29,4 +29,9 @@ profil_counter (int signo, int _a2, int _a3, int _a4, union k_sigcontext sc)
|
|||||||
else
|
else
|
||||||
pc = (void *) sc.v21.arm_pc;
|
pc = (void *) sc.v21.arm_pc;
|
||||||
profil_count (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 ("");
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Low-level statistical profiling support function. Linux/SH version.
|
/* 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.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -25,4 +25,9 @@ profil_counter (int signo, int _a2, int _a3, int _a4, struct sigcontext sc)
|
|||||||
void *pc;
|
void *pc;
|
||||||
pc = (void *) sc.sc_pc;
|
pc = (void *) sc.sc_pc;
|
||||||
profil_count (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 ("");
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Low-level statistical profiling support function. Linux/x86-64 version.
|
/* 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.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
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_counter (int signo, SIGCONTEXT scp)
|
||||||
{
|
{
|
||||||
profil_count ((void *) GET_PC (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 ("");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user