Bug 17085 - Hello world gets bigger with plugin.
Summary: Hello world gets bigger with plugin.
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Alan Modra
URL:
Keywords:
Depends on: 14918
Blocks:
  Show dependency treegraph
 
Reported: 2014-06-24 18:12 UTC by Jan Hubicka
Modified: 2014-08-06 10:49 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Hubicka 2014-06-24 18:12:41 UTC
Compiling C hello word gets into 2072 bytes of stripped binary with -flto -fuse-linker-plugin, wile it is 1882 with -flto -fno-use-linker-plugin. Seems to be difference in dyn* and hash* sections.
Comment 1 Alan Modra 2014-08-05 07:06:19 UTC
Right, you get more dynamic symbols.  These:
NOTYPE  WEAK   DEFAULT  UND _ITM_deregisterTMCloneTable
NOTYPE  WEAK   DEFAULT  UND _Jv_RegisterClasses
NOTYPE  WEAK   DEFAULT  UND _ITM_registerTMCloneTable

And the reason you get them is that libgcc_s.so is being linked via gcc's --pass-through option *outside of --as-needed*.  That also adds a DT_NEEDED tag for libgcc_s.so.1, which also increases the size of the binary.

I could say this is a gcc bug for continuing to use --pass-through, when ld hasn't needed that option for quite a while. :)
Comment 2 Alan Modra 2014-08-06 10:49:14 UTC
Fixed by git commit 97964ab3