[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <26fa44a597716445c134d21194170c292d46a421.1403129369.git.luto@amacapital.net>
Date: Wed, 18 Jun 2014 15:59:50 -0700
From: Andy Lutomirski <luto@...capital.net>
To: Josh Boyer <jwboyer@...oraproject.org>,
"H. Peter Anvin" <hpa@...or.com>
Cc: "Linux-Kernel@...r. Kernel. Org" <linux-kernel@...r.kernel.org>,
Andy Lutomirski <luto@...capital.net>
Subject: [PATCH 5/5] x86,vdso: Create .build-id links for unstripped vdso files
With this change, doing 'make vdso_install' and telling gdb:
set debug-file-directory /lib/modules/KVER/vdso
will enable vdso debugging with symbols. This is useful for
testing, but kernel RPM builds will probably want to manually delete
these symlinks or otherwise do something sensible when they strip
the vdso/*.so files.
This may break make vdso_install with binutils before 2.17.50.0.17.
On the other hand, make vdso_install was probably never useful with
earlier binutils, since the installed files are AFAIK completely
useless without build-id.
Signed-off-by: Andy Lutomirski <luto@...capital.net>
---
arch/x86/vdso/Makefile | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/arch/x86/vdso/Makefile b/arch/x86/vdso/Makefile
index 2c1ca98..ac16c17 100644
--- a/arch/x86/vdso/Makefile
+++ b/arch/x86/vdso/Makefile
@@ -176,7 +176,14 @@ GCOV_PROFILE := n
# Install the unstripped copies of vdso*.so.
#
quiet_cmd_vdso_install = INSTALL $(@:install_%=%)
- cmd_vdso_install = cp $< $(MODLIB)/vdso/$(@:install_%=%)
+define cmd_vdso_install
+ buildid=`readelf -n $< |grep 'Build ID' |sed -e 's/^.*Build ID: \(.*\)$$/\1/'`; \
+ first=`echo $$buildid | cut -b-2`; \
+ last=`echo $$buildid | cut -b3-`; \
+ cp $< "$(MODLIB)/vdso/$(@:install_%=%)"; \
+ mkdir -p "$(MODLIB)/vdso/.build-id/$$first"; \
+ ln -sf "../../$(@:install_%=%)" "$(MODLIB)/vdso/.build-id/$$first/$$last.debug"
+endef
vdso_img_insttargets := $(vdso_img_sodbg:%.dbg=install_%)
--
1.9.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists