Changeset c32384e for chapter06/strippingagain.xml
- Timestamp:
- 04/26/2017 03:01:26 AM (7 years ago)
- Branches:
- 10.0, 10.0-rc1, 10.1, 10.1-rc1, 11.0, 11.0-rc1, 11.0-rc2, 11.0-rc3, 11.1, 11.1-rc1, 11.2, 11.2-rc1, 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, arm, bdubbs/gcc13, ml-11.0, multilib, renodr/libudev-from-systemd, s6-init, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/lfs-next, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/mips64el, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
- Children:
- 826bbcc
- Parents:
- 8a5a68d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter06/strippingagain.xml
r8a5a68d rc32384e 11 11 <title>Stripping Again</title> 12 12 13 <para>If the intended user is not a programmer and does not plan to do 13 <para>This section is optional. If the intended user is not a 14 programmer and does not plan to do 14 15 any debugging on the system software, the system size can be decreased 15 16 by about 90 MB by removing the debugging symbols from binaries and … … 23 24 backup of the LFS system in its current state.</para> 24 25 25 <para>First back up some libraries whose debug symbols are needed when 26 running regression tests in BLFS packages:</para> 26 <para>First place the debugging sysmbols for selected libraries 27 in separate files. This debugging information is needed if running 28 regression tests that use <ulink 29 url='&blfs-book;/general/prog/valgrind.html'>valgrind</ulink> or <ulink 30 url='&blfs-book;/general/prog/gdb.html'>gdb</ulink> later in BLFS. 31 </para> 27 32 28 33 <!-- also of interest are libgfortan, libgo, libgomp, and libobjc from gcc --> 29 <screen><userinput>save_libs="ld- libatomic libc- libcilkrts libitm libmpx libpthread"30 save_libs="$save_libs libquadmath libsanitizer libstdc++ libthread_db libvtv"31 34 32 mkdir -p /var/dbg/lib /var/dbg/usr/lib 35 <screen><userinput>save_lib="ld-2.25.so libc-2.25.so libpthread-2.25.so libthread_db-1.0.so" 33 36 34 for lib in $save_libs 35 do 36 find /usr/lib -name ${lib}*so* -type f -exec cp {} /var/dbg/usr/lib \; 37 find /lib -name ${lib}*so* -type f -exec cp {} /var/dbg/lib \; 38 done</userinput></screen> 37 cd /lib 38 39 for LIB in $save_lib; do 40 objcopy --only-keep-debug $LIB $LIB.dbg 41 strip --strip-unneeded $LIB 42 objcopy --add-gnu-debuglink=$LIB.dbg $LIB 43 done 44 45 save_usrlib="libquadmath.o.0.0.0 libstdc++.so.6.0.22 46 libmpx.so.2.0.0 libmpxwrappers.so.2.0.0 libitm.so.1.0.0 47 libcilkrts.so.5.0.0 libatomic.so.1.2.0" 48 49 cd /usr/lib 50 51 for LIB in $save_usrlib; do 52 objcopy --only-keep-debug $LIB $LIB.dbg 53 strip --strip-unneeded $LIB 54 objcopy --add-gnu-debuglink=$LIB.dbg $LIB 55 done 56 57 unset LIB save_lib save_usrlib</userinput></screen> 39 58 40 59 <para>Before performing the stripping, take special care to ensure that … … 58 77 -exec /tools/bin/strip --strip-debug {} ';' 59 78 60 /tools/bin/find /lib /usr/lib -type f -name \*.so*\79 /tools/bin/find /lib /usr/lib -type f \(-name \*.so* -a ! -name \*dbg\) \ 61 80 -exec /tools/bin/strip --strip-unneeded {} ';' 62 81 … … 69 88 binaries.</para> 70 89 71 <para>If desired, restore the saved libraries with the debug data72 intact. The files can restored now or just held for later use. Note73 that several of the files cannot be copied directly after rebooting74 to the new LFS system. Later use requires booting to another system,75 mounting the LFS partition, and then copying the files.</para>76 77 <screen><userinput>cp -av /var/dbg/lib/* /lib78 cp -av /var/dbg/usr/lib/* /usr/lib</userinput></screen>79 80 90 </sect1>
Note:
See TracChangeset
for help on using the changeset viewer.