RTEMS CPU Kit with SuperCore
4.11.3
|
RTEMS Run-Time Linker ELF Headers. More...
#include "rtl-fwd.h"
#include "rtl-obj-fwd.h"
#include "rtl-sym.h"
#include <sys/cdefs.h>
#include <sys/exec_elf.h>
Go to the source code of this file.
Macros | |
#define | ELFSIZE 32 |
Imported NetBSD ELF Specifics Start. | |
#define | _STANDALONE 1 |
#define | RTEMS_RTL_ELF_STRING_MAX (256) |
Imported NetBSD ELF Specifics End. More... | |
Functions | |
uint32_t | rtems_rtl_elf_section_flags (const rtems_rtl_obj_t *obj, const Elf_Shdr *shdr) |
Architecture specific handler to translate unknown section flags to RTL section flags. More... | |
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. More... | |
bool | rtems_rtl_elf_relocate_rel (const rtems_rtl_obj_t *obj, const Elf_Rel *rel, const rtems_rtl_obj_sect_t *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. More... | |
bool | rtems_rtl_elf_relocate_rela (const rtems_rtl_obj_t *obj, const Elf_Rela *rela, const rtems_rtl_obj_sect_t *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. More... | |
bool | rtems_rtl_elf_find_symbol (rtems_rtl_obj_t *obj, const Elf_Sym *sym, const char *symname, Elf_Word *value) |
Find the symbol. More... | |
bool | rtems_rtl_elf_file_check (rtems_rtl_obj_t *obj, int fd) |
The ELF format check handler. More... | |
bool | rtems_rtl_elf_file_load (rtems_rtl_obj_t *obj, int fd) |
The ELF format load handler. More... | |
bool | rtems_rtl_elf_file_unload (rtems_rtl_obj_t *obj) |
The ELF format unload handler. More... | |
rtems_rtl_loader_format_t * | rtems_rtl_elf_file_sig (void) |
The ELF format signature handler. More... | |
RTEMS Run-Time Linker ELF Headers.
#define RTEMS_RTL_ELF_STRING_MAX (256) |
Imported NetBSD ELF Specifics End.
Maximum string length. This a read buffering limit rather than a specific ELF length. I hope this is ok as I am concerned about some C++ symbol lengths.
bool rtems_rtl_elf_file_check | ( | rtems_rtl_obj_t * | obj, |
int | fd | ||
) |
The ELF format check handler.
obj | The object being checked. |
fd | The file descriptor. |
References rtems_rtl_obj_s::ooffset, rtems_rtl_obj_cache_read_byval(), and rtems_rtl_obj_caches().
bool rtems_rtl_elf_file_load | ( | rtems_rtl_obj_t * | obj, |
int | fd | ||
) |
The ELF format load handler.
obj | The object to load. |
fd | The file descriptor. |
References rtems_rtl_obj_s::ooffset, rtems_rtl_obj_cache_read_byval(), and rtems_rtl_obj_caches().
rtems_rtl_loader_format_t* rtems_rtl_elf_file_sig | ( | void | ) |
The ELF format signature handler.
bool rtems_rtl_elf_file_unload | ( | rtems_rtl_obj_t * | obj | ) |
The ELF format unload handler.
obj | The object to unload. |
References rtems_rtl_elf_unwind_deregister().
bool rtems_rtl_elf_find_symbol | ( | rtems_rtl_obj_t * | obj, |
const Elf_Sym * | sym, | ||
const char * | symname, | ||
Elf_Word * | value | ||
) |
Find the symbol.
The symbol is passed as an ELF type symbol with the name and the value returned is the absolute address of the symbol.
If the symbol type is STT_NOTYPE the symbol references a global symbol. The gobal symbol table is searched to find it and that value returned. If the symbol is local to the object module the section for the symbol is located and it's base added to the symbol's value giving an absolute location.
obj | The object the symbol is being resolved for. |
sym | The ELF type symbol. |
symname | The sym's name read from the symbol string table. |
value | Return the value of the symbol. Only valid if the return value is true. |
true | The symbol resolved. |
false | The symbol could not be result. The RTL error is set. |
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. |
References rtems_rtl_elf_relocate_rela().
Referenced by rtems_rtl_elf_section_flags().
bool rtems_rtl_elf_relocate_rel | ( | const rtems_rtl_obj_t * | obj, |
const Elf_Rel * | rel, | ||
const rtems_rtl_obj_sect_t * | 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. |
bool | The relocation has been applied. |
bool | The relocation could not be applied. |
References rtems_rtl_obj_sect_s::base, rtems_rtl_elf_unwind_parse(), and rtems_rtl_set_error().
Referenced by rtems_rtl_elf_relocate_rela().
bool rtems_rtl_elf_relocate_rela | ( | const rtems_rtl_obj_t * | obj, |
const Elf_Rela * | rela, | ||
const rtems_rtl_obj_sect_t * | 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. |
bool | The relocation has been applied. |
bool | The relocation could not be applied. |
References rtems_rtl_obj_sect_s::base, rtems_rtl_elf_relocate_rel(), rtems_rtl_set_error(), and rtems_rtl_trace().
Referenced by rtems_rtl_elf_rel_resolve_sym().
uint32_t rtems_rtl_elf_section_flags | ( | const rtems_rtl_obj_t * | obj, |
const Elf_Shdr * | shdr | ||
) |
Architecture specific handler to translate unknown section flags to RTL section flags.
obj | The object file being relocated. |
shdr | The ELF section header. |
0 | Unknown or unsupported flags. |
uint32_t | RTL object file flags. |
References rtems_rtl_elf_rel_resolve_sym().