Bug 25996 - [Qt] Dead-code stripping for unix
Summary: [Qt] Dead-code stripping for unix
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Qt (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-24 13:08 PDT by Laszlo Gombos
Modified: 2009-06-17 07:22 PDT (History)
1 user (show)

See Also:


Attachments
Turn on GCC dead-code stripping flags for Unix (1.07 KB, patch)
2009-05-24 13:12 PDT, Laszlo Gombos
zecke: review+
Details | Formatted Diff | Diff
List of dead symbols - Qt port on Linux (263.13 KB, text/plain)
2009-05-25 11:34 PDT, Laszlo Gombos
no flags Details
Regenerated dead symbol list for r44682 (273.60 KB, text/plain)
2009-06-17 07:13 PDT, Laszlo Gombos
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Laszlo Gombos 2009-05-24 13:08:07 PDT
Turn on dead-code stripping for the Qt port - Unix (no Mac) and GCC only.

In default configuration, this change reduced the binary size by ~6% (with 1.23 Mb); removed ~3900 dead symbols (statistics based on r44115)
Comment 1 Laszlo Gombos 2009-05-24 13:12:37 PDT
Created attachment 30633 [details]
Turn on GCC dead-code stripping flags for Unix
Comment 2 Laszlo Gombos 2009-05-24 22:01:06 PDT
(In reply to comment #0)
> Turn on dead-code stripping for the Qt port - Unix (no Mac) and GCC only.
> In default configuration, this change reduced the binary size by ~6% (with 1.23
> Mb); removed ~3900 dead symbols (statistics based on r44115)

Cross the dead symbol statistics, it should be less than the number I gave..
Comment 3 Holger Freyther 2009-05-24 22:26:58 PDT
Do you have a list of dead symbols?
Comment 4 Laszlo Gombos 2009-05-25 11:34:25 PDT
Created attachment 30654 [details]
List of dead symbols - Qt port on Linux

~ 3400 dead symbols; my initial numbers were not far off; Interesting list to scan trough.
Comment 5 Holger Freyther 2009-05-26 21:21:07 PDT
Comment on attachment 30633 [details]
Turn on GCC dead-code stripping flags for Unix

I'm a bit sad. I had the hope that the linker would remove these symbols... the other sad part is linking time will be slighly increased now?
Comment 6 Holger Freyther 2009-05-26 23:36:39 PDT
Landed in r44179. Thanks.
Comment 7 Simon Hausmann 2009-06-17 00:42:52 PDT
On the top of the list of the dead symbols is _NPN_IntFromIdentifier, which is used right in PluginPackage.cpp (the address of the symbol is taken, so it can't be inlined). How did you generate the list? Was it generated on a build without netscape plugin support?
Comment 8 Laszlo Gombos 2009-06-17 07:13:35 PDT
Created attachment 31411 [details]
Regenerated dead symbol list for r44682
Comment 9 Laszlo Gombos 2009-06-17 07:22:19 PDT
(In reply to comment #7)
> On the top of the list of the dead symbols is _NPN_IntFromIdentifier, which is
> used right in PluginPackage.cpp (the address of the symbol is taken, so it
> can't be inlined). How did you generate the list? Was it generated on a build
> without netscape plugin support?

I regenerated the dead symbol list (QtWebKit release build on Linux) and _NPN_IntFromIdentifier no longer shows up as dead symbol (I do not have an explanation how the _NPN_IntFromIdentifier symbol ended up in the previous list). 

Here is a brief explanation on how I generated the list:
 - Make two builds; one with dead symbol stripping, one without it
 - Get all the defined symbols in each .so by running nm --defined-only
 - Get the delta of from the two symbol list and demangle the symbols with c++filt