RTEMS
5.1
|
RTEMS Run-Time Linker Object File Symbol Table. More...
#include <errno.h>
#include <inttypes.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <rtems/rtl/rtl.h>
#include "rtl-error.h"
#include <rtems/rtl/rtl-sym.h>
#include <rtems/rtl/rtl-trace.h>
Functions | |
bool | rtems_rtl_symbol_table_open (rtems_rtl_symbols *symbols, size_t buckets) |
void | rtems_rtl_symbol_table_close (rtems_rtl_symbols *symbols) |
bool | rtems_rtl_symbol_global_add (rtems_rtl_obj *obj, const unsigned char *esyms, unsigned int size) |
rtems_rtl_obj_sym * | rtems_rtl_symbol_global_find (const char *name) |
void | rtems_rtl_symbol_obj_sort (rtems_rtl_obj *obj) |
rtems_rtl_obj_sym * | rtems_rtl_symbol_obj_find (rtems_rtl_obj *obj, const char *name) |
void | rtems_rtl_symbol_obj_add (rtems_rtl_obj *obj) |
void | rtems_rtl_symbol_obj_erase_local (rtems_rtl_obj *obj) |
void | rtems_rtl_symbol_obj_erase (rtems_rtl_obj *obj) |
RTEMS Run-Time Linker Object File Symbol Table.
bool rtems_rtl_symbol_global_add | ( | rtems_rtl_obj * | obj, |
const unsigned char * | esyms, | ||
unsigned int | size | ||
) |
Add a table of exported symbols to the symbol table.
The export table is a series of symbol records and each record has two fields:
The 'label' is an ASCIIZ string of variable length. The address is of size of an unsigned long for the target running the link editor. The byte order is defined by the machine type because the table should be built by the target compiler.
The table is terminated with a nul string followed by the bytes 0xDE, 0xAD, 0xBE, and 0xEF. This avoids alignments issues.
obj | The object table the symbols are for. |
esyms | The exported symbol table. |
size | The size of the table in bytes. |
rtems_rtl_obj_sym* rtems_rtl_symbol_global_find | ( | const char * | name | ) |
Find a symbol given the symbol label in the global symbol table.
name | The name as an ASCIIZ string. |
NULL | No symbol found. |
void rtems_rtl_symbol_obj_add | ( | rtems_rtl_obj * | obj | ) |
Add the object file's symbols to the global table.
obj | The object file the symbols are to be added. |
void rtems_rtl_symbol_obj_erase | ( | rtems_rtl_obj * | obj | ) |
Erase the object file's symbols.
obj | The object file the symbols are to be erased from. |
void rtems_rtl_symbol_obj_erase_local | ( | rtems_rtl_obj * | obj | ) |
Erase the object file's local symbols.
obj | The object file the local symbols are to be erased from. |
rtems_rtl_obj_sym* rtems_rtl_symbol_obj_find | ( | rtems_rtl_obj * | obj, |
const char * | name | ||
) |
Find a symbol given the symbol label in the local object file.
obj | The object file to search. |
name | The name as an ASCIIZ string. |
NULL | No symbol found. |
void rtems_rtl_symbol_obj_sort | ( | rtems_rtl_obj * | obj | ) |
Sort an object file's local and global symbol table. This needs to be done before calling rtems_rtl_symbol_obj_find as it performs a binary search on the tables.
obj | The object file to sort. |
void rtems_rtl_symbol_table_close | ( | rtems_rtl_symbols * | symbols | ) |
Close the table and erase the hash table.
symbols | Close the symbol table. |
bool rtems_rtl_symbol_table_open | ( | rtems_rtl_symbols * | symbols, |
size_t | buckets | ||
) |
Open a symbol table with the specified number of buckets.
symbols | The symbol table to open. |
buckets | The number of buckets in the hash table. |
true | The symbol is open. |
false | The symbol table could not created. The RTL error has the error. |