Re: get rid weak symbols code

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

 



On Mon, Apr 04, 2011 at 01:24:06PM +0100, Andrew Haley wrote:
> On 04/04/2011 11:39 AM, Jiri Olsa wrote:
> > Andrew wrote:
> >> Try -ffunction-sections .
> > 
> > that did not help, I stil can see the dead code in the final
> > executable. I tried it together with some of the -O options but
> > that did not help as well..
> > 
> > any other ideas?
> 
> Please don't top-post on gcc lists.
> 
> > ps please keep me in CC as I'm not subscribed to the list, thanks
> 
> That works for me.  You'll have to tell us what you did.
> 
>  $ gcc a.c b.c -ffunction-sections
>  $ nm a.out | grep -i ' t '
> 00000000004005b0 t __do_global_ctors_aux
> 0000000000400430 t __do_global_dtors_aux
> 00000000004005a0 T __libc_csu_fini
> 0000000000400510 T __libc_csu_init
> 00000000004005e8 T _fini
> 0000000000400390 T _init
> 00000000004003e0 T _start
> 000000000040040c t call_gmon_start
> 00000000004004a0 t frame_dummy
> 00000000004004f4 T krava
> 00000000004004d9 T main

right ;) my main concern was that after the linking,
the dead code (overloaded functions) stayed in the binary - even
with no symbol assigned.

But I was advised to use ld option "--gc-sections" together with
"-ffunction-sections", which removed unused sections (functions)
out of the final binary

so I'm fine for now ;)

thanks,
jirka


[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