gold patch for doing garbage collection of unreferenced sections (--gc-sections)
Ian Lance Taylor
iant@google.com
Tue Jan 27 05:23:00 GMT 2009
Sriraman Tallam <tmsriram@google.com> writes:
>> I have been working on a patch to gold that can garbage collect
>> unreferenced
>> sections. I have added the flag --gc-sections which will trigger garbage
>> collection.
>> The flag --print-gc-sections will print to stderr the list of deleted
>> sections.
>>
>> During garbage collection, the relocations are read much before output
>> sections are
>> assigned (do_layout) to each input section. The relocations are then
>> processed and a
>> transitive closure over the references determines which sections are
>> referenced. Then,
>> output sections are assigned to only to the referenced sections and linking
>> proceeds
>> as before.
This patch looks good. It needs an entry in the ChangeLog file.
Follow the format of the existing entries, and see
http://www.gnu.org/prep/standards/html_node/Change-Logs.html . Please
check the ChangeLog entry with me, and then go ahead and commit.
It would also be good to have some test cases. However, please do
that as a separate follow-on patch.
Thanks for all your work on this.
Ian
More information about the Binutils
mailing list