RTEMS Linker
0.0.1
RTEMS Tools Project
|
#include <rld-files.h>
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 () |
archive * | get_archive () |
symbols::symtab & | unresolved_symbols () |
symbols::pointers & | external_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 section & | get_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 file & | name () const |
elf::file & | elf () |
virtual int | symbol_references () const |
const std::string | path () const |
bool | is_open () const |
bool | is_writable () const |
The object file cab be in an archive or a file.
Construct an object image that is part of an archive.
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.
path | The object file path. |
rld::files::object::object | ( | ) |
Construct the object file.
|
virtual |
Destruct the object file.
void rld::files::object::begin | ( | ) |
Begin the object file session.
We assume the ELF file is invariant over the linking process.
|
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.
|
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.
index | The 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.
filtered_secs | The container of the matching sections. |
type | The section type. Must match. If 0 matches any. |
flags_in | The sections flags that must be set. This is a mask. If 0 matches any. |
flags_out | The 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.
filtered_secs | The container of the matching sections. |
name | The 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.
symbols | The symbol table to load. |
local | Include local symbols. The default is not to. |
|
virtual |
Open the object file.
Reimplemented from rld::files::image.
|
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.
|
virtual |
The file size.
Reimplemented from rld::files::image.
|
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.