Changeset View
Changeset View
Standalone View
Standalone View
src/track/heaptrack_inject.cpp
Show All 11 Lines | |||||
12 | * Lesser General Public License for more details. | 12 | * Lesser General Public License for more details. | ||
13 | * | 13 | * | ||
14 | * You should have received a copy of the GNU Lesser General Public | 14 | * You should have received a copy of the GNU Lesser General Public | ||
15 | * License along with this library; if not, write to the Free Software | 15 | * License along with this library; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
17 | */ | 17 | */ | ||
18 | 18 | | |||
19 | #include "libheaptrack.h" | 19 | #include "libheaptrack.h" | ||
20 | #include "util/config.h" | ||||
20 | 21 | | |||
21 | #include <cstdlib> | 22 | #include <cstdlib> | ||
22 | #include <cstring> | 23 | #include <cstring> | ||
23 | 24 | | |||
24 | #include <link.h> | 25 | #include <link.h> | ||
25 | #include <malloc.h> | 26 | #include <malloc.h> | ||
26 | 27 | | |||
27 | #include <sys/mman.h> | 28 | #include <sys/mman.h> | ||
Show All 9 Lines | |||||
37 | #if __WORDSIZE == 64 | 38 | #if __WORDSIZE == 64 | ||
38 | #define ELF_R_SYM(i) ELF64_R_SYM(i) | 39 | #define ELF_R_SYM(i) ELF64_R_SYM(i) | ||
39 | #elif __WORDSIZE == 32 | 40 | #elif __WORDSIZE == 32 | ||
40 | #define ELF_R_SYM(i) ELF32_R_SYM(i) | 41 | #define ELF_R_SYM(i) ELF32_R_SYM(i) | ||
41 | #else | 42 | #else | ||
42 | #error unsupported word size | 43 | #error unsupported word size | ||
43 | #endif | 44 | #endif | ||
44 | 45 | | |||
45 | #if defined(_BSD_SOURCE) || defined(_SVID_SOURCE) || defined(__USE_MISC) | | |||
46 | #define HAVE_CFREE 1 | | |||
47 | #else | | |||
48 | #define HAVE_CFREE 0 | | |||
49 | #endif | | |||
50 | | ||||
51 | namespace { | 46 | namespace { | ||
52 | 47 | | |||
53 | namespace Elf { | 48 | namespace Elf { | ||
54 | using Addr = ElfW(Addr); | 49 | using Addr = ElfW(Addr); | ||
55 | using Dyn = ElfW(Dyn); | 50 | using Dyn = ElfW(Dyn); | ||
56 | using Rela = ElfW(Rela); | 51 | using Rela = ElfW(Rela); | ||
57 | using Sym = ElfW(Sym); | 52 | using Sym = ElfW(Sym); | ||
58 | using Sxword = ElfW(Sxword); | 53 | using Sxword = ElfW(Sxword); | ||
▲ Show 20 Lines • Show All 239 Lines • Show Last 20 Lines |