RTEMS  5.1
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 
59 #ifdef __STDC__
60 #define RTL_XGLUE(a,b) a##b
61 #else
62 #define RTL_XGLUE(a,b) ab
63 #endif
64 
65 #define RTL_GLUE(a,b) RTL_XGLUE(a,b)
66 
70 #define RTEMS_RTL_SYMS_GLOBAL_BUCKETS (32)
71 
75 #define RTEMS_RTL_UNRESOLVED_BLOCK_SIZE (256)
76 
80 #define RTEMS_RTL_DEPENDENCY_BLOCK_SIZE (16)
81 
85 extern struct r_debug _rtld_debug;
86 
91 extern void _rtld_debug_state (void);
92 
96 typedef void (*rtems_rtl_cdtor)(void);
97 
107 {
108  rtems_recursive_mutex lock;
112  const char* paths;
122  char last_error[64];
123 };
124 
132 
141 
149 const char* rtems_rtl_last_error_unprotected (void);
150 
159 
167 
176 
184 
197  rtems_rtl_obj_cache** strings,
198  rtems_rtl_obj_cache** relocs);
199 
203 void rtems_rtl_obj_caches_flush (void);
204 
215  rtems_rtl_obj_cache* cache,
216  int fd,
217  int compression,
218  off_t offset);
219 
228 void rtems_rtl_obj_update_flags (uint32_t clear, uint32_t set);
229 
238 
242 void rtems_rtl_unlock (void);
243 
253 rtems_rtl_obj* rtems_rtl_check_handle (void* handle);
254 
262 rtems_rtl_obj* rtems_rtl_find_obj (const char* name);
263 
272 
304 rtems_rtl_obj* rtems_rtl_load_object (const char* name, int mode);
305 
316 
325 rtems_rtl_obj* rtems_rtl_load (const char* name, int mode);
326 
337 bool rtems_rtl_unload (rtems_rtl_obj* obj);
338 
349 int rtems_rtl_get_error (char* message, size_t max_message);
350 
358 bool rtems_rtl_path_append (const char* path);
359 
368 bool rtems_rtl_path_prepend (const char* path);
369 
378 void rtems_rtl_base_sym_global_add (const unsigned char* esyms,
379  unsigned int count);
380 
391 
392 #ifdef __cplusplus
393 }
394 #endif /* __cplusplus */
395 
396 #endif
rtems_rtl_alloc_data allocator
Definition: rtl.h:109
const char * rtems_rtl_last_error_unprotected(void)
Definition: rtl.c:269
bool rtems_rtl_unload(rtems_rtl_obj *obj)
Definition: rtl.c:666
rtems_chain_control * rtems_rtl_pending_unprotected(void)
Definition: rtl.c:288
rtems_recursive_mutex lock
Definition: rtl.h:108
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:118
rtems_rtl_obj * rtems_rtl_check_handle(void *handle)
Definition: rtl.c:422
void(* rtems_rtl_cdtor)(void)
Definition: rtl.h:96
RTEMS Run-Time Linker Object File Compression manages a compressed stream of data.
rtems_rtl_obj_comp decomp
Definition: rtl.h:120
Definition: rtl-obj-cache.h:53
rtems_rtl_unresolved unresolved
Definition: rtl.h:115
void rtems_rtl_unlock(void)
Definition: rtl.c:416
Definition: rtl-unresolved.h:156
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:86
rtems_chain_control pending
Definition: rtl.h:111
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:112
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:632
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:503
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:106
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:110
bool rtems_rtl_path_prepend(const char *path)
Definition: rtl.c:834
RTEMS Run-Time Linker Archive.
rtems_rtl_obj * rtems_rtl_baseimage(void)
Definition: rtl.c:858
RTEMS Run-Time Linker Allocator.
char last_error[64]
Definition: rtl.h:122
Definition: rtl-sym.h:40
int last_errno
Definition: rtl.h:121
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:569
rtems_rtl_data * rtems_rtl_data_unprotected(void)
Definition: rtl.c:252
rtems_rtl_obj_cache relocs
Definition: rtl.h:119
bool rtems_rtl_path_append(const char *path)
Definition: rtl.c:828
rtems_rtl_obj_cache symbols
Definition: rtl.h:117
Chain API.
rtems_rtl_archives * rtems_rtl_archives_unprotected(void)
Definition: rtl.c:310
rtems_rtl_obj * base
Definition: rtl.h:116
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:840
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:113
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:114