AnsweredAssumed Answered

Stripping elf files doesn't remove all debug info?

Question asked by skstrobel on Jan 27, 2012
Latest reply on Feb 3, 2012 by Aaronwu

I rebuilt the Qt libraries with debug info, statically linked them (fdpic) with my application, then stripped the application (using the default settings to strip).  I was surprised to find that it didn't get as small as it was when linked against libraries built without debug info (about 13MB versus 10MB).  I haven't yet compared the sections in the application elf files to see what the differences are.  Is there anything that would prevent me from getting it back to the original size?

 

Would there by any advantage to stripping the libraries before linking them with the application?  Or would the result be the same as linking the application then stripping the result (as I am doing now)?

 

I don't think it will work to build the libraries twice, once with debug info enabled (to get a version with debug info for the host to use) and once with it disabled (to get a smaller elf to load on the target).  I (inadvertantly) did that and found that when I tried to debug, it complained that the threading libraries were incompatible.

 

I also tried using the --strip-debug option to strip and found that it didn't make the elf as small as the default arguments (about 15MB, the original file was about 18MB).  Is there any reason to use --strip-debug rather than the defaults when preparing a file to run on the target?  Do the default settings remove something that is needed?

 

Thanks,

Steve

Outcomes