RTEMS Linker  0.0.1
RTEMS Tools Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
rld::files::object Class Reference

#include <rld-files.h>

Inheritance diagram for rld::files::object:
rld::files::image

Public Member Functions

 object (archive &archive_, file &file_)
 
 object (const std::string &path)
 
 object ()
 
virtual ~object ()
 
virtual void open (bool writable=false)
 
virtual void close ()
 
void begin ()
 
void end ()
 
bool valid () const
 
void load_symbols (symbols::table &symbols, bool local=false)
 
void load_relocations ()
 
virtual int references () const
 
virtual size_t size () const
 
virtual int fd () const
 
virtual void symbol_referenced ()
 
archiveget_archive ()
 
symbols::symtabunresolved_symbols ()
 
symbols::pointersexternal_symbols ()
 
void get_sections (sections &filtered_secs, uint32_t type=0, uint64_t flags_in=0, uint64_t flags_out=0)
 
void get_sections (sections &filtered_secs, const std::string &name)
 
const sectionget_section (int index) const
 
void resolve_set ()
 
void resolve_clear ()
 
bool resolving () const
 
void resolved_set ()
 
bool resolved () const
 
- Public Member Functions inherited from rld::files::image
 image (file &name)
 
 image (const std::string &path, bool is_object=true)
 
 image ()
 
virtual ~image ()
 
virtual void open (file &name)
 
virtual ssize_t read (void *buffer, size_t size)
 
virtual ssize_t write (const void *buffer, size_t size)
 
virtual void seek (off_t offset)
 
virtual bool seek_read (off_t offset, uint8_t *buffer, size_t size)
 
virtual bool seek_write (off_t offset, const void *buffer, size_t size)
 
const filename () const
 
elf::fileelf ()
 
virtual int symbol_references () const
 
const std::string path () const
 
bool is_open () const
 
bool is_writable () const
 

Detailed Description

The object file cab be in an archive or a file.

Constructor & Destructor Documentation

rld::files::object::object ( archive archive_,
file file_ 
)

Construct an object image that is part of an archive.

Parameters
archive_The archive the object file is part of.
file_The image file.
rld::files::object::object ( const std::string &  path)

Construct the object file.

Parameters
pathThe object file path.
rld::files::object::object ( )

Construct the object file.

rld::files::object::~object ( )
virtual

Destruct the object file.

Member Function Documentation

void rld::files::object::begin ( )

Begin the object file session.

We assume the ELF file is invariant over the linking process.

void rld::files::object::close ( )
virtual

Close the object.

Reimplemented from rld::files::image.

void rld::files::object::end ( )

End the object file session.

rld::symbols::pointers & rld::files::object::external_symbols ( )

Return the list external symbols.

int rld::files::object::fd ( ) const
virtual

The file descriptor.

Reimplemented from rld::files::image.

archive * rld::files::object::get_archive ( )

The archive the object file is contained in. If 0 the object file is not contained in an archive.

const section & rld::files::object::get_section ( int  index) const

Get a section given an index number.

Parameters
indexThe section index to search for.
void rld::files::object::get_sections ( sections filtered_secs,
uint32_t  type = 0,
uint64_t  flags_in = 0,
uint64_t  flags_out = 0 
)

Return a container sections that match the requested type and flags. The filtered section container is not cleared so any matching sections are appended.

Parameters
filtered_secsThe container of the matching sections.
typeThe section type. Must match. If 0 matches any.
flags_inThe sections flags that must be set. This is a mask. If 0 matches any.
flags_outThe sections flags that must be clear. This is a mask. If 0 this value is ignored.
void rld::files::object::get_sections ( sections filtered_secs,
const std::string &  name 
)

Return a container sections that match the requested name. The filtered section container is not cleared so any matching sections are appended.

Parameters
filtered_secsThe container of the matching sections.
nameThe name of the section.
void rld::files::object::load_relocations ( )

Load the relocations.

void rld::files::object::load_symbols ( symbols::table symbols,
bool  local = false 
)

Load the symbols into the symbols table.

Parameters
symbolsThe symbol table to load.
localInclude local symbols. The default is not to.
void rld::files::object::open ( bool  writable = false)
virtual

Open the object file.

Reimplemented from rld::files::image.

int rld::files::object::references ( ) const
virtual

References to the image.

Reimplemented from rld::files::image.

void rld::files::object::resolve_clear ( )

Clear the object file's resolving flag.

void rld::files::object::resolve_set ( )

Set the object file's resolving flag.

bool rld::files::object::resolved ( ) const

The resolved state.

void rld::files::object::resolved_set ( )

Set the object file resolved flag.

bool rld::files::object::resolving ( ) const

The resolving state.

size_t rld::files::object::size ( ) const
virtual

The file size.

Reimplemented from rld::files::image.

void rld::files::object::symbol_referenced ( )
virtual

A symbol in the image has been referenced.

Reimplemented from rld::files::image.

rld::symbols::symtab & rld::files::object::unresolved_symbols ( )

Return the unresolved symbol table for this object file.

bool rld::files::object::valid ( ) const

If valid returns true the begin has been called and the object has been validated as being in a suitable format.


The documentation for this class was generated from the following files: