Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936272AbXHMCPU (ORCPT ); Sun, 12 Aug 2007 22:15:20 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S934597AbXHMCPG (ORCPT ); Sun, 12 Aug 2007 22:15:06 -0400 Received: from mx1.redhat.com ([66.187.233.31]:53452 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934536AbXHMCPE (ORCPT ); Sun, 12 Aug 2007 22:15:04 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit From: Roland McGrath To: akpm@linux-foundation.org X-Fcc: ~/Mail/linus Cc: linux-kernel@vger.kernel.org Cc: ak@suse.de, sam@ravnborg.org Subject: [PATCH] i386 vDSO: install unstripped copies on disk In-Reply-To: akpm@linux-foundation.org's message of Friday, 10 August 2007 14:59:46 -0700 <200708102159.l7ALxk8u011793@imap1.linux-foundation.org> X-Fcc: ~/Mail/linus X-Shopping-List: (1) Celebrity table polluters (2) Complaisant exclamations (3) Prestigious conspicuous nostril socks (4) Omnipotent secretions Message-Id: <20070813021459.271D74D057D@magilla.localdomain> Date: Sun, 12 Aug 2007 19:14:59 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3801 Lines: 98 While integrating these with the Fedora kernel build, I worked out a few kinks. This patch replaces i386-vdso-install-unstripped-copies-on-disk.patch and i386-vdso-install-unstripped-copies-on-disk-fix.patch Thanks, Roland --- This keeps an unstripped copy of the vDSO images built before they are stripped and embedded in the kernel. The unstripped copies get installed in $(MODLIB)/vdso/ by "make install" (or you can explicitly use the subtarget "make vdso_install"). These files can be useful when they contain source-level debugging information. Signed-off-by: Roland McGrath Cc: Sam Ravnborg Cc: Andi Kleen --- arch/i386/Makefile | 1 + arch/i386/kernel/Makefile | 27 ++++++++++++++++++++++----- 2 files changed, 23 insertions(+), 5 deletions(-) diff -puN arch/i386/Makefile~i386-vdso-install-unstripped-copies-on-disk arch/i386/Makefile --- a/arch/i386/Makefile~i386-vdso-install-unstripped-copies-on-disk +++ a/arch/i386/Makefile @@ -141,9 +141,12 @@ zdisk bzdisk: vmlinux fdimage fdimage144 fdimage288 isoimage: vmlinux $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@ -install: +install: vdso_install $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) install +vdso_install: + $(Q)$(MAKE) $(build)=arch/i386/kernel vdso_install + archclean: $(Q)$(MAKE) $(clean)=arch/i386/boot diff -puN arch/i386/kernel/Makefile~i386-vdso-install-unstripped-copies-on-disk arch/i386/kernel/Makefile --- a/arch/i386/kernel/Makefile~i386-vdso-install-unstripped-copies-on-disk +++ a/arch/i386/kernel/Makefile @@ -52,7 +52,8 @@ obj-$(CONFIG_SCx200) += scx200.o # We must build both images before we can assemble it. # Note: kbuild does not track this dependency due to usage of .incbin $(obj)/vsyscall.o: $(obj)/vsyscall-int80.so $(obj)/vsyscall-sysenter.so -targets += $(foreach F,int80 sysenter,vsyscall-$F.o vsyscall-$F.so) +targets += $(foreach F,$(addprefix vsyscall-,int80 sysenter),\ + $F.o $F.so $F.so.dbg) targets += vsyscall-note.o vsyscall.lds # The DSO images are built using a special linker script. @@ -62,16 +63,32 @@ quiet_cmd_syscall = SYSCALL $@ export CPPFLAGS_vsyscall.lds += -P -C -U$(ARCH) -vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1 \ +vsyscall-flags = -shared -Wl,-soname=linux-gate.so.1 \ $(call ld-option, -Wl$(comma)--hash-style=sysv) -SYSCFLAGS_vsyscall-sysenter.so = $(vsyscall-flags) -SYSCFLAGS_vsyscall-int80.so = $(vsyscall-flags) +SYSCFLAGS_vsyscall-sysenter.so.dbg = $(vsyscall-flags) +SYSCFLAGS_vsyscall-int80.so.dbg = $(vsyscall-flags) -$(obj)/vsyscall-int80.so $(obj)/vsyscall-sysenter.so: \ -$(obj)/vsyscall-%.so: $(src)/vsyscall.lds \ - $(obj)/vsyscall-%.o $(obj)/vsyscall-note.o FORCE +$(obj)/vsyscall-int80.so.dbg $(obj)/vsyscall-sysenter.so.dbg: \ +$(obj)/vsyscall-%.so.dbg: $(src)/vsyscall.lds \ + $(obj)/vsyscall-%.o $(obj)/vsyscall-note.o FORCE $(call if_changed,syscall) +$(obj)/%.so: OBJCOPYFLAGS := -S +$(obj)/%.so: $(obj)/%.so.dbg FORCE + $(call if_changed,objcopy) + +vdsos := vdso-int80.so vdso-sysenter.so + +quiet_cmd_vdso_install = INSTALL $@ + cmd_vdso_install = cp $(@:vdso-%.so=$(obj)/vsyscall-%.so.dbg) \ + $(MODLIB)/vdso/$@ + +$(vdsos): + @mkdir -p $(MODLIB)/vdso + $(call cmd,vdso_install) + +vdso_install: $(vdsos) + # We also create a special relocatable object that should mirror the symbol # table and layout of the linked DSO. With ld -R we can then refer to # these symbols in the kernel code rather than hand-coded addresses. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/