Hello everyone,<div><br></div><div>I'm new here, and if I did/said something wrong, please point out instead of throwing stones at me :-)</div><div><br></div><div>I'm currently developing stuffs with winelibs, and when building a shared lib with winegcc, I find the generated file is weirdly large.</div>

<div>The example below illustrates my problem.</div><div><br></div><div>// this is a.c</div><div><div>__attribute__((cdecl)) void *test()</div><div>{</div><div>    return 0;</div><div>}</div></div><div><br></div><div>// and this is a.spec</div>

<div>@ cdecl test()</div><div><br></div><div>Then I compiled them using 'winegcc a.c a.spec -shared -fPIC -m32', and then found the resulting file <a href="http://a.out.so">a.out.so</a> is about 70KB in size:</div>

<div><div>[pengyu@pengyu-Studio-1747 tmp]$ls <a href="http://a.out.so">a.out.so</a> -l</div><div>-rwxr-xr-x 1 pengyu users 75893 Feb 17 19:16 <a href="http://a.out.so">a.out.so</a></div></div><div><br></div><div>By analyzing the file I found in <a href="http://a.out.so">a.out.so</a> there is an extremely large section .init with size of nearly 70KB. That's weird since a normal .init section is quite small. Though I know wine would do its initialization here, but 70KB is still too large I think.</div>

<div>And after disassembling and also viewing the file with hexadecimal viewer, I found nearly all contents of .init section of <a href="http://a.out.so">a.out.so</a> is filled with zero bits.</div><div>Is this a bug or feature? Since .init section is read/execute only, I didn't see any benefit from these filling zeros.</div>

<div>Can anybody make some explanations please? And, is there any methods to remove these zeros in the generated shared object and get a smaller file?</div><div><br></div><div>Regards,</div><div>Pengyu</div><div><div><br>

</div>-- <br><div><font color="#777777" face="Georgia, serif"><span style="font-size:13px;background-color:rgb(255,255,255)"><i><div><span style="font-size:14px;line-height:18px"><div><div>[A very large, very cold, and extremely isolated planet.]</div>

<div>[ApertureScience][Grow Old or Die Trying]</div><div>[ZJU/ComputerScience][Archer/Googler/kind of geek]</div><div>[C/Python/Mathematica/CommonLisp/Assembly]</div><div>[CpyPrefersYou/HjrJustifiablyReturns]</div><div>[<a href="http://about.me/cpy" target="_blank">AboutMe</a>]</div>

</div></span></div></i></span></font></div><br>
</div>