summaryrefslogtreecommitdiff
path: root/rtemstoolkit/rld-symbols.h
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2014-10-30 17:55:18 +1100
committerChris Johns <chrisj@rtems.org>2014-10-30 17:55:18 +1100
commitfdb1fe685ab60de784b5f20413fe54cd70a01ff2 (patch)
tree05b75e65b705a08c46220416423d64331a68752e /rtemstoolkit/rld-symbols.h
parentaac294948caf0e0595a32dab8194d090ce3dd1b9 (diff)
linkers: Add base image symbol to ELF object file generation.
This change adds support to the rtems-syms code to generate a suitable ELF object you can link to the base image kernel in the embed mode or you can load with the run-time load mode. The change fixes a bug in the framework where local ELF symbols were being placed in the external symbol table. The external symbol table has been removed and a global, weak and local set of tables is now provided as this is more aligned with the ELF format.
Diffstat (limited to 'rtemstoolkit/rld-symbols.h')
-rw-r--r--rtemstoolkit/rld-symbols.h55
1 files changed, 45 insertions, 10 deletions
diff --git a/rtemstoolkit/rld-symbols.h b/rtemstoolkit/rld-symbols.h
index 5405d2f..02a41a3 100644
--- a/rtemstoolkit/rld-symbols.h
+++ b/rtemstoolkit/rld-symbols.h
@@ -101,6 +101,21 @@ namespace rld
bool is_cplusplus () const;
/**
+ * Is the symbol binding is local ?
+ */
+ bool is_local () const;
+
+ /**
+ * Is the symbol binding weak ?
+ */
+ bool is_weak () const;
+
+ /**
+ * Is the symbol binding global ?
+ */
+ bool is_global () const;
+
+ /**
* The symbol's type.
*/
int type () const;
@@ -190,7 +205,7 @@ namespace rld
typedef std::map < std::string, symbol* > symtab;
/**
- * A symbols contains a symbol table of externals and weak symbols.
+ * A symbols contains a symbol table of global, weak and local symbols.
*/
class table
{
@@ -206,9 +221,9 @@ namespace rld
~table ();
/**
- * Add an external symbol.
+ * Add a global symbol.
*/
- void add_external (symbol& sym);
+ void add_global (symbol& sym);
/**
* Add a weak symbol.
@@ -216,9 +231,14 @@ namespace rld
void add_weak (symbol& sym);
/**
- * Find an external symbol.
+ * Add a local symbol.
*/
- symbol* find_external (const std::string& name);
+ void add_local (symbol& sym);
+
+ /**
+ * Find a global symbol.
+ */
+ symbol* find_global (const std::string& name);
/**
* Find an weak symbol.
@@ -226,20 +246,30 @@ namespace rld
symbol* find_weak (const std::string& name);
/**
+ * Find an local symbol.
+ */
+ symbol* find_local (const std::string& name);
+
+ /**
* Return the size of the symbols loaded.
*/
size_t size () const;
/**
- * Return the externals symbol table.
+ * Return the globals symbol table.
*/
- const symtab& externals () const;
+ const symtab& globals () const;
/**
* Return the weaks symbol table.
*/
const symtab& weaks () const;
+ /**
+ * Return the locals symbol table.
+ */
+ const symtab& locals () const;
+
private:
/**
@@ -248,14 +278,19 @@ namespace rld
table (const table& orig);
/**
- * A table of external symbols.
+ * A table of global symbols.
*/
- symtab _externals;
+ symtab globals_;
/**
* A table of weak symbols.
*/
- symtab _weaks;
+ symtab weaks_;
+
+ /**
+ * A table of local symbols.
+ */
+ symtab locals_;
};
/**