35#if !defined (_RTEMS_RTL_OBJ_H_)
36#define _RTEMS_RTL_OBJ_H_
50#define RTEMS_RTL_FMT_ELF (1 << 0)
51#define RTEMS_RTL_FMT_COMP (1 << 1)
52#define RTEMS_RTL_FMT_PRIVATE (1 << 16)
109#define RTEMS_RTL_OBJ_SECT_TEXT (1 << 0)
110#define RTEMS_RTL_OBJ_SECT_CONST (1 << 1)
111#define RTEMS_RTL_OBJ_SECT_DATA (1 << 2)
112#define RTEMS_RTL_OBJ_SECT_BSS (1 << 3)
113#define RTEMS_RTL_OBJ_SECT_EH (1 << 4)
114#define RTEMS_RTL_OBJ_SECT_TLS (1 << 5)
115#define RTEMS_RTL_OBJ_SECT_REL (1 << 6)
116#define RTEMS_RTL_OBJ_SECT_RELA (1 << 7)
117#define RTEMS_RTL_OBJ_SECT_SYM (1 << 8)
118#define RTEMS_RTL_OBJ_SECT_STR (1 << 9)
119#define RTEMS_RTL_OBJ_SECT_ALLOC (1 << 10
120#define RTEMS_RTL_OBJ_SECT_LOAD (1 << 11)
121#define RTEMS_RTL_OBJ_SECT_WRITE (1 << 12)
122#define RTEMS_RTL_OBJ_SECT_EXEC (1 << 13)
123#define RTEMS_RTL_OBJ_SECT_ZERO (1 << 14)
124#define RTEMS_RTL_OBJ_SECT_LINK (1 << 15)
125#define RTEMS_RTL_OBJ_SECT_CTOR (1 << 16)
126#define RTEMS_RTL_OBJ_SECT_DTOR (1 << 17)
127#define RTEMS_RTL_OBJ_SECT_LOCD (1 << 18)
128#define RTEMS_RTL_OBJ_SECT_ARCH_ALLOC (1 << 19)
133#define RTEMS_RTL_OBJ_SECT_TYPES (RTEMS_RTL_OBJ_SECT_TEXT | \
134 RTEMS_RTL_OBJ_SECT_CONST | \
135 RTEMS_RTL_OBJ_SECT_DATA | \
136 RTEMS_RTL_OBJ_SECT_BSS | \
137 RTEMS_RTL_OBJ_SECT_TLS | \
138 RTEMS_RTL_OBJ_SECT_EH)
185#define RTEMS_RTL_OBJ_LOCKED (1 << 0)
187#define RTEMS_RTL_OBJ_UNRESOLVED (1 << 1)
189#define RTEMS_RTL_OBJ_BASE (1 << 2)
190#define RTEMS_RTL_OBJ_RELOC_TAG (1 << 3)
192#define RTEMS_RTL_OBJ_DEP_VISITED (1 << 4)
193#define RTEMS_RTL_OBJ_CTOR_RUN (1 << 5)
285static inline const char* rtems_rtl_obj_fname (
const rtems_rtl_obj* obj)
296static inline bool rtems_rtl_obj_fname_valid (
const rtems_rtl_obj* obj)
307static inline const char* rtems_rtl_obj_oname (
const rtems_rtl_obj* obj)
318static inline bool rtems_rtl_obj_oname_valid (
const rtems_rtl_obj* obj)
329static inline const char* rtems_rtl_obj_aname (
const rtems_rtl_obj* obj)
340static inline bool rtems_rtl_obj_aname_valid (
const rtems_rtl_obj* obj)
351static inline bool rtems_rtl_obj_text_inside (
const rtems_rtl_obj* obj,
368static inline size_t rtems_rtl_obj_align (
size_t offset,
371 if ((alignment > 1) && ((offset & (alignment - 1)) != 0))
372 offset = (offset + alignment) & ~(alignment - 1);
383static inline bool rtems_rtl_obj_has_symbol (
const rtems_rtl_obj* obj,
396static inline size_t rtems_rtl_obj_has_trampolines (
const rtems_rtl_obj* obj)
408static inline size_t rtems_rtl_obj_tramp_avail_space (
const rtems_rtl_obj* obj)
420static inline bool rtems_rtl_obj_has_tramp_space (
const rtems_rtl_obj* obj,
424 (rtems_rtl_obj_tramp_avail_space (obj) + size) <= obj->
tramp_size);
433static inline size_t rtems_rtl_obj_trampoline_slots (
const rtems_rtl_obj* obj)
444static inline size_t rtems_rtl_obj_trampolines (
const rtems_rtl_obj* obj)
This header file provides the Chains API.
#define NULL
Requests a GPIO pin group configuration.
Definition: xil_types.h:54
int link(const char *path1, const char *path2)
Definition: link.c:47
This header file defines the RTEMS Classic API.
bool rtems_rtl_obj_find_file(rtems_rtl_obj *obj, const char *name)
Definition: rtl-obj.c:404
rtems_rtl_loader_format *(* rtems_rtl_loader_sig)(void)
Definition: rtl-obj.h:93
uint32_t rtems_rtl_obj_bss_alignment(const rtems_rtl_obj *obj)
Definition: rtl-obj.c:817
bool rtems_rtl_obj_add_section(rtems_rtl_obj *obj, int section, const char *name, size_t size, off_t offset, uint32_t alignment, int link, int info, uint32_t flags)
Definition: rtl-obj.c:444
bool(* rtems_rtl_obj_depends_iterator)(rtems_rtl_obj *obj, rtems_rtl_obj *dependent, void *data)
Definition: rtl-obj.h:178
bool rtems_rtl_obj_ctors_to_run(rtems_rtl_obj *obj)
Definition: rtl-obj.c:1380
size_t rtems_rtl_obj_get_reference(rtems_rtl_obj *obj)
Definition: rtl-obj.c:1428
uint32_t rtems_rtl_obj_text_alignment(const rtems_rtl_obj *obj)
Definition: rtl-obj.c:756
bool rtems_rtl_obj_resize_sections(rtems_rtl_obj *obj)
Definition: rtl-obj.c:1203
size_t rtems_rtl_obj_const_size(const rtems_rtl_obj *obj)
Definition: rtl-obj.c:763
rtems_rtl_obj_sect * rtems_rtl_obj_find_section(const rtems_rtl_obj *obj, const char *name)
Definition: rtl-obj.c:523
void rtems_rtl_obj_erase_sections(rtems_rtl_obj *obj)
Definition: rtl-obj.c:483
bool rtems_rtl_obj_load(rtems_rtl_obj *obj)
Definition: rtl-obj.c:1455
bool rtems_rtl_obj_relocate(rtems_rtl_obj *obj, int fd, rtems_rtl_obj_sect_handler handler, void *data)
Definition: rtl-obj.c:823
#define RTEMS_RTL_OBJ_SECT_ARCH_ALLOC
Definition: rtl-obj.h:128
void rtems_rtl_obj_run_dtors(rtems_rtl_obj *obj)
Definition: rtl-obj.c:1398
bool rtems_rtl_obj_add_dependent(rtems_rtl_obj *obj, rtems_rtl_obj *dependent)
Definition: rtl-obj.c:640
size_t rtems_rtl_obj_eh_size(const rtems_rtl_obj *obj)
Definition: rtl-obj.c:784
size_t rtems_rtl_obj_text_size(const rtems_rtl_obj *obj)
Definition: rtl-obj.c:749
uint32_t rtems_rtl_obj_tramp_alignment(const rtems_rtl_obj *obj)
Definition: rtl-mdreloc-aarch64.c:166
size_t rtems_rtl_obj_data_size(const rtems_rtl_obj *obj)
Definition: rtl-obj.c:791
size_t rtems_rtl_obj_bss_size(const rtems_rtl_obj *obj)
Definition: rtl-obj.c:805
bool rtems_rtl_obj_remove_dependencies(rtems_rtl_obj *obj)
Definition: rtl-obj.c:693
bool rtems_rtl_obj_unresolved(rtems_rtl_obj *obj)
Definition: rtl-obj.c:190
bool(* rtems_rtl_loader_load)(rtems_rtl_obj *obj, int fd)
Definition: rtl-obj.h:81
bool rtems_rtl_obj_free(rtems_rtl_obj *obj)
Definition: rtl-obj.c:126
void rtems_rtl_obj_dec_reference(rtems_rtl_obj *obj)
Definition: rtl-obj.c:1440
bool rtems_rtl_parse_name(const char *name, const char **aname, const char **oname, off_t *ooffset)
Definition: rtl-obj.c:221
bool(* rtems_rtl_obj_sect_handler)(rtems_rtl_obj *obj, int fd, rtems_rtl_obj_sect *sect, void *data)
Definition: rtl-obj.h:274
rtems_rtl_obj_sect * rtems_rtl_obj_find_section_by_mask(const rtems_rtl_obj *obj, int index, uint32_t mask)
Definition: rtl-obj.c:586
void rtems_rtl_obj_inc_reference(rtems_rtl_obj *obj)
Definition: rtl-obj.c:1434
bool rtems_rtl_obj_unload(rtems_rtl_obj *obj)
Definition: rtl-obj.c:1516
bool rtems_rtl_obj_alloc_dependents(rtems_rtl_obj *obj, size_t dependents)
Definition: rtl-obj.c:602
void rtems_rtl_obj_synchronize_cache(rtems_rtl_obj *obj)
Definition: rtl-obj.c:881
uint32_t rtems_rtl_obj_data_alignment(const rtems_rtl_obj *obj)
Definition: rtl-obj.c:798
uint32_t rtems_rtl_obj_eh_alignment(const rtems_rtl_obj *obj)
Definition: rtl-obj.c:777
rtems_rtl_obj * rtems_rtl_obj_alloc(void)
Definition: rtl-obj.c:94
bool rtems_rtl_obj_load_sections(rtems_rtl_obj *obj, int fd, rtems_rtl_obj_sect_handler handler, void *data)
Definition: rtl-obj.c:1310
void rtems_rtl_obj_run_ctors(rtems_rtl_obj *obj)
Definition: rtl-obj.c:1386
bool rtems_rtl_obj_alloc_sections(rtems_rtl_obj *obj, int fd, rtems_rtl_obj_sect_handler handler, void *data)
Definition: rtl-obj.c:1136
bool rtems_rtl_obj_load_symbols(rtems_rtl_obj *obj, int fd, rtems_rtl_obj_sect_handler handler, void *data)
Definition: rtl-obj.c:915
bool rtems_rtl_obj_relocate_unresolved(rtems_rtl_unresolv_reloc *reloc, rtems_rtl_obj_sym *sym)
Definition: rtl-elf.c:599
size_t rtems_rtl_obj_tramp_size(const rtems_rtl_obj *obj)
Definition: rtl-obj.c:811
bool rtems_rtl_obj_dtors_to_run(rtems_rtl_obj *obj)
Definition: rtl-obj.c:1392
bool(* rtems_rtl_loader_check)(rtems_rtl_obj *obj, int fd)
Definition: rtl-obj.h:75
rtems_rtl_obj_sect * rtems_rtl_obj_find_section_by_index(const rtems_rtl_obj *obj, int index)
Definition: rtl-obj.c:551
void rtems_rtl_obj_erase_dependents(rtems_rtl_obj *obj)
Definition: rtl-obj.c:626
uint32_t rtems_rtl_obj_const_alignment(const rtems_rtl_obj *obj)
Definition: rtl-obj.c:770
bool rtems_rtl_obj_orphaned(rtems_rtl_obj *obj)
Definition: rtl-obj.c:1447
bool(* rtems_rtl_loader_unload)(rtems_rtl_obj *obj)
Definition: rtl-obj.h:87
bool rtems_rtl_obj_iterate_dependents(rtems_rtl_obj *obj, rtems_rtl_obj_depends_iterator iterator, void *data)
Definition: rtl-obj.c:726
RTEMS Run-Time Linker Object File Symbol Table.
RTEMS Run-Time Linker Object File Unresolved Relocations Table.
This structure represents a chain node.
Definition: chain.h:78
Definition: link_elf.h:45
const char * name
Definition: link_elf.h:46
rtems_rtl_loader_load load
Definition: rtl-obj.h:101
rtems_rtl_loader_sig signature
Definition: rtl-obj.h:103
rtems_rtl_loader_unload unload
Definition: rtl-obj.h:102
rtems_rtl_loader_check check
Definition: rtl-obj.h:100
Definition: rtl-obj.h:169
rtems_chain_node node
Definition: rtl-obj.h:170
rtems_rtl_obj * depends[]
Definition: rtl-obj.h:172
size_t dependents
Definition: rtl-obj.h:171
Definition: rtl-obj.h:146
off_t offset
Definition: rtl-obj.h:151
const char * name
Definition: rtl-obj.h:149
int section
Definition: rtl-obj.h:148
int info
Definition: rtl-obj.h:155
uint32_t flags
Definition: rtl-obj.h:156
uint32_t alignment
Definition: rtl-obj.h:153
size_t size
Definition: rtl-obj.h:150
void * base
Definition: rtl-obj.h:157
int link
Definition: rtl-obj.h:154
int load_order
Definition: rtl-obj.h:159
rtems_chain_node node
Definition: rtl-obj.h:147
Definition: rtl-obj.h:200
void * bss_base
Definition: rtl-obj.h:236
off_t ooffset
Definition: rtl-obj.h:212
size_t tramp_slots
Definition: rtl-obj.h:250
void * tramp_base
Definition: rtl-obj.h:247
const char * fname
Definition: rtl-obj.h:206
rtems_chain_node link
Definition: rtl-obj.h:201
size_t const_size
Definition: rtl-obj.h:229
size_t tramp_relocs
Definition: rtl-obj.h:255
size_t local_syms
Definition: rtl-obj.h:218
size_t eh_size
Definition: rtl-obj.h:232
size_t bss_size
Definition: rtl-obj.h:238
void * data_base
Definition: rtl-obj.h:233
size_t text_size
Definition: rtl-obj.h:226
rtems_rtl_obj_sym * global_table
Definition: rtl-obj.h:220
void * entry
Definition: rtl-obj.h:241
size_t users
Definition: rtl-obj.h:203
uint32_t * sec_num
Definition: rtl-obj.h:244
void * loader
Definition: rtl-obj.h:259
size_t unresolved
Definition: rtl-obj.h:223
uint32_t flags
Definition: rtl-obj.h:202
size_t global_size
Definition: rtl-obj.h:222
void * tramp_brk
Definition: rtl-obj.h:252
int format
Definition: rtl-obj.h:205
size_t tramp_size
Definition: rtl-obj.h:249
size_t tramp_slot_size
Definition: rtl-obj.h:251
uint32_t obj_num
Definition: rtl-obj.h:245
size_t local_size
Definition: rtl-obj.h:219
struct link_map * linkmap
Definition: rtl-obj.h:258
size_t fsize
Definition: rtl-obj.h:213
void * text_base
Definition: rtl-obj.h:224
rtems_chain_control dependents
Definition: rtl-obj.h:216
size_t global_syms
Definition: rtl-obj.h:221
void * eh_base
Definition: rtl-obj.h:230
rtems_rtl_obj_sym * local_table
Definition: rtl-obj.h:217
size_t exec_size
Definition: rtl-obj.h:239
void * const_base
Definition: rtl-obj.h:227
size_t data_size
Definition: rtl-obj.h:235
rtems_chain_control sections
Definition: rtl-obj.h:214
size_t refs
Definition: rtl-obj.h:204
const char * oname
Definition: rtl-obj.h:207
uint32_t checksum
Definition: rtl-obj.h:242
const char * aname
Definition: rtl-obj.h:209
Definition: rtl-unresolved.h:127
This union represents a chain control block.
Definition: chain.h:96