This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: gold patch for doing garbage collection of unreferenced sections (--gc-sections)
- From: Ian Lance Taylor <iant at google dot com>
- To: Sriraman Tallam <tmsriram at google dot com>
- Cc: binutils at sourceware dot org, Cary Coutant <ccoutant at google dot com>
- Date: Mon, 26 Jan 2009 21:23:03 -0800
- Subject: Re: gold patch for doing garbage collection of unreferenced sections (--gc-sections)
- References: <863b0cbf0901211846w7f042fe6t3f968c71e37ec575@mail.gmail.com> <863b0cbf0901221459v2863fe58r9a5358b3d6b279fc@mail.gmail.com>
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