-
Notifications
You must be signed in to change notification settings - Fork 252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stripped ld.so breaks valgrind #850
Comments
I can buy this. Looking at what Arch Linux does, they appear to selectively strip some but not all of the ELF binaries: https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/glibc#n163. They even call out not stripping I'll see what an update might look like here… |
Here is my testing diff to the Glibc plan (currently against the base plans refresh PR): diff --git a/glibc/plan.sh b/glibc/plan.sh
index 62c63f06..92d5b948 100644
--- a/glibc/plan.sh
+++ b/glibc/plan.sh
@@ -322,6 +322,29 @@ EOF
popd > /dev/null
}
+do_strip() {
+ build_line "Stripping unneeded symbols from binaries and libraries"
+ find $pkg_prefix -type f -perm -u+w -print0 2> /dev/null \
+ | while read -rd '' f; do
+ case "$(basename "$f")" in
+ "ld-${pkg_version}.so"|\
+ "libc-${pkg_version}.so"|\
+ "libpthread-${pkg_version}.so"|\
+ libpthread_db-1.0.so)
+ build_line "Skipping strip for $f"
+ continue
+ ;;
+ esac
+
+ case "$(file -bi "$f")" in
+ *application/x-executable*) strip --strip-all "$f";;
+ *application/x-sharedlib*) strip --strip-unneeded "$f";;
+ *application/x-archive*) strip --strip-debug "$f";;
+ *) continue;;
+ esac
+ done
+}
+
do_end() {
# Clean up the `pwd` link, if we set it up.
if [[ -n "$_clean_pwd" ]]; then |
@fnichol , with the patch you posted, is that the only thing we would need to do in order to get |
submitted #2202 so we can get some traction on this. It would be nice to have, although there is something about ArchLinux plan that allows them to strip the shared objects as optional. Perhaps we should have |
The current version of ld.so that we ship is stripped:
This is of course expected; however, it does cause some problems. For instance valgrind doesn't work on executables using this stripped loader:
This may have been working in the past because of the bug fixed in habitat-sh/habitat@8e8ab12
The valgrind error message points to 2 solutions: (1) avoid stripping ld.so or (2) ship debugging information in a separate package like some distributions do. (2) would also help for tools like gdb which know how to read debug symbols from auxiliary locations.
https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html
http://valgrind.org/docs/manual/dist.readme-packagers.html
The text was updated successfully, but these errors were encountered: