2010年1月12日 星期二

Dynamic Link Program Tips

1.Information of program

$ file pjsua-arm-unknown-linux-gnu
pjsua-arm-unknown-linux-gnu: ELF 32-bit LSB executable, ARM, version 1 (SYSV), for GNU/Linux 2.6.14, dynamically linked (uses shared libs), not stripped

顯示program為dynamic link, 未最佳化

2.Strip

$ arm-none-linux-gnueabi-strip pjsua-arm-unknown-linux-gnu
pjsua-arm-unknown-linux-gnu: ELF 32-bit LSB executable, ARM, version 1 (SYSV), for GNU/Linux 2.6.14, dynamically linked (uses shared libs), stripped

最佳化最明顯的效果是size變小

3.Shared Libraries

$ arm-none-linux-gnueabi-readelf -a pjsua-arm-unknown-linux-gnu | grep "Shared\ library"
 0x00000001 (NEEDED)                     Shared library: [libm.so.6]
 0x00000001 (NEEDED)                     Shared library: [libnsl.so.1]
 0x00000001 (NEEDED)                     Shared library: [librt.so.1]
 0x00000001 (NEEDED)                     Shared library: [libpthread.so.0]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]

顯示必須的shared library

沒有留言:

張貼留言