Keep most of .symtab in libc.so.6 (#1975859)

This commit is contained in:
Florian Weimer 2021-06-28 07:49:20 +02:00
parent 40177ead73
commit 4f2dd301cc
2 changed files with 18 additions and 33 deletions

View File

@ -111,7 +111,7 @@
Summary: The GNU libc libraries Summary: The GNU libc libraries
Name: glibc Name: glibc
Version: %{glibcversion} Version: %{glibcversion}
Release: 29%{?dist} Release: 30%{?dist}
# In general, GPLv2+ is used by programs, LGPLv2+ is used for # In general, GPLv2+ is used by programs, LGPLv2+ is used for
# libraries. # libraries.
@ -2213,6 +2213,9 @@ fi
%files -f compat-libpthread-nonshared.filelist -n compat-libpthread-nonshared %files -f compat-libpthread-nonshared.filelist -n compat-libpthread-nonshared
%changelog %changelog
* Mon Jun 28 2021 Florian Weimer <fweimer@redhat.com> - 2.33.9000-30
- Keep most of .symtab in libc.so.6 (#1975859)
* Sun Jun 27 2021 Florian Weimer <fweimer@redhat.com> - 2.33.9000-29 * Sun Jun 27 2021 Florian Weimer <fweimer@redhat.com> - 2.33.9000-29
- Apply emergency patch to fix iconvconfig corruption - Apply emergency patch to fix iconvconfig corruption

View File

@ -11,7 +11,7 @@
# after debuginfo extraction. # after debuginfo extraction.
# #
# For libc.so.6, a set of strategic symbols is preserved in .symtab # For libc.so.6, a set of strategic symbols is preserved in .symtab
# that are frequently used in valgrind suppressions. # that are frequently used in valgrind suppressions and elsewhere.
set -ex set -ex
@ -74,10 +74,19 @@ cp "$libc_tmp" "$libc_path"
objcopy --merge-notes "$ldso_path" objcopy --merge-notes "$ldso_path"
objcopy --merge-notes "$libc_path" objcopy --merge-notes "$libc_path"
# libc.so.6: Reduce to strategic symbols needed by valgrind. # libc.so.6: Reduce to valuable symbols. Eliminate file symbols,
# pthread_create is needed to trigger loading of libthread_db in GDB. # annobin symbols, and symbols used by the glibc build to implement
# (Debuginfo is gone after this, so no need to optimize it.) # hidden aliases (__EI_* and __GI_*). Preserve __GI_* symbols used by
strip \ # valgrind interceptors. (Debuginfo is gone after this, so no need to
# optimize it.)
strip -w \
-K '*' \
-K '!*.c' \
-K '!*.os' \
-K '!.annobin_*' \
-K '!__EI_*' \
-K '!__GI_*' \
-K '!__PRETTY_FUNCTION__*' \
-K __GI___rawmemchr \ -K __GI___rawmemchr \
-K __GI___strcasecmp_l \ -K __GI___strcasecmp_l \
-K __GI___strncasecmp_l \ -K __GI___strncasecmp_l \
@ -103,33 +112,6 @@ strip \
-K __GI_strrchr \ -K __GI_strrchr \
-K __GI_wcsnlen \ -K __GI_wcsnlen \
-K __GI_wmemchr \ -K __GI_wmemchr \
-K __memcmp_sse2 \
-K __memcmp_sse4_1 \
-K __memcpy_avx_unaligned_erms \
-K __memcpy_chk \
-K __memcpy_sse2 \
-K __memmove_chk \
-K __stpcpy_chk \
-K __stpcpy_sse2 \
-K __stpcpy_sse2_unaligned \
-K __strchr_sse2 \
-K __strchr_sse2_no_bsf \
-K __strcmp_sse2 \
-K __strcmp_sse42 \
-K __strcpy_chk \
-K __strlen_sse2 \
-K __strlen_sse2_no_bsf \
-K __strlen_sse42 \
-K __strncmp_sse2 \
-K __strncmp_sse42 \
-K __strncpy_sse2 \
-K __strncpy_sse2_unaligned \
-K __strrchr_sse2 \
-K __strrchr_sse2_no_bsf \
-K __strrchr_sse42 \
-K __strstr_sse2 \
-K __strstr_sse42 \
-K pthread_create \
"$libc_path" "$libc_path"
# ld.so: Rewrite the source file paths to match the extracted # ld.so: Rewrite the source file paths to match the extracted