1 /* PowerPC-specific implementation of profiling support.
2 Copyright (C) 1997, 1999, 2005, 2006 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, write to the Free
17 Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA
20 /* This would be bad. */
27 /* We do profiling as described in the SYSV ELF ABI, except that glibc
28 _mcount manages its own counters. The caller has put the address the
29 caller will return to in the usual place on the stack, 4(r1). _mcount
30 is responsible for ensuring that when it returns no argument-passing
31 registers are disturbed, and that the LR is set back to (what the
32 caller sees as) 4(r1).
34 This is intended so that the following code can be inserted at the
35 front of any routine without changing the routine:
45 cfi_adjust_cfa_offset (48)
46 /* We need to save the parameter-passing registers. */
61 bl __mcount_internal@local
63 /* Restore the registers... */
78 /* ...unwind the stack frame, and return to your usual programming. */