diff options
author | Chris Johns <chrisj@rtems.org> | 2012-11-17 17:34:33 +1100 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2012-11-17 17:34:33 +1100 |
commit | 7ee957ca2f579802b4823ad562f05bd27ad425e1 (patch) | |
tree | 5f085ca653f2d80496e984b978b556b561127064 /rld.cpp | |
parent | d68833ada79a4255e95017b44f73dcb21c7a7701 (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.cpp')
-rw-r--r-- | rld.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -1,10 +1,10 @@ /* - * Copyright (c) 2011, Chris Johns <chrisj@rtems.org> + * Copyright (c) 2011, Chris Johns <chrisj@rtems.org> * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR @@ -64,7 +64,7 @@ namespace rld * The output passed on the command line. */ static std::string output; - + void verbose_inc () { @@ -116,7 +116,7 @@ namespace rld std::cout << "Archive files : " << cache.archive_count () << std::endl; std::cout << "Object files : " << cache.object_count () << std::endl; std::cout << "Exported symbols : " << symbols.size () << std::endl; - + std::cout << "Archives:" << std::endl; cache.output_archive_files (std::cout); std::cout << "Objects:" << std::endl; @@ -136,9 +136,9 @@ namespace rld oli != objects.end (); ++oli) { - rld::files::object& object = *(*oli); - rld::symbols::list& externals = object.external_symbols (); - + rld::files::object& object = *(*oli); + rld::symbols::pointers& externals = object.external_symbols (); + if (rld::symbols::referenced (externals) != externals.size ()) { if (first) @@ -149,7 +149,7 @@ namespace rld std::cout << ' ' << object.name ().basename () << std::endl; - for (rld::symbols::list::iterator sli = externals.begin (); + for (rld::symbols::pointers::iterator sli = externals.begin (); sli != externals.end (); ++sli) { |