RTEMS  5.0.0
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__)
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 {
59  bool parsing;
60  void* tampolines;
61  size_t size;
63 
69 #define RTEMS_RTL_ELF_STRING_MAX (256)
70 
80 uint32_t rtems_rtl_elf_section_flags (const rtems_rtl_obj* obj,
81  const Elf_Shdr* shdr);
82 
95  int section,
96  const char* name,
97  const Elf_Shdr* shdr,
98  const uint32_t flags);
99 
109  rtems_rtl_obj_sect* sect);
110 
120  rtems_rtl_obj_sect* sect);
121 
130 bool rtems_rtl_elf_rel_resolve_sym (Elf_Word type);
131 
139 
155  const Elf_Rel* rel,
156  const rtems_rtl_obj_sect* sect,
157  const char* symname,
158  const Elf_Byte syminfo,
159  const Elf_Word symvalue);
160 
176  const Elf_Rela* rela,
177  const rtems_rtl_obj_sect* sect,
178  const char* symname,
179  const Elf_Byte syminfo,
180  const Elf_Word symvalue);
181 
197  const Elf_Rel* rel,
198  const rtems_rtl_obj_sect* sect,
199  const char* symname,
200  const Elf_Byte syminfo,
201  const Elf_Word symvalue);
202 
218  const Elf_Rela* rela,
219  const rtems_rtl_obj_sect* sect,
220  const char* symname,
221  const Elf_Byte syminfo,
222  const Elf_Word symvalue);
223 
230 bool rtems_rtl_elf_file_check (rtems_rtl_obj* obj, int fd);
231 
238 bool rtems_rtl_elf_file_load (rtems_rtl_obj* obj, int fd);
239 
246 
253 
254 #ifdef __cplusplus
255 }
256 #endif /* __cplusplus */
257 
258 #endif
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:136
void * tampolines
Definition: rtl-elf.h:60
Definition: rtl-elf.h:57
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:103
bool rtems_rtl_elf_rel_resolve_sym(Elf_Word type)
Definition: rtl-mdreloc-arm.c:145
size_t size
Definition: rtl-elf.h:61
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:113
bool 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:538
bool 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:169
bool parsing
Definition: rtl-elf.h:59
bool rtems_rtl_elf_file_check(rtems_rtl_obj *obj, int fd)
Definition: rtl-elf.c:1242
bool rtems_rtl_elf_file_unload(rtems_rtl_obj *obj)
Definition: rtl-elf.c:1517
bool 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:151
bool rtems_rtl_elf_file_load(rtems_rtl_obj *obj, int fd)
Definition: rtl-elf.c:1382
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:127
Definition: rtl-obj.h:126
RTEMS Run-Time Linker ELF Headers.
bool 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:521
size_t rtems_rtl_elf_relocate_tramp_max_size(void)
Definition: rtl-mdreloc-arm.c:97
rtems_rtl_loader_format * rtems_rtl_elf_file_sig(void)
Definition: rtl-elf.c:1525