June 2017
Intermediate to advanced
478 pages
13h 14m
English
Libraries and programs are often compiled with some information stored in symbol tables to aid debugging and tracing. You seldom need these in a production system. A quick and easy way to save space is to strip the binaries of symbol tables. This example shows libc before stripping:
$ file rootfs/lib/libc-2.22.solib/libc-2.22.so: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (GNU/Linux), dynamically linked (uses shared libs), for GNU/Linux 4.3.0, not stripped$ ls -og rootfs/lib/libc-2.22.so-rwxr-xr-x 1 1542572 Mar 3 15:22 rootfs/lib/libc-2.22.so
Now, let's see the result of stripping debug information:
$ arm-cortex_a8-linux-gnueabihf-strip rootfs/lib/libc-2.22.so$ file rootfs/lib/libc-2.22.sorootfs/lib/libc-2.22.so: ...Read now
Unlock full access