1 /* SPDX-License-Identifier: BSD-2-Clause */
2 /*
3  * Copyright (C) 2012 The Android Open Source Project
4  */
5 
6 #ifndef _LINK_H_
7 #define	_LINK_H_
8 
9 #include <elf.h>
10 #include <stddef.h>
11 
12 struct dl_phdr_info {
13 	Elf_Addr dlpi_addr;			/* module relocation base */
14 	const char *dlpi_name;			/* module name */
15 	const Elf_Phdr *dlpi_phdr;		/* pointer to module's phdr */
16 	Elf_Half dlpi_phnum;			/* number of entries in phdr */
17 	unsigned long long dlpi_adds;		/* total # of loads */
18 	unsigned long long dlpi_subs;		/* total # of unloads */
19 	size_t dlpi_tls_modid;
20 	void *dlpi_tls_data;
21 };
22 
23 int dl_iterate_phdr(int (*callback)(struct dl_phdr_info *info, size_t size,
24 				    void *data),
25 		    void *data);
26 
27 #endif /* _LINK_H_ */
28