Import glibc-2.34-43.fc35 from f35

* Mon Oct 03 2022 Arjun Shankar <arjun@redhat.com> - 2.34-43
- Remove .annobin* symbols from ld.so (#2126477)

Resolves: #2115831
This commit is contained in:
Arjun Shankar 2022-10-04 18:59:41 +02:00
parent c3e41ff9aa
commit d3604d02a2
2 changed files with 16 additions and 7 deletions

View File

@ -148,7 +148,7 @@ end \
Summary: The GNU libc libraries
Name: glibc
Version: %{glibcversion}
Release: 42%{?dist}
Release: 43%{?dist}
# In general, GPLv2+ is used by programs, LGPLv2+ is used for
# libraries.
@ -2641,6 +2641,9 @@ fi
%files -f compat-libpthread-nonshared.filelist -n compat-libpthread-nonshared
%changelog
* Mon Oct 03 2022 Arjun Shankar <arjun@redhat.com> - 2.34-43
- Remove .annobin* symbols from ld.so (#2126477)
* Tue Sep 06 2022 Arjun Shankar <arjun@redhat.com> - 2.34-42
- Co-Authored-By: Benjamin Herrenschmidt <benh@amazon.com>
- Retain .gnu_debuglink section in libc.so.6 (#2090744)

View File

@ -15,9 +15,10 @@
set -ex
ldso_tmp="$(mktemp)"
libc_tmp="$(mktemp)"
libc_dlink_tmp="$(mktemp)"
workdir="$(mktemp -d -t find_debuginfo.XXXXXX)"
ldso_tmp="$workdir/ld.so"
libc_tmp="$workdir/libc.so"
# Prefer a separately installed debugedit over the RPM-integrated one.
if command -v debugedit >/dev/null ; then
@ -27,7 +28,7 @@ else
fi
cleanup () {
rm -f "$ldso_tmp" "$libc_tmp" "$libc_dlink_tmp"
rm -rf "$workdir"
}
trap cleanup 0
@ -69,7 +70,7 @@ cp "$libc_path" "$libc_tmp"
# libc.so.6: Extract the .gnu_debuglink section
objcopy -j.gnu_debuglink --set-section-flags .gnu_debuglink=alloc \
-O binary "$libc_path" "$libc_dlink_tmp"
-O binary "$libc_path" "$libc_tmp.debuglink"
# Restore the original files.
cp "$ldso_tmp" "$ldso_path"
@ -80,7 +81,7 @@ objcopy --merge-notes "$ldso_path"
objcopy --merge-notes "$libc_path"
# libc.so.6: Restore the .gnu_debuglink section
objcopy --add-section .gnu_debuglink="$libc_dlink_tmp" "$libc_path"
objcopy --add-section .gnu_debuglink="$libc_tmp.debuglink" "$libc_path"
# ld.so does not have separated debuginfo and so the debuginfo file
# generated by find-debuginfo is redundant. Therefore, remove it.
@ -134,6 +135,11 @@ while true ; do
done
debug_base_name=${last_arg:-$RPM_BUILD_ROOT}
$debugedit -b "$debug_base_name" -d "$debug_dest_name" -n $ldso_path
# Remove the .annobin* symbols (and only them).
if nm --format=just-symbols "$ldso_path" \
| grep '^\.annobin' > "$ldso_tmp.annobin-symbols"; then
objcopy --strip-symbols="$ldso_tmp.annobin-symbols" "$ldso_path"
fi
# Apply single-file DWARF optimization.
dwz $ldso_path