RTEMS CPU Kit with SuperCore  4.11.3
Data Structures | Typedefs | Functions
rtl-sym.h File Reference

RTEMS Run-Time Linker Object File Symbol Table. More...

#include <rtems.h>
#include "rtl-obj-fwd.h"
Include dependency graph for rtl-sym.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  rtems_rtl_obj_sym_s
 An object file symbol. More...
 
struct  rtems_rtl_symbols_s
 Table of symbols stored in a hash table. More...
 

Typedefs

typedef struct rtems_rtl_obj_sym_s rtems_rtl_obj_sym_t
 An object file symbol.
 
typedef struct rtems_rtl_symbols_s rtems_rtl_symbols_t
 Table of symbols stored in a hash table.
 

Functions

bool rtems_rtl_symbol_table_open (rtems_rtl_symbols_t *symbols, size_t buckets)
 Open a symbol table with the specified number of buckets. More...
 
void rtems_rtl_symbol_table_close (rtems_rtl_symbols_t *symbols)
 Close the table and erase the hash table. More...
 
bool rtems_rtl_symbol_global_add (rtems_rtl_obj_t *obj, const unsigned char *esyms, unsigned int size)
 Add a table of exported symbols to the symbol table. More...
 
rtems_rtl_obj_sym_trtems_rtl_symbol_global_find (const char *name)
 Find a symbol given the symbol label in the global symbol table. More...
 
rtems_rtl_obj_sym_trtems_rtl_symbol_obj_find (rtems_rtl_obj_t *obj, const char *name)
 Find a symbol given the symbol label in the local object file. More...
 
void rtems_rtl_symbol_obj_add (rtems_rtl_obj_t *obj)
 Add the object file's symbols to the global table. More...
 
void rtems_rtl_symbol_obj_erase_local (rtems_rtl_obj_t *obj)
 Erase the object file's local symbols. More...
 
void rtems_rtl_symbol_obj_erase (rtems_rtl_obj_t *obj)
 Erase the object file's symbols. More...
 

Detailed Description

RTEMS Run-Time Linker Object File Symbol Table.

Function Documentation

◆ rtems_rtl_symbol_global_add()

bool rtems_rtl_symbol_global_add ( rtems_rtl_obj_t 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:

  1. label
  2. address

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.

Parameters
objThe object table the symbols are for.
esymsThe exported symbol table.
sizeThe size of the table in bytes.

◆ rtems_rtl_symbol_global_find()

rtems_rtl_obj_sym_t* rtems_rtl_symbol_global_find ( const char *  name)

Find a symbol given the symbol label in the global symbol table.

Parameters
nameThe name as an ASCIIZ string.
Return values
NULLNo symbol found.
Returns
rtems_rtl_obj_sym_t* Reference to the symbol.

References rtems_rtl_global_symbols().

◆ rtems_rtl_symbol_obj_add()

void rtems_rtl_symbol_obj_add ( rtems_rtl_obj_t obj)

Add the object file's symbols to the global table.

Parameters
objThe object file the symbols are to be added.

◆ rtems_rtl_symbol_obj_erase()

void rtems_rtl_symbol_obj_erase ( rtems_rtl_obj_t obj)

Erase the object file's symbols.

Parameters
objThe object file the symbols are to be erased from.

References rtems_rtl_obj_s::global_table, and rtems_rtl_symbol_obj_erase_local().

Referenced by rtems_rtl_obj_free().

◆ rtems_rtl_symbol_obj_erase_local()

void rtems_rtl_symbol_obj_erase_local ( rtems_rtl_obj_t obj)

Erase the object file's local symbols.

Parameters
objThe object file the local symbols are to be erased from.

References rtems_rtl_obj_s::local_size, rtems_rtl_obj_s::local_syms, rtems_rtl_obj_s::local_table, rtems_rtl_alloc_del(), and RTEMS_RTL_ALLOC_SYMBOL.

Referenced by rtems_rtl_symbol_obj_erase().

◆ rtems_rtl_symbol_obj_find()

rtems_rtl_obj_sym_t* rtems_rtl_symbol_obj_find ( rtems_rtl_obj_t obj,
const char *  name 
)

Find a symbol given the symbol label in the local object file.

Parameters
objThe object file to search.
nameThe name as an ASCIIZ string.
Return values
NULLNo symbol found.
Returns
rtems_rtl_obj_sym_t* Reference to the symbol.

◆ rtems_rtl_symbol_table_close()

void rtems_rtl_symbol_table_close ( rtems_rtl_symbols_t symbols)

Close the table and erase the hash table.

Parameters
symbolsClose the symbol table.

References rtems_rtl_alloc_del(), and RTEMS_RTL_ALLOC_SYMBOL.

◆ rtems_rtl_symbol_table_open()

bool rtems_rtl_symbol_table_open ( rtems_rtl_symbols_t symbols,
size_t  buckets 
)

Open a symbol table with the specified number of buckets.

Parameters
symbolsThe symbol table to open.
bucketsThe number of buckets in the hash table.
Return values
trueThe symbol is open.
falseThe symbol table could not created. The RTL error has the error.

References rtems_chain_initialize_empty(), rtems_rtl_alloc_new(), RTEMS_RTL_ALLOC_SYMBOL, and rtems_rtl_set_error().