[gold][patch] a bit of plugin code refactoring
Rafael Espindola
espindola@google.com
Thu Feb 12 19:32:00 GMT 2009
I noticed that both Object and Pluginobj have similar do_add_symbols
methods that are already virtual.
By adding the missing argument to each do_add_symbols, it is easy to make
Add_symbols work with both (like archive does).
It is probably possible to simplify this a bit more, but this is probably
a good sized patch in itself.
I tested it with make check both with and without --enable-threads. I also did
a quick check with two llvm IL files and they were linked correctly.
8 files changed, 28 insertions(+), 120 deletions(-)
2009-02-15 Rafael Avila de Espindola <espindola@google.com>
* archive.cc (Archive::include_member): Update calls to add_symbols.
* dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
the Layout argument.
* dynobj.h (do_add_symbols): Add the Layout argument.
* object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
Layout argument.
* object.h (Object::add_symbols): Add the Layout argument.
(Object::do_add_symbols): Add the Layout argument.
(Sized_relobj::do_add_symbols): Add the Layout argument.
* plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
Unify the two versions.
(Add_plugin_symbols): Remove.
* plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
(Sized_pluginobj::do_add_symbols): Unify the two versions.
(Add_plugin_symbols): Remove.
* readsyms.cc (Read_symbols::do_read_symbols): Update call to
Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
(Add_symbols::run): Make it work with Pulginobj.
Cheers,
--
Rafael Avila de Espindola
Google | Gordon House | Barrow Street | Dublin 4 | Ireland
Registered in Dublin, Ireland | Registration Number: 368047
-------------- next part --------------
A non-text attachment was scrubbed...
Name: factor.patch
Type: text/x-patch
Size: 9846 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20090212/e3e123ee/attachment.bin>
More information about the Binutils
mailing list