RTEMS: cpukit/include/rtems/rtl/rtl.h Source File

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
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
26#include <rtems/rtl/rtl-allocator.h>
27#include <rtems/rtl/rtl-archive.h>
28#include <rtems/rtl/rtl-fwd.h>
29#include <rtems/rtl/rtl-obj.h>
30#include <rtems/rtl/rtl-obj-cache.h>
31#include <rtems/rtl/rtl-obj-comp.h>
32#include <rtems/rtl/rtl-sym.h>
33#include <rtems/rtl/rtl-unresolved.h>
34
35#ifdef __cplusplus
36extern "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
85extern struct r_debug _rtld_debug;
86
91void _rtld_debug_state (void);
92
96 typedef void (*rtems_rtl_cdtor)(void);
97
106 struct rtems_rtl_data
107{
108 rtems_recursive_mutex lock;
109 rtems_rtl_alloc_data allocator;
110 rtems_chain_control objects;
111 rtems_chain_control pending;
112 const char* paths;
113 rtems_rtl_symbols globals;
114 rtems_rtl_archives archives;
115 rtems_rtl_unresolved unresolved;
116 rtems_rtl_obj* base;
117 rtems_rtl_obj_cache symbols;
118 rtems_rtl_obj_cache strings;
119 rtems_rtl_obj_cache relocs;
120 rtems_rtl_obj_comp decomp;
121 int last_errno;
122 char last_error[64];
123};
124
131 rtems_rtl_data* rtems_rtl_data_unprotected (void);
132
140 rtems_rtl_symbols* rtems_rtl_global_symbols (void);
141
149const char* rtems_rtl_last_error_unprotected (void);
150
158 rtems_chain_control* rtems_rtl_objects_unprotected (void);
159
166 rtems_chain_control* rtems_rtl_pending_unprotected (void);
167
175 rtems_rtl_unresolved* rtems_rtl_unresolved_unprotected (void);
176
183 rtems_rtl_archives* rtems_rtl_archives_unprotected (void);
184
196void rtems_rtl_obj_caches (rtems_rtl_obj_cache** symbols,
197 rtems_rtl_obj_cache** strings,
198 rtems_rtl_obj_cache** relocs);
199
203void rtems_rtl_obj_caches_flush (void);
204
214void rtems_rtl_obj_decompress (rtems_rtl_obj_comp** decomp,
215 rtems_rtl_obj_cache* cache,
216 int fd,
217 int compression,
218 off_t offset);
219
228void rtems_rtl_obj_update_flags (uint32_t clear, uint32_t set);
229
237 rtems_rtl_data* rtems_rtl_lock (void);
238
242void 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
271 rtems_rtl_obj* rtems_rtl_find_obj_with_symbol (const rtems_rtl_obj_sym* sym);
272
304 rtems_rtl_obj* rtems_rtl_load_object (const char* name, int mode);
305
315bool rtems_rtl_unload_object (rtems_rtl_obj* obj);
316
325 rtems_rtl_obj* rtems_rtl_load (const char* name, int mode);
326
337bool rtems_rtl_unload (rtems_rtl_obj* obj);
338
349int rtems_rtl_get_error (char* message, size_t max_message);
350
358bool rtems_rtl_path_append (const char* path);
359
368bool rtems_rtl_path_prepend (const char* path);
369
378void rtems_rtl_base_sym_global_add (const unsigned char* esyms,
379 unsigned int count);
380
390 rtems_rtl_obj* rtems_rtl_baseimage (void);
391
392#ifdef __cplusplus
393}
394#endif /* __cplusplus */
395
396#endif
chain.h
Chain API.
rtl-allocator.h
RTEMS Run-Time Linker Allocator.
rtl-archive.h
RTEMS Run-Time Linker Archive.
rtl-fwd.h
RTEMS Run-Time Linker ELF Headers.
rtl-obj-cache.h
RTEMS Run-Time Linker Object File cache buffers a section of the object file in a buffer to localise ...
rtl-obj-comp.h
RTEMS Run-Time Linker Object File Compression manages a compressed stream of data.
rtl-obj.h
RTEMS Run-Time Linker Object Support.
rtl-sym.h
RTEMS Run-Time Linker Object File Symbol Table.
rtl-unresolved.h
RTEMS Run-Time Linker Object File Unresolved Relocations Table.
rtems_rtl_baseimage
rtems_rtl_obj * rtems_rtl_baseimage(void)
Definition: rtl.c:858
rtems_rtl_unload_object
bool rtems_rtl_unload_object(rtems_rtl_obj *obj)
Definition: rtl.c:632
rtems_rtl_obj_decompress
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
_rtld_debug_state
void _rtld_debug_state(void)
Definition: rtl-debugger.c:38
rtems_rtl_cdtor
void(* rtems_rtl_cdtor)(void)
Definition: rtl.h:96
rtems_rtl_last_error_unprotected
const char * rtems_rtl_last_error_unprotected(void)
Definition: rtl.c:269
rtems_rtl_unload
bool rtems_rtl_unload(rtems_rtl_obj *obj)
Definition: rtl.c:666
rtems_rtl_find_obj
rtems_rtl_obj * rtems_rtl_find_obj(const char *name)
Definition: rtl.c:442
rtems_rtl_check_handle
rtems_rtl_obj * rtems_rtl_check_handle(void *handle)
Definition: rtl.c:422
rtems_rtl_pending_unprotected
rtems_chain_control * rtems_rtl_pending_unprotected(void)
Definition: rtl.c:288
rtems_rtl_get_error
int rtems_rtl_get_error(char *message, size_t max_message)
Definition: rtl-error.c:41
rtems_rtl_lock
rtems_rtl_data * rtems_rtl_lock(void)
Definition: rtl.c:405
rtems_rtl_load
rtems_rtl_obj * rtems_rtl_load(const char *name, int mode)
Definition: rtl.c:569
rtems_rtl_global_symbols
rtems_rtl_symbols * rtems_rtl_global_symbols(void)
Definition: rtl.c:258
rtems_rtl_objects_unprotected
rtems_chain_control * rtems_rtl_objects_unprotected(void)
Definition: rtl.c:277
rtems_rtl_base_sym_global_add
void rtems_rtl_base_sym_global_add(const unsigned char *esyms, unsigned int count)
Definition: rtl.c:840
rtems_rtl_find_obj_with_symbol
rtems_rtl_obj * rtems_rtl_find_obj_with_symbol(const rtems_rtl_obj_sym *sym)
Definition: rtl.c:478
rtems_rtl_path_append
bool rtems_rtl_path_append(const char *path)
Definition: rtl.c:828
rtems_rtl_unresolved_unprotected
rtems_rtl_unresolved * rtems_rtl_unresolved_unprotected(void)
Definition: rtl.c:299
rtems_rtl_data_unprotected
rtems_rtl_data * rtems_rtl_data_unprotected(void)
Definition: rtl.c:252
rtems_rtl_archives_unprotected
rtems_rtl_archives * rtems_rtl_archives_unprotected(void)
Definition: rtl.c:310
rtems_rtl_path_prepend
bool rtems_rtl_path_prepend(const char *path)
Definition: rtl.c:834
rtems_rtl_obj_caches
void rtems_rtl_obj_caches(rtems_rtl_obj_cache **symbols, rtems_rtl_obj_cache **strings, rtems_rtl_obj_cache **relocs)
Definition: rtl.c:321
rtems_rtl_obj_update_flags
void rtems_rtl_obj_update_flags(uint32_t clear, uint32_t set)
Definition: rtl.c:393
rtems_rtl_obj_caches_flush
void rtems_rtl_obj_caches_flush(void)
Definition: rtl.c:346
_rtld_debug
struct r_debug _rtld_debug
Definition: rtl-debugger.c:35
rtems_rtl_load_object
rtems_rtl_obj * rtems_rtl_load_object(const char *name, int mode)
Definition: rtl.c:503
rtems_rtl_unlock
void rtems_rtl_unlock(void)
Definition: rtl.c:416
message
Definition: media-server.c:33
r_debug
Definition: link_elf.h:59
rtems_rtl_alloc_data
Definition: rtl-allocator.h:91
rtems_rtl_archives
Definition: rtl-archive.h:103
rtems_rtl_data
Definition: rtl.h:107
rtems_rtl_data::lock
rtems_recursive_mutex lock
Definition: rtl.h:108
rtems_rtl_data::last_error
char last_error[64]
Definition: rtl.h:122
rtems_rtl_data::globals
rtems_rtl_symbols globals
Definition: rtl.h:113
rtems_rtl_data::pending
rtems_chain_control pending
Definition: rtl.h:111
rtems_rtl_data::decomp
rtems_rtl_obj_comp decomp
Definition: rtl.h:120
rtems_rtl_data::symbols
rtems_rtl_obj_cache symbols
Definition: rtl.h:117
rtems_rtl_data::archives
rtems_rtl_archives archives
Definition: rtl.h:114
rtems_rtl_data::unresolved
rtems_rtl_unresolved unresolved
Definition: rtl.h:115
rtems_rtl_data::allocator
rtems_rtl_alloc_data allocator
Definition: rtl.h:109
rtems_rtl_data::paths
const char * paths
Definition: rtl.h:112
rtems_rtl_data::last_errno
int last_errno
Definition: rtl.h:121
rtems_rtl_data::strings
rtems_rtl_obj_cache strings
Definition: rtl.h:118
rtems_rtl_data::objects
rtems_chain_control objects
Definition: rtl.h:110
rtems_rtl_data::base
rtems_rtl_obj * base
Definition: rtl.h:116
rtems_rtl_data::relocs
rtems_rtl_obj_cache relocs
Definition: rtl.h:119
rtems_rtl_obj_cache
Definition: rtl-obj-cache.h:54
rtems_rtl_obj_cpmp
Definition: rtl-obj-comp.h:47
rtems_rtl_obj_sym
Definition: rtl-sym.h:30
rtems_rtl_obj
Definition: rtl-obj.h:181
rtems_rtl_symbols
Definition: rtl-sym.h:41
rtems_rtl_unresolved
Definition: rtl-unresolved.h:156
Chain_Control
Definition: chain.h:86