RTEMS  5.1
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
24 extern "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 
58 {
64 
69 {
70  bool parsing;
71  void* tampolines;
72  size_t size;
74 
80 #define RTEMS_RTL_ELF_STRING_MAX (256)
81 
91 uint32_t rtems_rtl_elf_section_flags (const rtems_rtl_obj* obj,
92  const Elf_Shdr* shdr);
93 
106  int section,
107  const char* name,
108  const Elf_Shdr* shdr,
109  const uint32_t flags);
110 
120  rtems_rtl_obj_sect* sect);
121 
131  rtems_rtl_obj_sect* sect);
132 
141 bool rtems_rtl_elf_rel_resolve_sym (Elf_Word type);
142 
150 
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 
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 
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 
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 
237 bool rtems_rtl_elf_file_check (rtems_rtl_obj* obj, int fd);
238 
245 bool rtems_rtl_elf_file_load (rtems_rtl_obj* obj, int fd);
246 
253 
260 
261 #ifdef __cplusplus
262 }
263 #endif /* __cplusplus */
264 
265 #endif
Definition: rtl-elf.h:60
RTEMS Run-Time Linker ELF Headers.
bool rtems_rtl_elf_arch_section_free(const rtems_rtl_obj *obj, rtems_rtl_obj_sect *sect)
Definition: rtl-mdreloc-arm.c:153
void * tampolines
Definition: rtl-elf.h:71
rtems_rtl_elf_rel_status
Definition: rtl-elf.h:57
Definition: rtl-elf.h:68
Definition: rtl-obj.h:183
RTEMS Run-Time Linker Object File Symbol Table.
Definition: rtl-obj.h:38
uint32_t rtems_rtl_elf_section_flags(const rtems_rtl_obj *obj, const Elf_Shdr *shdr)
Definition: rtl-mdreloc-arm.c:120
bool rtems_rtl_elf_rel_resolve_sym(Elf_Word type)
Definition: rtl-mdreloc-arm.c:162
size_t size
Definition: rtl-elf.h:72
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
bool parsing
Definition: rtl-elf.h:70
Definition: rtl-elf.h:62
bool rtems_rtl_elf_file_check(rtems_rtl_obj *obj, int fd)
Definition: rtl-elf.c:1503
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
bool rtems_rtl_elf_file_unload(rtems_rtl_obj *obj)
Definition: rtl-elf.c:1790
Definition: rtl-elf.h:61
bool rtems_rtl_elf_file_load(rtems_rtl_obj *obj, int fd)
Definition: rtl-elf.c:1641
Definition: rtl-elf.h:59
struct rtems_rtl_mdreloc_trmap rtems_rtl_mdreloc_tramp
bool rtems_rtl_elf_arch_section_alloc(const rtems_rtl_obj *obj, rtems_rtl_obj_sect *sect)
Definition: rtl-mdreloc-arm.c:144
Definition: rtl-obj.h:126
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_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 Run-Time Linker ELF Headers.
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
size_t rtems_rtl_elf_relocate_tramp_max_size(void)
Definition: rtl-mdreloc-arm.c:114
rtems_rtl_loader_format * rtems_rtl_elf_file_sig(void)
Definition: rtl-elf.c:1798