RTEMS Linker  0.0.1
RTEMS Tools Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
rld::rap Namespace Reference

Classes

struct  relocation
 
class  reloc_offset_compare
 
struct  osection
 
struct  section
 
struct  external
 
struct  object
 
class  image
 
class  section_merge
 
class  section_writer
 

Typedefs

typedef std::vector< relocationrelocations
 
typedef std::map< const int,
osection
osections
 
typedef std::vector< int > osecindexes
 
typedef std::list< externalexternals
 
typedef std::list< objectobjects
 

Enumerations

enum  sections {
  rap_text = 0, rap_const = 1, rap_ctor = 2, rap_dtor = 3,
  rap_data = 4, rap_bss = 5, rap_secs = 6
}
 

Functions

const char * section_name (int sec)
 
uint32_t align_offset (uint32_t offset, uint32_t size, uint32_t alignment)
 
void write (files::image &app, const std::string &init, const std::string &fini, const files::object_list &app_objects, const symbols::table &)
 

Typedef Documentation

typedef std::list< external > rld::rap::externals

A container of externals.

typedef std::list< object > rld::rap::objects

A container of objects.

typedef std::vector< int > rld::rap::osecindexes

An ordered container of object section indexes. We need the same order so the alignments match up with the layout.

typedef std::map< const int, osection > rld::rap::osections

Map of object file section offsets keyed by the object file section index. This is used when adding the external symbols so the symbol's value can be adjusted by the offset of the section in the RAP section.

typedef std::vector< relocation > rld::rap::relocations

Relocation records.

Enumeration Type Documentation

The sections of interest in a RAP file.

Enumerator
rap_text 
rap_const 
rap_ctor 
rap_dtor 
rap_data 
rap_bss 
rap_secs 

Function Documentation

uint32_t rld::rap::align_offset ( uint32_t  offset,
uint32_t  size,
uint32_t  alignment 
)

Update the offset taking into account the alignment.

Parameters
offsetThe current offset.
sizeThe size to move the offset by.
alignmentThe alignment of the offset.
Returns
uint32_t The new aligned offset.
const char * rld::rap::section_name ( int  sec)

Return the name of a section.

void rld::rap::write ( files::image &  app,
const std::string &  init,
const std::string &  fini,
const files::object_list &  objects,
const symbols::table &  symbols 
)

Write a RAP format file.

The symbol table is provided to allow incremental linking at some point in the future. I suspect this will also require extra options being added to control symbol visibility in the RAP file. For example an "application" may be self contained and does not need to export any symbols therefore no symbols are added and the only ones are part of the relocation records to bind to base image symbols. Another case is the need for an application to export symbols because it is using dlopen to load modules. Here the symbols maybe 'all' or it could be a user maintained list that are exported.

Parameters
appThe application image to write too.
initThe application's initialisation entry point.
finiThe application's finish entry point .
objectsThe list of object files in the application.
symbolsThe symbol table used to create the application.