Re: same symbol appearing many times in executable

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

 



Bahadir Balban <bbalban@xxxxxxxxxx> writes:

> I see multiple instances of the same symbol in the final executable. I
> am suprised because I would expect them to not appear at all, if
> compiler chose to inline them. If it did not choose to inline, I would
> expect it to appear only once. This is because even though each instance
> would be available in every .o file including the header, during the
> final link they should have been reduced to one instance.

That last step does not occur by default.  It requires directing the
linker to find and eliminate those duplicates.  When using the gold
linker, you can make it occur in some cases by compiling with
-ffunction-sections and linking with --icf-safe.

Ian


[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