greymd / teip

Masking tape to help commands "do one thing well"
MIT License
569 stars 19 forks source link

strip binary file #47

Closed greymd closed 1 year ago

greymd commented 1 year ago
~ $ uname -a
Linux ip-172-31-9-222 5.4.0-1093-aws #102~18.04.2-Ubuntu SMP Wed Dec 7 00:31:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
~ $ size -A /usr/bin/teip
/usr/bin/teip  :
section                 size      addr
.note.gnu.build-id        36       624
.gnu.hash                 28       664
.dynsym                   24       696
.dynstr                    1       720
.rela.dyn             239160       728
.init                      3    241664
.plt                      16    241680
.plt.got                   8    241696
.text                1654051    241712
.fini                      3   1895763
.rodata               626952   1896448
.eh_frame_hdr          30356   2523400
.gcc_except_table      51984   2553756
.eh_frame             189588   2610800
.tdata                    40   2800392
.tbss                    160   2800432
.init_array                8   2800432
.fini_array                8   2800440
.data.rel.ro          167384   2800448
.dynamic                 384   2967832
.got                    5456   2968216
.data                  20000   2973696
.bss                    9160   2993696
.comment                  60         0
.debug_aranges         52512         0
.debug_pubnames       531616         0
.debug_info           926493         0
.debug_abbrev          15776         0
.debug_line           468849         0
.debug_frame           13624         0
.debug_str           1256784         0
.debug_pubtypes          198         0
.debug_ranges         608736         0
Total                6869458

~ $ du -h /usr/bin/teip
7.4M    /usr/bin/teip
~ $ du  /usr/bin/teip
7532    /usr/bin/teip

Executable file has debug symbols and it occupies big part of the file. It should be removed.

greymd commented 1 year ago

stripped at v2.2.0

$ du -s **/* | grep bin/teip
15040   teip-2.1.0.x86_64-unknown-linux-musl/bin/teip
6048    teip-2.2.0.x86_64-unknown-linux-musl/bin/teip
$ du -hs **/* | grep bin/teip
7.3M    teip-2.1.0.x86_64-unknown-linux-musl/bin/teip
3.0M    teip-2.2.0.x86_64-unknown-linux-musl/bin/teip