Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between a stripped binary and a non stripped binary in Linux

Tags:

Could anyone please explain me whats the actual difference between a stripped and a non-stripped binary in Linux ?

After a little bit of googling, I found that non-stripped binary contains the debugging info and stripped binary does'nt.

like image 413
Droider Avatar asked Mar 27 '14 08:03

Droider


People also ask

What is stripped binary Linux?

In Unix, Plan 9, and Unix-like operating systems, the strip program removes information from executable binary programs and object files that is not essential or required for normal and correct execution, thus potentially resulting in better performance and sometimes significantly less disk space usage.

What does stripping a binary mean?

A stripped binary is a program that is compiled with a strip flag that tells the compiler to discard these debugging symbols and compile to program as it is. Stripping a binary reduces its size on the disk and makes it a little more difficult to debug and reverse engineer.

What is an unstripped binary?

So if you compile an executable with gcc's -g flag, it contains debugging information. Whereas Strip binaries generally remove this debugging information from the exe which is not necessary for execution so as to reduce the size of the exe. Follow this answer to receive notifications.

Are stripped binaries faster?

Stripping a binary does not make your program load faster. The symbol table will not be loaded into memory unless it is needed for a backtrace if your program crashes. You can strip a binary from the command line using the strip command.


1 Answers

Although you have found your answer from the Google. Just putting that , non-stripped binaries have debugging information built into it. So if you compile an executable with gcc's -g flag, it contains debugging information. Whereas Strip binaries generally remove this debugging information from the exe which is not necessary for execution so as to reduce the size of the exe.

like image 138
Rahul Tripathi Avatar answered Oct 14 '22 14:10

Rahul Tripathi