RTEMS  5.1
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"

Go to the source code of this file.

Data Structures

struct  rtems_rtl_obj_sym
 
struct  rtems_rtl_symbols
 

Typedefs

typedef struct rtems_rtl_obj_sym rtems_rtl_obj_sym
 
typedef struct rtems_rtl_symbols rtems_rtl_symbols
 

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_symrtems_rtl_symbol_global_find (const char *name)
 
void rtems_rtl_symbol_obj_sort (rtems_rtl_obj *obj)
 
rtems_rtl_obj_symrtems_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)
 

Detailed Description

RTEMS Run-Time Linker Object File Symbol Table.

Typedef Documentation

◆ rtems_rtl_obj_sym

An object file symbol.

◆ rtems_rtl_symbols

Table of symbols stored in a hash table.

Function Documentation

◆ rtems_rtl_symbol_global_add()

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:

  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* 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* Reference to the symbol.

◆ rtems_rtl_symbol_obj_add()

void rtems_rtl_symbol_obj_add ( rtems_rtl_obj 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 obj)

Erase the object file's symbols.

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

◆ rtems_rtl_symbol_obj_erase_local()

void rtems_rtl_symbol_obj_erase_local ( rtems_rtl_obj obj)

Erase the object file's local symbols.

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

◆ rtems_rtl_symbol_obj_find()

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.

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

◆ rtems_rtl_symbol_obj_sort()

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.

Parameters
objThe object file to sort.

◆ rtems_rtl_symbol_table_close()

void rtems_rtl_symbol_table_close ( rtems_rtl_symbols symbols)

Close the table and erase the hash table.

Parameters
symbolsClose the symbol table.

◆ rtems_rtl_symbol_table_open()

bool rtems_rtl_symbol_table_open ( rtems_rtl_symbols 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.