[PATCH][gold] Don't add .eh_frame sections as root nodes for GC.
Wed Oct 19 15:22:00 GMT 2016
We should not add .eh_frame sections as root nodes for GC even if they
are requested to be KEPT by the linker script. These sections are
handled in a special way and their references to other sections should
not prevent GC to collect the referenced sections if they are unused.
Please note that the KEEP statement for .eh_frame* sections cannot be
removed because in that case ld won't store these sections into the
The test for this patch requires PR20717 to be fixed.
* object.cc (Sized_relobj_file::do_layout): Don't add
.eh_frame* sections as root nodes for GC.
* testsuite/Makefile.am (gc_keep_eh_frame): New test.
* testsuite/Makefile.in: Regenerate.
* testsuite/gc_keep_eh_frame.cc: New test source file.
* testsuite/gc_keep_eh_frame.sh: New test script.
* testsuite/gc_keep_eh_frame.t: New test linker script.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
More information about the Binutils