[PATCH][gold] Don't add .eh_frame sections as root nodes for GC.

Igor Kudrin ikudrin@accesssoftek.com
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
output file.

The test for this patch requires PR20717 to be fixed.

Best regards,
Igor Kudrin


	* 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...
Name: gold-gc-with-keep-eh_frame.patch.txt
URL: <https://sourceware.org/pipermail/binutils/attachments/20161019/3d4c1af0/attachment.txt>

More information about the Binutils mailing list