From 8731bd1cd0e7f77964f000d6a936d24a8a2f89f7 Mon Sep 17 00:00:00 2001 From: Pierre Labastie Date: Sun, 22 May 2022 09:57:28 +0200 Subject: [PATCH] stripping, chapter 8: prevent stripping ld-*.dbg With the construct used in save_usrlib, if ld-linux-...dbg already exists, it is stripped again and a file ld-linux-...dbg.dbg is created. Prevent this by not listing files ending in "g". --- chapter08/stripping.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/chapter08/stripping.xml b/chapter08/stripping.xml index e7ab14f6d..519119088 100644 --- a/chapter08/stripping.xml +++ b/chapter08/stripping.xml @@ -42,12 +42,14 @@ The ELF loader's name is ld-linux-x86-64.so.2 on 64-bit systems and ld-linux.so.2 on 32-bit systems. The construct below selects the - correct name for the current architecture. + correct name for the current architecture, excluding anything ending + with g, in case the commands below have already been + run. -save_usrlib="$(cd /usr/lib; ls ld-linux*) +save_usrlib="$(cd /usr/lib; ls ld-linux*[^g]) libc.so.6 libthread_db.so.1 libquadmath.so.&libquadmath-version;