Re: Why is the binary much larger than the object files?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have also faced similar issue with libstdc++
try enabling garbage collector flags which will reduce the size up to
some extent. ( Add -ffunction-sections -fdata-sections flags to your
compiler flags and -Wl,--gc-sections to your linker flags )
or else use alternatives of iostream function i.e. instead of cout
function use printf etc, try to avoid adding <iostream> library if you
can..



On Tue, Jul 9, 2013 at 7:26 PM, Florian Weimer <fweimer@xxxxxxxxxx> wrote:
> On 07/09/2013 02:39 PM, Henrik Mannerström wrote:
>>
>> On 07/09/2013 03:30 PM, Florian Weimer wrote:
>>>
>>>
>>> Do you link statically, by chance?  What does "ldd ./main" show?
>>>
>>          linux-vdso.so.1 =>  (0x00007fffdbec0000)
>>          libgsl.so.0 => /usr/lib64/libgsl.so.0 (0x000000347b200000)
>>          libcblas.so.3 => /usr/lib64/atlas/libcblas.so.3
>> (0x0000003477c00000)
>>          libatlas.so.3 => /usr/lib64/atlas/libatlas.so.3
>> (0x0000003477000000)
>>          libc.so.6 => /lib64/libc.so.6 (0x0000003463e00000)
>>          libm.so.6 => /lib64/libm.so.6 (0x0000003464200000)
>>          libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003464a00000)
>>          /lib64/ld-linux-x86-64.so.2 (0x0000003463a00000)
>
>
> Looks like you're linking statically against libstdc++.  Hard to tell if
> that's the real cause of the bloat you're seeing, though.
>
>
> --
> Florian Weimer / Red Hat Product Security Team





[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux