summaryrefslogtreecommitdiff
path: root/linkers/rld-outputter.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
commit977c3de534bb5cce7935b47138efc2eac8e5ae23 (patch)
tree7a5625763dea69077a70265a41da4f4d6ea7eca6 /linkers/rld-outputter.cpp
parent0b65a28b57c070c4baa3820b4a6c4c4494b6bfef (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 'linkers/rld-outputter.cpp')
-rw-r--r--linkers/rld-outputter.cpp44
1 files changed, 3 insertions, 41 deletions
diff --git a/linkers/rld-outputter.cpp b/linkers/rld-outputter.cpp
index ef18d5d..bdd9dfa 100644
--- a/linkers/rld-outputter.cpp
+++ b/linkers/rld-outputter.cpp
@@ -68,7 +68,7 @@ namespace rld
ursi != unresolved.begin ();
++ursi)
{
- rld::symbols::symbol& urs = (*ursi).second;
+ rld::symbols::symbol& urs = *((*ursi).second);
++count;
@@ -98,6 +98,8 @@ namespace rld
++oi)
objects.push_back (*oi);
+ objects.unique ();
+
rld::files::archive arch (name);
arch.create (objects);
}
@@ -128,46 +130,6 @@ namespace rld
}
out.close ();
-
-#if 0
- rld::files::object_list objects;
- cache.get_objects (objects);
-
- for (rld::files::object_list::iterator oi = objects.begin ();
- oi != objects.end ();
- ++oi)
- {
- rld::files::object& obj = *(*oi);
-
- if (rld::verbose () >= RLD_VERBOSE_INFO)
- std::cout << " o: " << obj.name ().full () << std::endl;
-
- out << "o:" << obj.name ().basename () << std::endl;
- }
-
- for (rld::files::object_list::iterator oi = dependents.begin ();
- oi != dependents.end ();
- ++oi)
- {
- rld::files::object& obj = *(*oi);
- rld::symbols::table& unresolved = obj.unresolved_symbols ();
-
- if (rld::verbose () >= RLD_VERBOSE_INFO)
- std::cout << " d: " << obj.name ().full () << std::endl;
-
- out << "d:" << obj.name ().basename () << std::endl;
-
- int count = 0;
- for (rld::symbols::table::iterator ursi = unresolved.begin ();
- ursi != unresolved.begin ();
- ++ursi)
- {
- ++count;
- rld::symbols::symbol& urs = (*ursi).second;
- out << " u:" << count << ':' << urs.name () << std::endl;
- }
- }
-#endif
}
}
}