[patch] Ignore non relobj files in gc

Rafael Espíndola rafael.espindola@gmail.com
Thu Apr 23 02:27:00 GMT 2015


If a relocation points to a dynamic object we can ignore it, since we
cannot gc an already existing .so file.

The attached patch produces an identical chromium binary, but does so
a bit faster (see the attached perf logs).

Using Relobj also helps me in my patch for gcing parts of SHF_MERGE sections.

Cheers,
Rafael


2015-04-22  Rafael Ávila de Espíndola <rafael.espindola@gmail.com>

* gc.cc (Garbage_collection::do_transitive_closure): Use Rel_section_id.
* gc.h (Garbage_collection): Use Rel_section_id.
(is_section_garbage): Use Relobj.
(add_cident_section): Use Relobj.
(add_reference): Use Relobj and Rel_section_id.
(gc_process_relocs): Ignore non Relobj objects.
* object.cc (do_layout): Use Rel_section_id.
* object.h (Rel_section_id): New.
* powerpc.cc (Powerpc_relobj): Use Rel_section_id.
(add_reference): Use Relobj and Rel_section_id.
(do_gc_add_reference): Use Relobj.
(gc_process_relocs): Use Relobj.
(do_gc_mark_symbol): Use Rel_section_id.
* symtab.cc (gc_mark_symbol): Use Rel_section_id.
* symtab.h (relobj): New.
* target.h (gc_add_reference): Use Relobj.
(do_gc_add_reference): Use Relobj.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.patch
Type: text/x-patch
Size: 10251 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20150423/acba9f64/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: master.log
Type: text/x-log
Size: 22754 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20150423/acba9f64/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.log
Type: text/x-log
Size: 22753 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20150423/acba9f64/attachment-0002.bin>


More information about the Binutils mailing list