Recent

Author Topic: Strange big size only of Linux x64 executable  (Read 8059 times)

ASerge

  • Hero Member
  • *****
  • Posts: 2223
Re: Strange big size only of Linux x64 executable
« Reply #15 on: February 20, 2018, 02:19:41 pm »
...debug info brings unexpected size bloat to executable. Much bigger then on Win64 platform. We'll see...
Huh!
Windows. Lazarus 1.8 x64. Empty GUI Project.
Without debug - 2.51 MB.
With debug - 19.7 MB.

Thaddy

  • Hero Member
  • *****
  • Posts: 14211
  • Probably until I exterminate Putin.
Re: Strange big size only of Linux x64 executable
« Reply #16 on: February 20, 2018, 04:00:11 pm »
I know.
But Avra has included particular settings. Conclusion is about the same for everyone: ~ 3.4-~3.8 after stripping. And that value is always close. NOT the value with debug info.Depending on settings and debugger, Linux is verbose. Always has been. It is NOT the "my exe looks so big" but a "why is my exe so big and I know what I am doing" .. Hey,  it's Avra...not ASerge.... :P (just kidding...  :-X :D :D ) Spot what we are overlooking...
« Last Edit: February 20, 2018, 04:06:23 pm by Thaddy »
Specialize a type, not a var.

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: Strange big size only of Linux x64 executable
« Reply #17 on: February 21, 2018, 09:16:10 am »
Hey,  it's Avra...not ASerge.... :P (just kidding...  :-X :D :D )
I prefer funny Thaddy over grumpy Thaddy any time  8) :-X

Here are the results of the test on Laz 1.8.1 + FPC 3.0.5 cross compiler (brackets show size of external dbg file):

ExecutableSmartLink + ExternDebugInfo      SmartLink + Strip
ct2laz-i386-win32.exe2589715 (1668133)2583040
ct2laz-i386-linux2704524 (2475036)2700208
ct2laz-x86_64-win64.exe     3551763 (3233312)3540992
ct2laz-x86_64-linux6378600 (5030304)3616816

It looks like Thaddy was on the right track and size of Lin64 debug info is to blame. All other platforms have size difference od less then 1% between stripped executables and executables with external debug info. Only Lin64 breaks this proportion (3616816 vs 6378600). Like some part of debug info ended up into Lin64 executable although it should go to external dbg file.

Is this a bug or some Lin64 specific thing?

I have attached elfreader outputs for Lin32 and Lin64 executables (with external dbf file) if someone can take a look.
« Last Edit: February 21, 2018, 09:29:04 am by avra »
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

Thaddy

  • Hero Member
  • *****
  • Posts: 14211
  • Probably until I exterminate Putin.
Re: Strange big size only of Linux x64 executable
« Reply #18 on: February 21, 2018, 09:31:48 am »
It is a bug: even if external debug info is specified, the binary still contains all or some of the debug info too. So the debug info is at least partially stored twice. You can probably delete the external debugger file and it might still debug, but I have to test that. (And I did not do that yet: today no lin64 for me.) Try deleting external info and run the binary under gdb directly.
« Last Edit: February 21, 2018, 09:35:02 am by Thaddy »
Specialize a type, not a var.

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: Strange big size only of Linux x64 executable
« Reply #19 on: February 21, 2018, 10:04:46 am »
You can probably delete the external debugger file and it might still debug, but I have to test that. (And I did not do that yet: today no lin64 for me.) Try deleting external info and run the binary under gdb directly.
Neither do I have access to Lin64 at the moment. However I have cross compiled with debug info this time but without external debug file. Here are the results:

ExecutableSmartLink + InternDebugInfo      SmartLink + ExternDebugInfo      SmartLink + Strip
ct2laz-i386-win32.exe42562932589715 (1668133)2583040
ct2laz-i386-linux51778242704524 (2475036)2700208
ct2laz-x86_64-win64.exe     67835203551763 (3233312)3540992
ct2laz-x86_64-linux114060966378600 (5030304)3616816

When debug info is built into executable, all platforms behave the same way and have expected size (DbgExeSize roughly equals ExeSize plus ExtDbgInfoSize). So the only strange thing left is big unexpected size of Lin64 executable when there is an external debug file.
« Last Edit: February 21, 2018, 10:09:27 am by avra »
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

Thaddy

  • Hero Member
  • *****
  • Posts: 14211
  • Probably until I exterminate Putin.
Re: Strange big size only of Linux x64 executable
« Reply #20 on: February 21, 2018, 10:23:12 am »
ct2laz-x86_64-win64.exe        6783520   3551763 (3233312)   3540992
ct2laz-x86_64-linux   11406096   6378600 (5030304)   3616816

That looks like (almost) a factor of two to me?? 11406096/6783520 and correlation amongst platforms otherwise. No ghost but reminds me of Marcellus:
Quote
Something is rotten in the state of Denmark x86_64-linux64.

Hamlet (1.4), Marcellus to Horatio
« Last Edit: February 21, 2018, 11:21:49 am by Thaddy »
Specialize a type, not a var.

 

TinyPortal © 2005-2018