RTEMS CPU Kit with SuperCore
4.11.3
|
RTEMS Run-Time Link Editor. More...
#include <errno.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <rtems/rtl/rtl.h>
#include "rtl-elf.h"
#include "rtl-error.h"
#include "rtl-trace.h"
#include "rtl-unwind.h"
#include "rtl-unresolved.h"
Macros | |
#define | REL_R_OFFSET (0) |
The offsets in the unresolved array. | |
#define | REL_R_INFO (1) |
#define | REL_R_ADDEND (2) |
Functions | |
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_obj_relocate_unresolved (rtems_rtl_unresolv_reloc_t *reloc, rtems_rtl_obj_sym_t *sym) |
Relocate an object file's unresolved reference. 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 Link Editor.
This is the RTL implementation.
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_obj_relocate_unresolved | ( | rtems_rtl_unresolv_reloc_t * | reloc, |
rtems_rtl_obj_sym_t * | sym | ||
) |
Relocate an object file's unresolved reference.
rec | The unresolved relocation record. |
sym | The unresolved relocation's referenced symbol. |
true | The object file record was relocated. |
false | The relocation failed. The RTL error is set. |
References rtems_rtl_unresolv_reloc_s::flags, rtems_rtl_unresolv_reloc_s::obj, rtems_rtl_unresolv_reloc_s::rel, REL_R_OFFSET, rtems_rtl_obj_find_section_by_index(), rtems_rtl_set_error(), rtems_rtl_unresolv_reloc_s::sect, and rtems_rtl_obj_sym_s::value.