Patch to do reorder text and data sections according to a user specified sequence.

Taras Glek tglek@mozilla.com
Sat Mar 6 02:35:00 GMT 2010


On 03/02/2010 06:43 PM, Sriraman Tallam wrote:
> Hi Ian,
>
>      I finally got around to making the changes you specified. Please
> take a look when you get a chance.

Hi Sriraman,
Ian pointed me at your patch when he realized I was trying to do the 
same thing with linker scripts. This is a big improvement over hacking 
linker scripts in terms of usability.

I had two issues with the patch:
a) It would be nice to specify the sections by symbol names alone. So 
instead of bss.globalvar one could say "globalvar". Ian pointed out that 
I solve this with a *.globalvar regexp since you use fnmatch(). Which 
lead me to my next problem.
b) This patch appears to have N^2 behavior since you are doing fnmatch() 
through the entire input_section_order list.

My link time for a large mozilla binary went from under 3s to over 
10minutes when I specified the order(24K entries).

I think adding a second argument to -section-ordering-file could help. 
The second argument could be 
-section-ordering-match=<symbol|section|regexp> where symbol/section 
could use a more efficient search.

Taras



More information about the Binutils mailing list