summaryrefslogtreecommitdiff
path: root/rld-symbols.h
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2012-12-08 09:07:30 +1100
committerChris Johns <chrisj@rtems.org>2012-12-08 09:07:30 +1100
commit4c10232ae7298504c124c33a8c0dc27c86dad5b5 (patch)
treef2745cad4ebf5cb07111191fe6f0cd8b7dd22cd5 /rld-symbols.h
parentc6add3b2f603f4cf9be8bfe4bb4c27ccf9c086fa (diff)
Add support to demand load relocation records.
Support has been added to load relocation record on demand. The relocation records are not read when the object file is first opened and read. They are read only when being written to the output file. This save loading lots of records into memory from libraries to be thrown away. The RAP format now supports writing out relocation records.
Diffstat (limited to 'rld-symbols.h')
-rw-r--r--rld-symbols.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/rld-symbols.h b/rld-symbols.h
index dcb0d3e..e602e36 100644
--- a/rld-symbols.h
+++ b/rld-symbols.h
@@ -58,14 +58,15 @@ namespace rld
/**
* Construct an exported symbol with a object file.
*/
- symbol (const std::string& name,
+ symbol (int index,
+ const std::string& name,
files::object& object,
const elf::elf_sym& esym);
/**
- * Construct an unresolved symbol with no object file.
+ * Construct a symbol with no object file and an ELF index.
*/
- symbol (const std::string& name, const elf::elf_sym& esym);
+ symbol (int index, const std::string& name, const elf::elf_sym& esym);
/**
* Construct a linker symbol that is internally created.
@@ -80,6 +81,11 @@ namespace rld
elf::elf_addr value = 0);
/**
+ * The symbol's index in the symtab section of the ELF file.
+ */
+ int index () const;
+
+ /**
* The symbol's name.
*/
const std::string& name () const;
@@ -105,9 +111,9 @@ namespace rld
int binding () const;
/**
- * The synbol's section index.
+ * The symbol's section index.
*/
- int index () const;
+ int section_index () const;
/**
* The value of the symbol.
@@ -159,6 +165,7 @@ namespace rld
private:
+ int index_; //< The symbol's index in the ELF file.
std::string name_; //< The name of the symbol.
std::string demangled_; //< If a C++ symbol the demangled name.
files::object* object_; //< The object file containing the symbol.