Remove .symtab from libc.so.6 again (#1965374)

Apparently, debugedit changes the build ID, so the separated debuginfo
no longer matches the specially crafted copy of libc.so.6 with its
minimal .symtab.
This commit is contained in:
Florian Weimer 2021-06-17 10:31:26 +02:00
parent b5405a57ad
commit 654f636b32
2 changed files with 10 additions and 40 deletions

View File

@ -97,7 +97,7 @@
Summary: The GNU libc libraries
Name: glibc
Version: %{glibcversion}
Release: 19%{?dist}
Release: 20%{?dist}
# In general, GPLv2+ is used by programs, LGPLv2+ is used for
# libraries.
@ -2184,6 +2184,9 @@ fi
%files -f compat-libpthread-nonshared.filelist -n compat-libpthread-nonshared
%changelog
* Thu Jun 17 2021 Florian Weimer <fweimer@redhat.com> - 2.33.9000-20
- Remove .symtab from libc.so.6 again (#1965374)
* Thu Jun 17 2021 Florian Weimer <fweimer@redhat.com> - 2.33.9000-19
- Drop glibc-rh697421.patch: The ISO-10646-UCS-2// alias for UTF-8 is incorrect
(#1972520)

View File

@ -9,14 +9,10 @@
# LDSO-PATH file, followed by note merging and DWZ compression.
# As a result, ld.so has (mostly) unchanged debuginfo even
# after debuginfo extraction.
#
# For libc.so.6, a set of strategic symbols is preserved in .symtab
# that are frequently used in valgrind suppressions.
set -ex
ldso_tmp="$(mktemp)"
libc_tmp="$(mktemp)"
# Prefer a separately installed debugedit over the RPM-integrated one.
if command -v debugedit >/dev/null ; then
@ -26,7 +22,7 @@ else
fi
cleanup () {
rm -f "$ldso_tmp" "$libc_tmp"
rm -f "$ldso_tmp"
}
trap cleanup 0
@ -47,50 +43,21 @@ for ldso_candidate in `find "$sysroot_path" -regextype posix-extended \
fi
done
# libc.so.6 always uses this name, so it is simpler to locate.
libc_path=
for libc_candidate in `find "$sysroot_path" -name libc.so.6`; do
if test -z "$libc_path" ; then
libc_path="$libc_candidate"
else
echo "error: multiple libc.so.6 candidates: $libc_path, $libc_candidate"
exit 1
fi
done
# Preserve the original files.
# Preserve the original file.
cp "$ldso_path" "$ldso_tmp"
cp "$libc_path" "$libc_tmp"
# Run the debuginfo extraction.
"$script_path" "$@"
# Restore the original files.
# Restore the original file.
cp "$ldso_tmp" "$ldso_path"
cp "$libc_tmp" "$libc_path"
# Reduce the size of notes. Primarily for annobin.
objcopy --merge-notes "$ldso_path"
objcopy --merge-notes "$libc_path"
# libc.so.6: Reduce to strategic symbols needed by valgrind.
# (Debuginfo is gone after this, so no need to optimize it.)
strip -w \
-K '*vfprintf*' \
-K '__bzero*' \
-K '__mem*' \
-K '__rawmemchr*' \
-K '__stp*' \
-K '__str*' \
-K '__wcs*' \
-K '__wmem*' \
-K '_nl_make_l10nflist' \
"$libc_path"
# ld.so: Rewrite the source file paths to match the extracted
# locations. First compute the arguments for invoking debugedit.
# See find-debuginfo.sh.
# Rewrite the source file paths to match the extracted locations.
# First compute the arguments for invoking debugedit. See
# find-debuginfo.sh.
debug_dest_name="/usr/src/debug"
last_arg=
while true ; do