summaryrefslogtreecommitdiff
path: root/rld-resolver.cpp
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2012-11-17 17:34:33 +1100
committerChris Johns <chrisj@rtems.org>2012-11-17 17:34:33 +1100
commit7ee957ca2f579802b4823ad562f05bd27ad425e1 (patch)
tree5f085ca653f2d80496e984b978b556b561127064 /rld-resolver.cpp
parentd68833ada79a4255e95017b44f73dcb21c7a7701 (diff)
Refactor the ELF support to allow ELF write suppport.
The refactoring allows better reuse of the ELF support and cleans up some hacks from the generic file and archive handling improving the separation of the file handling from the file format, ie ELF. The handling of ELF object files and ELF object files inside archives is cleaner. The refactor cleaned up the symbol handling where the symbols now reside in the ELF file object and references are take in symbol pointer containers and symbol table containers. The main purpose of the refactor is to allow support for creating and writing ELF files. Also added an rtems-syms command where special symbol support can be added.
Diffstat (limited to 'rld-resolver.cpp')
-rw-r--r--rld-resolver.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/rld-resolver.cpp b/rld-resolver.cpp
index fe75754..60b69ef 100644
--- a/rld-resolver.cpp
+++ b/rld-resolver.cpp
@@ -54,7 +54,7 @@ namespace rld
* unresolved symbol's object file to the file that resolves the
* symbol. Record each object file that is found and when all unresolved
* symbols in this object file have been found iterate over the found
- * object files resolving them. The 'usr' is the unresolved symbol and
+ * object files resolving them. The 'urs' is the unresolved symbol and
* 'es' is the exported symbol.
*/
@@ -66,19 +66,26 @@ namespace rld
<< object.name ().basename ()
<< ", unresolved: "
<< unresolved.size ()
- << ((*unresolved.begin ()).second.object () ? " (resolved)" : "")
+ << (((*unresolved.begin ()).second)->object () ? " (resolved)" : "")
<< std::endl;
rld::files::object_list objects;
for (rld::symbols::table::iterator ursi = unresolved.begin ();
- (ursi != unresolved.end ()) && !(*ursi).second.object ();
+ (ursi != unresolved.end ()) && !((*ursi).second)->object ();
++ursi)
{
- rld::symbols::symbol& urs = (*ursi).second;
+ rld::symbols::symbol& urs = *((*ursi).second);
rld::symbols::table::iterator esi = base_symbols.find (urs.name ());
bool base = true;
+ if (rld::verbose () >= RLD_VERBOSE_INFO)
+ {
+ std::cout << "resolver:resolve : "
+ << std::setw (nesting + 1) << ' '
+ << urs.name () << std::endl;
+ }
+
if (esi == base_symbols.end ())
{
esi = symbols.find (urs.name ());
@@ -88,7 +95,7 @@ namespace rld
base = false;
}
- rld::symbols::symbol& es = (*esi).second;
+ rld::symbols::symbol& es = *((*esi).second);
if (rld::verbose () >= RLD_VERBOSE_INFO)
{