mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 19:52:45 +00:00 
			
		
		
		
	 89a38b72b7
			
		
	
	
		89a38b72b7
		
	
	
	
	
		
			
			This implements the dladdr() function which lets the caller look up the symbol name, symbol address as well as library name and library base address for an arbitrary address.
		
			
				
	
	
		
			32 lines
		
	
	
	
		
			556 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
	
		
			556 B
		
	
	
	
		
			C
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <sys/cdefs.h>
 | |
| 
 | |
| __BEGIN_DECLS
 | |
| 
 | |
| #define RTLD_DEFAULT 0
 | |
| #define RTLD_LAZY 2
 | |
| #define RTLD_NOW 4
 | |
| #define RTLD_GLOBAL 8
 | |
| #define RTLD_LOCAL 16
 | |
| 
 | |
| typedef struct __Dl_info {
 | |
|     const char* dli_fname;
 | |
|     void* dli_fbase;
 | |
|     const char* dli_sname;
 | |
|     void* dli_saddr;
 | |
| } Dl_info;
 | |
| 
 | |
| int dlclose(void*);
 | |
| char* dlerror();
 | |
| void* dlopen(const char*, int);
 | |
| void* dlsym(void*, const char*);
 | |
| int dladdr(void*, Dl_info*);
 | |
| 
 | |
| __END_DECLS
 |