RTEMS 6.1-rc6
|
#include <sys/cdefs.h>
#include <errno.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <rtems/rtl/rtl.h>
#include "rtl-elf.h"
#include "rtl-error.h"
#include <rtems/rtl/rtl-trace.h>
#include "rtl-unwind.h"
#include "rtl-unwind-dw2.h"
Functions | |
uint32_t | rtems_rtl_elf_section_flags (const rtems_rtl_obj *obj, const Elf_Shdr *shdr) |
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) |
bool | rtems_rtl_elf_arch_section_alloc (const rtems_rtl_obj *obj, rtems_rtl_obj_sect *sect) |
bool | rtems_rtl_elf_arch_section_free (const rtems_rtl_obj *obj, rtems_rtl_obj_sect *sect) |
bool | rtems_rtl_elf_rel_resolve_sym (Elf_Word type) |
uint32_t | rtems_rtl_obj_tramp_alignment (const rtems_rtl_obj *obj) |
size_t | rtems_rtl_elf_relocate_tramp_max_size (void) |
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) |
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) |
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) |
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) |
bool | rtems_rtl_elf_unwind_parse (const rtems_rtl_obj *obj, const char *name, uint32_t flags) |
bool | rtems_rtl_elf_unwind_register (rtems_rtl_obj *obj) |
bool | rtems_rtl_elf_unwind_deregister (rtems_rtl_obj *obj) |
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 | ||
) |
Architecture specific handler to parse the section and add any flags that may be need to handle the section.
obj | The object file being relocated. |
seciton | The section index. |
name | The name of the section |
shdr | The ELF section header. |
flags | The standard ELF parsed flags. |
uint32_t | Extra RTL object file flags. |
bool rtems_rtl_elf_arch_section_alloc | ( | const rtems_rtl_obj * | obj, |
rtems_rtl_obj_sect * | sect | ||
) |
Architecture specific handler to allocate a section. Some sections are specific to an architecture and need special allocators.
obj | The object file being relocated. |
sect | The section data. |
true | The allocator was successful. |
bool rtems_rtl_elf_arch_section_free | ( | const rtems_rtl_obj * | obj, |
rtems_rtl_obj_sect * | sect | ||
) |
Architecture specific handler to free a section. Some sections are specific to an architecture and need special allocators.
obj | The object file being relocated. |
sect | The section data. |
true | The allocator was successful. |
bool rtems_rtl_elf_rel_resolve_sym | ( | Elf_Word | type | ) |
Architecture specific handler to check is a relocation record's type is required to resolve a symbol.
type | The type field in the relocation record. |
true | The relocation record require symbol resolution. |
false | The relocation record does not require symbol resolution. |
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 | ||
) |
Architecture specific relocation handler compiled in for a specific architecture by the build system. The handler applies the relocation to the target.
obj | The object file being relocated. |
rel | The ELF relocation record. |
sect | The section of the object file the relocation is for. |
symname | The symbol's name. |
syminfo | The ELF symbol info field. |
symvalue | If a symbol is referenced, this is the symbols value. |
rtems_rtl_elf_rel_status | The result of the trampoline parsing. |
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 | ||
) |
Architecture specific relocation trampoline handler compiled in for a specific architecture by the build system. The handler determines if the relocation record requires a trampoline.
obj | The object file being relocated. |
rela | The ELF relocation record. |
sect | The section of the object file the relocation is for. |
symname | The symbol's name. |
syminfo | The ELF symbol info field. |
symvalue | If a symbol is referenced, this is the symbols value. |
rtems_rtl_elf_rel_status | The result of the trampoline parsing. |
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 | ||
) |
Architecture specific relocation handler compiled in for a specific architecture by the build system. The handler applies the relocation to the target.
obj | The object file being relocated. |
rela | The ELF addend relocation record. |
sect | The section of the object file the relocation is for. |
symname | The symbol's name. |
syminfo | The ELF symbol info field. |
symvalue | If a symbol is referenced, this is the symbols value. |
rtems_rtl_elf_rel_status | The result of the trampoline parsing. |
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 | ||
) |
Architecture specific relocation handler compiled in for a specific architecture by the build system. The handler applies the relocation to the target.
obj | The object file being relocated. |
rela | The ELF addend relocation record. |
sect | The section of the object file the relocation is for. |
symname | The symbol's name. |
syminfo | The ELF symbol info field. |
symvalue | If a symbol is referenced, this is the symbols value. |
rtems_rtl_elf_rel_status | The result of the trampoline parsing. |
size_t rtems_rtl_elf_relocate_tramp_max_size | ( | void | ) |
Architecture specific relocation maximum trampoline size. A trampoline entry of this size is allocated for each unresolved external.
uint32_t rtems_rtl_elf_section_flags | ( | const rtems_rtl_obj * | obj, |
const Elf_Shdr * | shdr | ||
) |
Architecture specific handler to translate unknown section flags to RTL section flags. If this function returns 0 an error is raised.
obj | The object file being relocated. |
shdr | The ELF section header. |
0 | Unknown or unsupported flags. |
uint32_t | RTL object file flags. |
bool rtems_rtl_elf_unwind_deregister | ( | rtems_rtl_obj * | obj | ) |
Architecture specific handler to remove an object file's unwind information from the base image.
obj | The object file. |
true | The unwind information has been deregistered. |
false | The unwind information could not be deregistered. |
bool rtems_rtl_elf_unwind_parse | ( | const rtems_rtl_obj * | obj, |
const char * | name, | ||
uint32_t | flags | ||
) |
Architecture specific handler to check if a section contains exception handler data..
obj | The object file. |
name | The section's name. |
uint32 | flags The object file's flags. |
true | The section contains unwind information. |
false | The section does not contain unwind information. |
bool rtems_rtl_elf_unwind_register | ( | rtems_rtl_obj * | obj | ) |
Architecture specific handler to add an object file's unwind information to the base image.
obj | The object file. |
true | The unwind information has been registered. |
false | The unwind information could not be registered. |
uint32_t rtems_rtl_obj_tramp_alignment | ( | const rtems_rtl_obj * | obj | ) |
The trampolinme alignment for the architecture.
This is implemented and set in the architecture backend.
obj | The object file's descriptor. |