]>
Commit | Line | Data |
---|---|---|
5ad49c07 | 1 | /* Helper definitions for profiling of shared libraries. |
dff8da6b | 2 | Copyright (C) 1998-2024 Free Software Foundation, Inc. |
5ad49c07 | 3 | This file is part of the GNU C Library. |
5ad49c07 UD |
4 | |
5 | The GNU C Library is free software; you can redistribute it and/or | |
41bdb6e2 AJ |
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. | |
5ad49c07 UD |
9 | |
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 | |
41bdb6e2 | 13 | Lesser General Public License for more details. |
5ad49c07 | 14 | |
41bdb6e2 | 15 | You should have received a copy of the GNU Lesser General Public |
59ba27a6 | 16 | License along with the GNU C Library; if not, see |
5a82c748 | 17 | <https://www.gnu.org/licenses/>. */ |
5ad49c07 UD |
18 | |
19 | #include <dlfcn.h> | |
20 | #include <elf.h> | |
a42195db | 21 | #include <ldsodefs.h> |
d9784265 | 22 | #include <shlib-compat.h> |
5ad49c07 UD |
23 | |
24 | /* This is the map for the shared object we profile. It is defined here | |
25 | only because we test for this value being NULL or not. */ | |
5ad49c07 | 26 | |
d9784265 L |
27 | #if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_40) |
28 | attribute_compat_text_section | |
5ad49c07 | 29 | void |
b3fc5f84 | 30 | _dl_mcount_wrapper (void *selfpc) |
5ad49c07 | 31 | { |
154d10bd | 32 | GLRO(dl_mcount) ((ElfW(Addr)) RETURN_ADDRESS (0), (ElfW(Addr)) selfpc); |
5ad49c07 UD |
33 | } |
34 | ||
d9784265 L |
35 | compat_symbol (libc, _dl_mcount_wrapper, _dl_mcount_wrapper, GLIBC_2_1); |
36 | #endif | |
5ad49c07 UD |
37 | |
38 | void | |
39 | _dl_mcount_wrapper_check (void *selfpc) | |
40 | { | |
d6b5d570 | 41 | if (GL(dl_profile_map) != NULL) |
154d10bd | 42 | GLRO(dl_mcount) ((ElfW(Addr)) RETURN_ADDRESS (0), (ElfW(Addr)) selfpc); |
5ad49c07 | 43 | } |
5656e294 | 44 | libc_hidden_def (_dl_mcount_wrapper_check) |