RTEMS 6.1-rc6
Loading...
Searching...
No Matches
rtl.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
3/*
4 * COPYRIGHT (c) 2012, 2018 Chris Johns <chrisj@rtems.org>
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 * POSSIBILITY OF SUCH DAMAGE.
26 */
27
38#if !defined (_RTEMS_RTL_H_)
39#define _RTEMS_RTL_H_
40
41#include <link.h>
42#include <rtems/chain.h>
43#include <rtems/thread.h>
44
47#include <rtems/rtl/rtl-fwd.h>
48#include <rtems/rtl/rtl-obj.h>
51#include <rtems/rtl/rtl-sym.h>
53
54#ifdef __cplusplus
55extern "C" {
56#endif /* __cplusplus */
57
78#ifdef __STDC__
79#define RTL_XGLUE(a,b) a##b
80#else
81#define RTL_XGLUE(a,b) ab
82#endif
83
84#define RTL_GLUE(a,b) RTL_XGLUE(a,b)
85
89#define RTEMS_RTL_SYMS_GLOBAL_BUCKETS (32)
90
94#define RTEMS_RTL_UNRESOLVED_BLOCK_SIZE (256)
95
99#define RTEMS_RTL_DEPENDENCY_BLOCK_SIZE (16)
100
104extern struct r_debug _rtld_debug;
105
110void _rtld_debug_state (void);
111
115typedef void (*rtems_rtl_cdtor)(void);
116
126{
127 rtems_recursive_mutex lock;
131 const char* paths;
141 char last_error[64];
142};
143
151
160
168const char* rtems_rtl_last_error_unprotected (void);
169
178
186
195
203
216 rtems_rtl_obj_cache** strings,
217 rtems_rtl_obj_cache** relocs);
218
223
234 rtems_rtl_obj_cache* cache,
235 int fd,
236 int compression,
237 off_t offset);
238
247void rtems_rtl_obj_update_flags (uint32_t clear, uint32_t set);
248
257
261void rtems_rtl_unlock (void);
262
273
281rtems_rtl_obj* rtems_rtl_find_obj (const char* name);
282
291
323rtems_rtl_obj* rtems_rtl_load_object (const char* name, int mode);
324
335
344rtems_rtl_obj* rtems_rtl_load (const char* name, int mode);
345
357
368int rtems_rtl_get_error (char* message, size_t max_message);
369
377bool rtems_rtl_path_append (const char* path);
378
387bool rtems_rtl_path_prepend (const char* path);
388
399void rtems_rtl_base_sym_global_add (const unsigned char* esyms,
400 unsigned int count,
401 const rtems_rtl_tls_offset* tls_offsets,
402 unsigned int tls_size);
403
414
415#ifdef __cplusplus
416}
417#endif /* __cplusplus */
418
419#endif
This header file provides the Chains API.
RTEMS Run-Time Linker Allocator.
RTEMS Run-Time Linker Archive.
RTEMS Run-Time Linker ELF Headers.
RTEMS Run-Time Linker Object File cache buffers a section of the object file in a buffer to localise ...
RTEMS Run-Time Linker Object File Compression manages a compressed stream of data.
RTEMS Run-Time Linker Object Support.
RTEMS Run-Time Linker Object File Symbol Table.
RTEMS Run-Time Linker Object File Unresolved Relocations Table.
rtems_rtl_obj * rtems_rtl_baseimage(void)
Definition: rtl.c:880
bool rtems_rtl_unload_object(rtems_rtl_obj *obj)
Definition: rtl.c:652
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:377
void _rtld_debug_state(void)
Definition: rtl-debugger.c:58
void(* rtems_rtl_cdtor)(void)
Definition: rtl.h:115
const char * rtems_rtl_last_error_unprotected(void)
Definition: rtl.c:289
bool rtems_rtl_unload(rtems_rtl_obj *obj)
Definition: rtl.c:686
rtems_rtl_obj * rtems_rtl_find_obj(const char *name)
Definition: rtl.c:462
rtems_rtl_obj * rtems_rtl_check_handle(void *handle)
Definition: rtl.c:442
rtems_chain_control * rtems_rtl_pending_unprotected(void)
Definition: rtl.c:308
int rtems_rtl_get_error(char *message, size_t max_message)
Definition: rtl-error.c:61
rtems_rtl_data * rtems_rtl_lock(void)
Definition: rtl.c:425
rtems_rtl_obj * rtems_rtl_load(const char *name, int mode)
Definition: rtl.c:589
rtems_rtl_symbols * rtems_rtl_global_symbols(void)
Definition: rtl.c:278
rtems_chain_control * rtems_rtl_objects_unprotected(void)
Definition: rtl.c:297
rtems_rtl_obj * rtems_rtl_find_obj_with_symbol(const rtems_rtl_obj_sym *sym)
Definition: rtl.c:498
bool rtems_rtl_path_append(const char *path)
Definition: rtl.c:848
rtems_rtl_unresolved * rtems_rtl_unresolved_unprotected(void)
Definition: rtl.c:319
rtems_rtl_data * rtems_rtl_data_unprotected(void)
Definition: rtl.c:272
rtems_rtl_archives * rtems_rtl_archives_unprotected(void)
Definition: rtl.c:330
bool rtems_rtl_path_prepend(const char *path)
Definition: rtl.c:854
void rtems_rtl_base_sym_global_add(const unsigned char *esyms, unsigned int count, const rtems_rtl_tls_offset *tls_offsets, unsigned int tls_size)
Definition: rtl.c:860
void rtems_rtl_obj_caches(rtems_rtl_obj_cache **symbols, rtems_rtl_obj_cache **strings, rtems_rtl_obj_cache **relocs)
Definition: rtl.c:341
void rtems_rtl_obj_update_flags(uint32_t clear, uint32_t set)
Definition: rtl.c:413
void rtems_rtl_obj_caches_flush(void)
Definition: rtl.c:366
struct r_debug _rtld_debug
Definition: rtl-debugger.c:55
rtems_rtl_obj * rtems_rtl_load_object(const char *name, int mode)
Definition: rtl.c:523
void rtems_rtl_unlock(void)
Definition: rtl.c:436
Definition: media-server.c:46
Definition: link_elf.h:59
Definition: rtl-allocator.h:111
Definition: rtl-archive.h:122
Definition: rtl.h:126
rtems_recursive_mutex lock
Definition: rtl.h:127
char last_error[64]
Definition: rtl.h:141
rtems_rtl_symbols globals
Definition: rtl.h:132
rtems_chain_control pending
Definition: rtl.h:130
rtems_rtl_obj_comp decomp
Definition: rtl.h:139
rtems_rtl_obj_cache symbols
Definition: rtl.h:136
rtems_rtl_archives archives
Definition: rtl.h:133
rtems_rtl_unresolved unresolved
Definition: rtl.h:134
rtems_rtl_alloc_data allocator
Definition: rtl.h:128
const char * paths
Definition: rtl.h:131
int last_errno
Definition: rtl.h:140
rtems_rtl_obj_cache strings
Definition: rtl.h:137
rtems_chain_control objects
Definition: rtl.h:129
rtems_rtl_obj * base
Definition: rtl.h:135
rtems_rtl_obj_cache relocs
Definition: rtl.h:138
Definition: rtl-obj-cache.h:73
Definition: rtl-obj-comp.h:66
Definition: rtl-sym.h:49
Definition: rtl-obj.h:200
Definition: rtl-sym.h:60
Definition: rtl-sym.h:76
Definition: rtl-unresolved.h:175
This header file provides the API of Self-Contained Objects.
This union represents a chain control block.
Definition: chain.h:96