RTEMS  5.0.0
rtl.h
Go to the documentation of this file.
1 /*
2  * COPYRIGHT (c) 2012, 2018 Chris Johns <chrisj@rtems.org>
3  *
4  * The license and distribution terms for this file may be
5  * found in the file LICENSE in this distribution or at
6  * http://www.rtems.org/license/LICENSE.
7  */
8 
19 #if !defined (_RTEMS_RTL_H_)
20 #define _RTEMS_RTL_H_
21 
22 #include <link.h>
23 #include <rtems/chain.h>
24 #include <rtems/thread.h>
25 
27 #include <rtems/rtl/rtl-archive.h>
28 #include <rtems/rtl/rtl-fwd.h>
29 #include <rtems/rtl/rtl-obj.h>
31 #include <rtems/rtl/rtl-obj-comp.h>
32 #include <rtems/rtl/rtl-sym.h>
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif /* __cplusplus */
38 
57 #ifdef __STDC__
58 #define RTL_XGLUE(a,b) a##b
59 #else
60 #define RTL_XGLUE(a,b) ab
61 #endif
62 
63 #define RTL_GLUE(a,b) RTL_XGLUE(a,b)
64 
68 #define RTEMS_RTL_SYMS_GLOBAL_BUCKETS (32)
69 
73 #define RTEMS_RTL_UNRESOLVED_BLOCK_SIZE (64)
74 
78 #define RTEMS_RTL_DEPENDENCY_BLOCK_SIZE (16)
79 
83 extern struct r_debug _rtld_debug;
84 
89 extern void _rtld_debug_state (void);
90 
94 typedef void (*rtems_rtl_cdtor)(void);
95 
105 {
106  rtems_recursive_mutex lock;
110  const char* paths;
120  char last_error[64];
121 };
122 
130 
139 
147 const char* rtems_rtl_last_error_unprotected (void);
148 
157 
165 
174 
182 
197 
201 void rtems_rtl_obj_caches_flush (void);
202 
213  rtems_rtl_obj_cache* cache,
214  int fd,
215  int compression,
216  off_t offset);
217 
226 void rtems_rtl_obj_update_flags (uint32_t clear, uint32_t set);
227 
236 
240 void rtems_rtl_unlock (void);
241 
251 rtems_rtl_obj* rtems_rtl_check_handle (void* handle);
252 
260 rtems_rtl_obj* rtems_rtl_find_obj (const char* name);
261 
270 
302 rtems_rtl_obj* rtems_rtl_load_object (const char* name, int mode);
303 
314 
323 rtems_rtl_obj* rtems_rtl_load (const char* name, int mode);
324 
335 bool rtems_rtl_unload (rtems_rtl_obj* obj);
336 
347 int rtems_rtl_get_error (char* message, size_t max_message);
348 
356 bool rtems_rtl_path_append (const char* path);
357 
366 bool rtems_rtl_path_prepend (const char* path);
367 
376 void rtems_rtl_base_sym_global_add (const unsigned char* esyms,
377  unsigned int count);
378 
389 
390 #ifdef __cplusplus
391 }
392 #endif /* __cplusplus */
393 
394 #endif
rtems_rtl_alloc_data allocator
Definition: rtl.h:107
const char * rtems_rtl_last_error_unprotected(void)
Definition: rtl.c:269
bool rtems_rtl_unload(rtems_rtl_obj *obj)
Definition: rtl.c:663
rtems_chain_control * rtems_rtl_pending_unprotected(void)
Definition: rtl.c:288
rtems_recursive_mutex lock
Definition: rtl.h:106
RTEMS Run-Time Linker Object File cache buffers a section of the object file in a buffer to localise ...
Definition: media-server.c:33
RTEMS Run-Time Linker ELF Headers.
rtems_rtl_obj_cache strings
Definition: rtl.h:116
rtems_rtl_obj * rtems_rtl_check_handle(void *handle)
Definition: rtl.c:422
void(* rtems_rtl_cdtor)(void)
Definition: rtl.h:94
RTEMS Run-Time Linker Object File Compression manages a compressed stream of data.
rtems_rtl_obj_comp decomp
Definition: rtl.h:118
Definition: rtl-obj-cache.h:53
rtems_rtl_unresolved unresolved
Definition: rtl.h:113
void rtems_rtl_unlock(void)
Definition: rtl.c:416
Definition: rtl-unresolved.h:142
void rtems_rtl_obj_caches(rtems_rtl_obj_cache **symbols, rtems_rtl_obj_cache **strings, rtems_rtl_obj_cache **relocs)
Definition: rtl.c:321
Definition: chain.h:83
rtems_chain_control pending
Definition: rtl.h:109
void rtems_rtl_obj_decompress(rtems_rtl_obj_comp **decomp, rtems_rtl_obj_cache *cache, int fd, int compression, off_t offset)
Definition: rtl.c:357
const char * paths
Definition: rtl.h:110
Definition: rtl-obj.h:183
RTEMS Run-Time Linker Object File Symbol Table.
bool rtems_rtl_unload_object(rtems_rtl_obj *obj)
Definition: rtl.c:629
int rtems_rtl_get_error(char *message, size_t max_message)
Definition: rtl-error.c:41
Definition: rtl-archive.h:102
rtems_rtl_obj * rtems_rtl_load_object(const char *name, int mode)
Definition: rtl.c:500
void rtems_rtl_obj_update_flags(uint32_t clear, uint32_t set)
Definition: rtl.c:393
rtems_rtl_symbols * rtems_rtl_global_symbols(void)
Definition: rtl.c:258
Definition: rtl.h:104
Definition: rtl-sym.h:29
Definition: link_elf.h:55
rtems_chain_control * rtems_rtl_objects_unprotected(void)
Definition: rtl.c:277
Definition: rtl-obj-comp.h:46
rtems_chain_control objects
Definition: rtl.h:108
bool rtems_rtl_path_prepend(const char *path)
Definition: rtl.c:831
RTEMS Run-Time Linker Archive.
rtems_rtl_obj * rtems_rtl_baseimage(void)
Definition: rtl.c:855
RTEMS Run-Time Linker Allocator.
char last_error[64]
Definition: rtl.h:120
Definition: rtl-sym.h:40
int last_errno
Definition: rtl.h:119
void _rtld_debug_state(void)
Definition: rtl-debugger.c:38
rtems_rtl_data * rtems_rtl_lock(void)
Definition: rtl.c:405
rtems_rtl_obj * rtems_rtl_load(const char *name, int mode)
Definition: rtl.c:566
rtems_rtl_data * rtems_rtl_data_unprotected(void)
Definition: rtl.c:252
rtems_rtl_obj_cache relocs
Definition: rtl.h:117
bool rtems_rtl_path_append(const char *path)
Definition: rtl.c:825
rtems_rtl_obj_cache symbols
Definition: rtl.h:115
Chain API.
rtems_rtl_archives * rtems_rtl_archives_unprotected(void)
Definition: rtl.c:310
rtems_rtl_obj * base
Definition: rtl.h:114
struct r_debug _rtld_debug
Definition: rtl-debugger.c:35
void rtems_rtl_base_sym_global_add(const unsigned char *esyms, unsigned int count)
Definition: rtl.c:837
RTEMS Run-Time Linker Object Support.
Definition: rtl-allocator.h:91
void rtems_rtl_obj_caches_flush(void)
Definition: rtl.c:346
rtems_rtl_symbols globals
Definition: rtl.h:111
rtems_rtl_unresolved * rtems_rtl_unresolved_unprotected(void)
Definition: rtl.c:299
RTEMS Run-Time Linker Object File Unresolved Relocations Table.
rtems_rtl_obj * rtems_rtl_find_obj_with_symbol(const rtems_rtl_obj_sym *sym)
Definition: rtl.c:478
rtems_rtl_obj * rtems_rtl_find_obj(const char *name)
Definition: rtl.c:442
rtems_rtl_archives archives
Definition: rtl.h:112