RTEMS: cpukit/libdl/rtl-elf.h Source File

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
rtl-elf.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 */
16#if !defined (_RTEMS_RTL_ELF_H_)
17#define _RTEMS_RTL_ELF_H_
18
19#include <rtems/rtl/rtl-fwd.h>
20#include <rtems/rtl/rtl-obj-fwd.h>
21#include <rtems/rtl/rtl-sym.h>
22
23#ifdef __cplusplus
24extern "C" {
25#endif /* __cplusplus */
26
31/*
32 * Do not add '()'. Leave plain.
33 */
34#if defined(__powerpc64__) || defined(__arch64__) || (__riscv_xlen == 64)
35#define ELFSIZE 64
36#else
37#define ELFSIZE 32
38#endif
39
40/*
41 * Define _STANDALONE then remove after.
42 */
43#define _STANDALONE 1
44
45#include <sys/cdefs.h>
46#include <sys/exec_elf.h>
47
48#undef _STANDALONE
49
57 typedef enum rtems_rtl_elf_rel_status
58{
59 rtems_rtl_elf_rel_no_error,
60 rtems_rtl_elf_rel_failure,
61 rtems_rtl_elf_rel_tramp_cache,
62 rtems_rtl_elf_rel_tramp_add
63} rtems_rtl_elf_rel_status;
64
68 typedef struct rtems_rtl_mdreloc_trmap
69{
70 bool parsing;
71 void* tampolines;
72 size_t size;
73} rtems_rtl_mdreloc_tramp;
74
80#define RTEMS_RTL_ELF_STRING_MAX (256)
81
91uint32_t rtems_rtl_elf_section_flags (const rtems_rtl_obj* obj,
92 const Elf_Shdr* shdr);
93
105uint32_t rtems_rtl_elf_arch_parse_section (const rtems_rtl_obj* obj,
106 int section,
107 const char* name,
108 const Elf_Shdr* shdr,
109 const uint32_t flags);
110
119bool rtems_rtl_elf_arch_section_alloc (const rtems_rtl_obj* obj,
120 rtems_rtl_obj_sect* sect);
121
130bool rtems_rtl_elf_arch_section_free (const rtems_rtl_obj* obj,
131 rtems_rtl_obj_sect* sect);
132
141bool rtems_rtl_elf_rel_resolve_sym (Elf_Word type);
142
149size_t rtems_rtl_elf_relocate_tramp_max_size (void);
150
164 rtems_rtl_elf_rel_status rtems_rtl_elf_relocate_rel_tramp (rtems_rtl_obj* obj,
165 const Elf_Rel* rel,
166 const rtems_rtl_obj_sect* sect,
167 const char* symname,
168 const Elf_Byte syminfo,
169 const Elf_Word symvalue);
170
184 rtems_rtl_elf_rel_status rtems_rtl_elf_relocate_rela_tramp (rtems_rtl_obj* obj,
185 const Elf_Rela* rela,
186 const rtems_rtl_obj_sect* sect,
187 const char* symname,
188 const Elf_Byte syminfo,
189 const Elf_Word symvalue);
190
204 rtems_rtl_elf_rel_status rtems_rtl_elf_relocate_rel (rtems_rtl_obj* obj,
205 const Elf_Rel* rel,
206 const rtems_rtl_obj_sect* sect,
207 const char* symname,
208 const Elf_Byte syminfo,
209 const Elf_Word symvalue);
210
224 rtems_rtl_elf_rel_status rtems_rtl_elf_relocate_rela (rtems_rtl_obj* obj,
225 const Elf_Rela* rela,
226 const rtems_rtl_obj_sect* sect,
227 const char* symname,
228 const Elf_Byte syminfo,
229 const Elf_Word symvalue);
230
237bool rtems_rtl_elf_file_check (rtems_rtl_obj* obj, int fd);
238
245bool rtems_rtl_elf_file_load (rtems_rtl_obj* obj, int fd);
246
252bool rtems_rtl_elf_file_unload (rtems_rtl_obj* obj);
253
259 rtems_rtl_loader_format* rtems_rtl_elf_file_sig (void);
260
261#ifdef __cplusplus
262}
263#endif /* __cplusplus */
264
265#endif
rtems_rtl_elf_file_sig
rtems_rtl_loader_format * rtems_rtl_elf_file_sig(void)
Definition: rtl-elf.c:1798
rtems_rtl_elf_file_unload
bool rtems_rtl_elf_file_unload(rtems_rtl_obj *obj)
Definition: rtl-elf.c:1790
rtems_rtl_elf_rel_resolve_sym
bool rtems_rtl_elf_rel_resolve_sym(Elf_Word type)
Definition: rtl-mdreloc-arm.c:162
rtems_rtl_elf_section_flags
uint32_t rtems_rtl_elf_section_flags(const rtems_rtl_obj *obj, const Elf_Shdr *shdr)
Definition: rtl-mdreloc-arm.c:120
rtems_rtl_elf_relocate_tramp_max_size
size_t rtems_rtl_elf_relocate_tramp_max_size(void)
Definition: rtl-mdreloc-arm.c:114
rtems_rtl_mdreloc_tramp
struct rtems_rtl_mdreloc_trmap rtems_rtl_mdreloc_tramp
rtems_rtl_elf_arch_section_alloc
bool rtems_rtl_elf_arch_section_alloc(const rtems_rtl_obj *obj, rtems_rtl_obj_sect *sect)
Definition: rtl-mdreloc-arm.c:144
rtems_rtl_elf_file_load
bool rtems_rtl_elf_file_load(rtems_rtl_obj *obj, int fd)
Definition: rtl-elf.c:1641
rtems_rtl_elf_arch_section_free
bool rtems_rtl_elf_arch_section_free(const rtems_rtl_obj *obj, rtems_rtl_obj_sect *sect)
Definition: rtl-mdreloc-arm.c:153
rtems_rtl_elf_relocate_rela_tramp
rtems_rtl_elf_rel_status rtems_rtl_elf_relocate_rela_tramp(rtems_rtl_obj *obj, const Elf_Rela *rela, const rtems_rtl_obj_sect *sect, const char *symname, const Elf_Byte syminfo, const Elf_Word symvalue)
Definition: rtl-mdreloc-arm.c:168
rtems_rtl_elf_relocate_rela
rtems_rtl_elf_rel_status rtems_rtl_elf_relocate_rela(rtems_rtl_obj *obj, const Elf_Rela *rela, const rtems_rtl_obj_sect *sect, const char *symname, const Elf_Byte syminfo, const Elf_Word symvalue)
Definition: rtl-mdreloc-arm.c:186
rtems_rtl_elf_file_check
bool rtems_rtl_elf_file_check(rtems_rtl_obj *obj, int fd)
Definition: rtl-elf.c:1503
rtems_rtl_elf_relocate_rel_tramp
rtems_rtl_elf_rel_status rtems_rtl_elf_relocate_rel_tramp(rtems_rtl_obj *obj, const Elf_Rel *rel, const rtems_rtl_obj_sect *sect, const char *symname, const Elf_Byte syminfo, const Elf_Word symvalue)
Definition: rtl-mdreloc-arm.c:568
rtems_rtl_elf_rel_status
rtems_rtl_elf_rel_status
Definition: rtl-elf.h:58
rtems_rtl_elf_rel_no_error
@ rtems_rtl_elf_rel_no_error
Definition: rtl-elf.h:59
rtems_rtl_elf_rel_failure
@ rtems_rtl_elf_rel_failure
Definition: rtl-elf.h:60
rtems_rtl_elf_rel_tramp_cache
@ rtems_rtl_elf_rel_tramp_cache
Definition: rtl-elf.h:61
rtems_rtl_elf_rel_tramp_add
@ rtems_rtl_elf_rel_tramp_add
Definition: rtl-elf.h:62
rtems_rtl_elf_arch_parse_section
uint32_t rtems_rtl_elf_arch_parse_section(const rtems_rtl_obj *obj, int section, const char *name, const Elf_Shdr *shdr, const uint32_t flags)
Definition: rtl-mdreloc-arm.c:130
rtems_rtl_elf_relocate_rel
rtems_rtl_elf_rel_status rtems_rtl_elf_relocate_rel(rtems_rtl_obj *obj, const Elf_Rel *rel, const rtems_rtl_obj_sect *sect, const char *symname, const Elf_Byte syminfo, const Elf_Word symvalue)
Definition: rtl-mdreloc-arm.c:585
rtl-fwd.h
RTEMS Run-Time Linker ELF Headers.
rtl-obj-fwd.h
RTEMS Run-Time Linker ELF Headers.
rtl-sym.h
RTEMS Run-Time Linker Object File Symbol Table.
rtems_rtl_loader_format
Definition: rtl-obj.h:39
rtems_rtl_mdreloc_trmap
Definition: rtl-elf.h:69
rtems_rtl_mdreloc_trmap::parsing
bool parsing
Definition: rtl-elf.h:70
rtems_rtl_mdreloc_trmap::tampolines
void * tampolines
Definition: rtl-elf.h:71
rtems_rtl_mdreloc_trmap::size
size_t size
Definition: rtl-elf.h:72
rtems_rtl_obj_sect
Definition: rtl-obj.h:127
rtems_rtl_obj
Definition: rtl-obj.h:181