Skip to contentSkip to conversation

preprocess vsyscall linker script

PATCH New Chris Wright 1 participant 1 message May 20, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 preprocess vsyscall linker script

This removes the hardcoded vsyscall linker script and replaces it with the normal vsyscall.lds.S version which will be properly preprocessed. That brings vsyscall.lds.S inline with normal i386. Proper preprocessing allows Gerd's PAE patch to work without having to edit the linker script.

---

 linux-2.6.11-xen-sparse/arch/xen/Makefile                   |    8 +
 linux-2.6.11-xen-sparse/arch/xen/i386/kernel/Makefile       |    7 -
 linux-2.6.11-xen-sparse/arch/xen/i386/kernel/vsyscall.lds   |   69 ------------
 linux-2.6.11-xen-sparse/arch/xen/i386/kernel/vsyscall.lds.S |   65 +++++++++++
 4 files changed, 77 insertions(+), 72 deletions(-)

===== linux-2.6.11-xen-sparse/arch/xen/Makefile 1.22 vs edited =====

linux-2.6.11-xen-sparse/arch/xen/Makefile +7 -1
@@ -37,8 +37,14 @@ arch/xen/arch:
 	@rm -f $@
 	@ln -fsn $(XENARCH) $@
 
+arch/$(XENARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
+				   include/config/MARKER
+
+include/asm-$(ARCH)/asm_offsets.h: arch/$(XENARCH)/kernel/asm-offsets.s
+	$(call filechk,gen-asm-offsets)
+
 prepare: include/.asm-ignore include/asm-xen/asm \
-	arch/xen/arch ;
+	arch/xen/arch  include/asm-$(ARCH)/asm_offsets.h ;
 
 all: vmlinuz
 

===== linux-2.6.11-xen-sparse/arch/xen/i386/kernel/Makefile 1.18 vs edited =====

linux-2.6.11-xen-sparse/arch/xen/i386/kernel/Makefile +5 -2
@@ -52,18 +52,21 @@ c-obj-$(CONFIG_SCx200)		+= scx200.o
 # 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 += vsyscall.lds
 
 # The DSO images are built using a special linker script.
 quiet_cmd_syscall = SYSCALL $@
       cmd_syscall = $(CC) -nostdlib -m32 $(SYSCFLAGS_$(@F)) \
 		          -Wl,-T,$(filter-out FORCE,$^) -o $@
 
+export CPPFLAGS_vsyscall.lds += -P -C -U$(ARCH)
+
 vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1
 SYSCFLAGS_vsyscall-sysenter.so	= $(vsyscall-flags)
 SYSCFLAGS_vsyscall-int80.so	= $(vsyscall-flags)
 
 $(obj)/vsyscall-int80.so $(obj)/vsyscall-sysenter.so: \
-$(obj)/vsyscall-%.so: $(obj)/vsyscall.lds $(obj)/vsyscall-%.o FORCE
+$(obj)/vsyscall-%.so: $(src)/vsyscall.lds $(obj)/vsyscall-%.o FORCE
 	$(call if_changed,syscall)
 
 # We also create a special relocatable object that should mirror the symbol
@@ -74,7 +77,7 @@ $(obj)/built-in.o: $(obj)/vsyscall-syms.
 $(obj)/built-in.o: ld_flags += -R $(obj)/vsyscall-syms.o
 
 SYSCFLAGS_vsyscall-syms.o = -r
-$(obj)/vsyscall-syms.o: $(obj)/vsyscall.lds $(obj)/vsyscall-sysenter.o FORCE
+$(obj)/vsyscall-syms.o: $(src)/vsyscall.lds $(obj)/vsyscall-sysenter.o FORCE
 	$(call if_changed,syscall)
 
 c-link	:= init_task.o

===== linux-2.6.11-xen-sparse/arch/xen/i386/kernel/vsyscall.lds 1.7 vs ? (writable without lock!) =====

linux-2.6.11-xen-sparse/arch/xen/i386/kernel/vsyscall.lds +0 -69

69 lines not on this page · raw message

linux-2.6.11-xen-sparse/arch/xen/i386/kernel/vsyscall.lds.S +65 -0

65 lines not on this page · raw message