This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gold patch for doing garbage collection of unreferenced sections (--gc-sections)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]