Skip to contentSkip to conversation

kexec x86_64: Make purgatory relocatable anywhere in the 64bit address space.

PATCH Applied Eric W. Biederman 3 participants 9 messages Nov 19, 2012 – Dec 4, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kexec x86_64: Make purgatory relocatable anywhere in the 64bit address space.

Remove kexec/arch/i386/compat_x6_64.S purgatory/arch/i386/linux-entry16.S and purgatory/arch/i386/entry16.S Those were early attempts at entry32-16.S that should have been deleted long ago.

Strip the purgatory code of debug symbols. There is no need to carry debug symbols we will never use around in /sbin/kexec.

On x86_64 use -mcmodel=large so that the code is built without any 32bit assumptions. -mcmodel=medium and -mcmodel=small result int code that has 32bit relocations against variables that can live anywhere in the address space

Modify the assembly in entry64.S and setup-x86_64.S to use %rip relative addressing of variables so no relocates are emitted.

Modify entry64-32.S so that it does not have any relocations that can not be processed when purgatory is loaded above 4G. entry64-32.S jumps to a 32bit entry point and can not itself be used above 4G so these changes merely prevent it from being a problem in the other case.

eip is modifed to be a 64bit value of which only the low 32bits are exported outside of entry64-32.S

The long mode exit code is modified to run with a %cs value whose base address is the address of the symbol entry32. From there all of the 32bit code in entry64-32.S can read variables by reading them through %cs. Until the final jump to the the target address which is made a far jump reloading %cs and the intstruction pointer.

Modify entry32-16.S and entry32-16-debug.S to be position independent 32bit code. At their start make a short call to push the current value of %eip on the stack and pop it off. Allowing the calculation of the address of entry16 which the code has always kept in %ebx.

Update the pointer to the gdt in the gdt so that lgdt will work.

Modify the instructions in entry32-16.S and entry32-16-debug.S so that the 32bit code uses offsets from %ebx which points at entry16.

---
 kexec/arch/i386/compat_x86_64.S        |  131 -------
 purgatory/Makefile                     |    1 +
 purgatory/arch/i386/entry16.S          |  160 --------
 purgatory/arch/i386/entry32-16-debug.S |   25 +-
 purgatory/arch/i386/entry32-16.S       |   25 +-
 purgatory/arch/i386/linux-entry16.S    |  623 --------------------------------
 purgatory/arch/x86_64/Makefile         |    4 +-
 purgatory/arch/x86_64/entry64-32.S     |   68 +++-
 purgatory/arch/x86_64/entry64.S        |    5 +-
 purgatory/arch/x86_64/setup-x86_64.S   |    4 +-
 10 files changed, 88 insertions(+), 958 deletions(-)
 delete mode 100644 kexec/arch/i386/compat_x86_64.S
 delete mode 100644 purgatory/arch/i386/entry16.S
 delete mode 100644 purgatory/arch/i386/linux-entry16.S
kexec/arch/i386/compat_x86_64.S deleted +0 -131
deleted file mode 100644
index f8a04e9..0000000
@@ -1,131 +0,0 @@
-/*
- * kexec: Linux boots Linux
- *
- * Copyright (C) 2003,2004,2005  Eric Biederman ([email protected])
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation (version 2 of the License).
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#define USE_LRET 0
-	
-.data
-	.equ	MSR_K6_EFER,   0xC0000080
-	.equ	EFER_LME,      0x00000100
-	.equ	X86_CR4_PAE,   0x00000020
-	.equ	CR0_PG,        0x80000000
-
-	.globl compat_x86_64, compat_x86_64_size, compat_x86_64_entry32
-	.code64
-	.balign 16	
-compat_x86_64:
-	/* Compute where I am running at */
-	leaq	compat_x86_64(%rip), %rbx
-
-	/* Relocate the code */
-	addq	%rbx, gdt_addr(%rip)
-#if !USE_LRET
-	addl	%ebx, lm_exit_addr(%rip)
-#endif	
-
-	/* Lookup the 32bit start address */
-	movl	compat_x86_64_entry32(%rip), %ebx
-	pushq	%rbx
-
-#if USE_LRET	
-	/* Push the 64bit start address */
-	pushq	$0x10
-	pushq	lm_exit(%rip)
-#endif	
-	
-	/* This also acts as a serializing instruction ensuring
-	 * my self modifying code works.
-	 */
-	lgdt	gdt(%rip)
-
-#if USE_LRET
-	lret
-#else				
-	/* Switch to 32bit compatiblity mode */
-	ljmp	*lm_exit_addr(%rip)
-#endif	
-lm_exit:
-	.code32
-
-	/* Disable paging */
-	movl	%cr0, %eax
-	andl	$~CR0_PG, %eax
-	movl	%eax, %cr0
-
-	/* Disable long mode */
-	movl	$MSR_K6_EFER, %ecx
-	rdmsr
-	andl	$~EFER_LME, %eax
-	wrmsr
-
-	/* Disable PAE */
-	xorl	%eax, %eax
-	movl	%eax, %cr4
-
-	/* load the data segments */
-	movl	$0x18, %eax	/* data segment */
-	movl	%eax, %ds
-	movl	%eax, %es
-	movl	%eax, %ss
-	movl	%eax, %fs
-	movl	%eax, %gs
-
-	/* Remove the 32 bits of the 64 bit start address */
-	popl	%eax
-
-	/* set all of the registers to known values */
-	/* leave %esp alone */
-
-	xorl	%eax, %eax
-	xorl	%ebx, %ebx
-	xorl    %ecx, %ecx
-	xorl    %edx, %edx
-	xorl    %esi, %esi
-	xorl    %edi, %edi
-	xorl    %ebp, %ebp
-
-	ret
-
-	.balign 16
-gdt:	/* 0x00 unusable segment 
-	 * 0x08 unused
-	 * so use them as the gdt ptr
-	 */
-	.word	gdt_end - gdt - 1
-gdt_addr:	
-	.quad	gdt - compat_x86_64
-	.word	0, 0, 0
-
-	/* 0x10 4GB flat code segment */
-	.word	0xFFFF, 0x0000, 0x9A00, 0x00CF
-	/* 0x18 4GB flat data segment */
-	.word	0xFFFF, 0x0000, 0x9200, 0x00CF
-gdt_end:	
-
-#if !USE_LRET	
-lm_exit_addr:
-	.long lm_exit - compat_x86_64
-	.long 0x10
-#endif	
-
-compat_x86_64_entry32:
-	.long 0  
-	     	
-compat_x86_64_end:
-compat_x86_64_size:
-	.long compat_x86_64_end - compat_x86_64
purgatory/Makefile +1 -0
index ee1679c..e39adec 100644
@@ -64,6 +64,7 @@ $(PURGATORY): $(PURGATORY_OBJS)
 	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
 
 #	$(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) --no-undefined -e purgatory_start -r -o $@ $(PURGATORY_OBJS) $(UTIL_LIB)
+	$(STRIP) --strip-debug $@
 
 echo::
 	@echo "PURGATORY_SRCS $(PURGATORY_SRCS)"
purgatory/arch/i386/entry16.S deleted +0 -160

160 lines not on this page · raw message

purgatory/arch/i386/entry32-16-debug.S +15 -10
index 82b58ca..5167944 100644
@@ -29,15 +29,20 @@
 	.balign 16
 entry16_debug:
 	.code32
-	/* Compute where I am running at */
-	movl	$entry16_debug, %ebx	
+	/* Compute where I am running at (assumes esp valid) */
+	call	1f
+1:	popl	%ebx
+	subl	$(1b - entry16_debug), %ebx
 
 	/* Fixup my real mode segment */
 	movl	%ebx, %eax
 	shrl	$4, %eax
-	movw	%ax, 2 + realptr
+	movw	%ax, (2 + realptr - entry16_debug)(%ebx)
 
 	/* Fixup the gdt */
+	leal	(gdt - entry16_debug)(%ebx), %eax
+	movl	%eax, (0x02 + gdt - entry16_debug)(%ebx)
+
 	movl	%ebx, %eax
 	shll	$16, %eax
 	
@@ -49,19 +54,19 @@ entry16_debug:
 	andl	$0xff000000, %edx
 	orl	%edx, %ecx
 
-	orl	%eax, 0x08 + gdt
-	orl	%ecx, 0x0c + gdt
-	orl	%eax, 0x10 + gdt
-	orl	%ecx, 0x14 + gdt	
+	orl	%eax, (0x08 + gdt - entry16_debug)(%ebx)
+	orl	%ecx, (0x0c + gdt - entry16_debug)(%ebx)
+	orl	%eax, (0x10 + gdt - entry16_debug)(%ebx)
+	orl	%ecx, (0x14 + gdt - entry16_debug)(%ebx)
 	
 	
 DEBUG_CHAR('a')
 	/* Setup the classic BIOS interrupt table at 0x0 */
-	lidt	idtptr
+	lidt	(idtptr - entry16_debug)(%ebx)
 
 DEBUG_CHAR('b')
 	/* Provide us with 16bit segments that we can use */
-	lgdt	gdt
+	lgdt	(gdt - entry16_debug)(%ebx)
 
 DEBUG_CHAR('c')
 	/* Note we don't disable the a20 line, (this shouldn't be required)
@@ -160,7 +165,7 @@ idtptr:
 gdt:
 	/* 0x00 unusable segment so used as the gdt ptr */
 	.word gdt_end - gdt - 1
-	.long gdt
+	.long 0 /* gdt */
 	.word 0
 
 	/* 0x08 16 bit real mode code segment */
purgatory/arch/i386/entry32-16.S +15 -10
index aaf1273..c051aab 100644
@@ -24,15 +24,20 @@
 	.balign 16
 entry16:
 	.code32
-	/* Compute where I am running at */
-	movl	$entry16, %ebx
+	/* Compute where I am running at (assumes esp valid) */
+	call	1f
+1:	popl	%ebx
+	subl	$(1b - entry16), %ebx
 
 	/* Fixup my real mode segment */
 	movl	%ebx, %eax
 	shrl	$4, %eax
-	movw	%ax, 2 + realptr
+	movw	%ax, (2 + realptr - entry16)(%ebx)
 
 	/* Fixup the gdt */
+	leal	(gdt - entry16)(%ebx), %eax
+	movl	%eax, (0x02 + gdt - entry16)(%ebx)
+
 	movl	%ebx, %eax
 	shll	$16, %eax
 	
@@ -44,17 +49,17 @@ entry16:
 	andl	$0xff000000, %edx
 	orl	%edx, %ecx
 
-	orl	%eax, 0x08 + gdt
-	orl	%ecx, 0x0c + gdt
-	orl	%eax, 0x10 + gdt
-	orl	%ecx, 0x14 + gdt	
+	orl	%eax, (0x08 + gdt - entry16)(%ebx)
+	orl	%ecx, (0x0c + gdt - entry16)(%ebx)
+	orl	%eax, (0x10 + gdt - entry16)(%ebx)
+	orl	%ecx, (0x14 + gdt - entry16)(%ebx)
 	
 	
 	/* Setup the classic BIOS interrupt table at 0x0 */
-	lidt	idtptr
+	lidt	(idtptr - entry16)(%ebx)
 	
 	/* Provide us with 16bit segments that we can use */
-	lgdt	gdt
+	lgdt	(gdt - entry16)(%ebx)
 
 	/* Note we don't disable the a20 line, (this shouldn't be required)
 	 * The code to do it is in kexec_test and it is a real pain.
@@ -147,7 +152,7 @@ idtptr:
 gdt:
 	/* 0x00 unusable segment so used as the gdt ptr */
 	.word gdt_end - gdt - 1
-	.long gdt
+	.long 0 /* gdt */
 	.word 0
 
 	/* 0x08 16 bit real mode code segment */
purgatory/arch/i386/linux-entry16.S deleted +0 -623

623 lines not on this page · raw message

purgatory/arch/x86_64/Makefile +3 -1
index 22b4228..7300937 100644
@@ -16,9 +16,11 @@ dist += purgatory/arch/x86_64/Makefile $(x86_64_PURGATORY_SRCS_native) 	\
 	purgatory/arch/x86_64/purgatory-x86_64.h
 
 # Don't add sources in i386/ to dist, as i386/Makefile adds them
-x86_64_PURGATORY_SRCS +=  purgatory/arch/i386/entry32-16.S
+x86_64_PURGATORY_SRCS += purgatory/arch/i386/entry32-16.S
 x86_64_PURGATORY_SRCS += purgatory/arch/i386/entry32-16-debug.S
 x86_64_PURGATORY_SRCS += purgatory/arch/i386/crashdump_backup.c
 x86_64_PURGATORY_SRCS += purgatory/arch/i386/console-x86.c
 x86_64_PURGATORY_SRCS += purgatory/arch/i386/vga.c
 x86_64_PURGATORY_SRCS += purgatory/arch/i386/pic.c
+
+x86_64_PURGATORY_EXTRA_CFLAGS = -mcmodel=large
purgatory/arch/x86_64/entry64-32.S +49 -19

104 lines not on this page · raw message

purgatory/arch/x86_64/entry64.S +3 -2
index 666023c..e3223b7 100644
@@ -37,9 +37,10 @@ entry64:
 	movl	%eax, %fs
 	movl	%eax, %gs
 
-	movq	$stack_init, %rsp
+	leaq	stack_init(%rip), %rsp
 	pushq	$0x10 /* CS */
-	pushq	$new_cs_exit
+	leaq	new_cs_exit(%rip), %rax
+	pushq	%rax
 	lretq
 new_cs_exit:
 
purgatory/arch/x86_64/setup-x86_64.S +2 -2
index 74997fa..95572d8 100644
@@ -42,10 +42,10 @@ purgatory_start:
 	/* In 64bit mode the code segment is meaningless */
 
 	movq	0(%rsp), %rax
-	movq	%rax, jump_back_entry
+	movq	%rax, jump_back_entry(%rip)
 
 	/* Setup a stack */
-	movq	$lstack_end, %rsp
+	leaq	lstack_end(%rip), %rsp
 
 	/* Call the C code */
 	call purgatory
Signature · 7 lines
1.7.5.4


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Applied
#1 lore raw
Quoted 36 lines · Eric W. Biederman

Remove kexec/arch/i386/compat_x6_64.S purgatory/arch/i386/linux-entry16.S and purgatory/arch/i386/entry16.S Those were early attempts at entry32-16.S that should have been deleted long ago.

Strip the purgatory code of debug symbols. There is no need to carry debug symbols we will never use around in /sbin/kexec.

On x86_64 use -mcmodel=large so that the code is built without any 32bit assumptions. -mcmodel=medium and -mcmodel=small result int code that has 32bit relocations against variables that can live anywhere in the address space

Modify the assembly in entry64.S and setup-x86_64.S to use %rip relative addressing of variables so no relocates are emitted.

Modify entry64-32.S so that it does not have any relocations that can not be processed when purgatory is loaded above 4G. entry64-32.S jumps to a 32bit entry point and can not itself be used above 4G so these changes merely prevent it from being a problem in the other case.

eip is modifed to be a 64bit value of which only the low 32bits are exported outside of entry64-32.S

The long mode exit code is modified to run with a %cs value whose base address is the address of the symbol entry32. From there all of the 32bit code in entry64-32.S can read variables by reading them through %cs. Until the final jump to the the target address which is made a far jump reloading %cs and the intstruction pointer.

Modify entry32-16.S and entry32-16-debug.S to be position independent 32bit code. At their start make a short call to push the current value of %eip on the stack and pop it off. Allowing the calculation of the address of entry16 which the code has always kept in %ebx.

Quoted 7 lines

Update the pointer to the gdt in the gdt so that lgdt will work.

Modify the instructions in entry32-16.S and entry32-16-debug.S so that the 32bit code uses offsets from %ebx which points at entry16.

Thanks, applied.

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#2 lore raw
In reply to Eric W. Biederman

purgatory/Makefile $(PURGATORY): $(PURGATORY_OBJS) · line 70

Quoted 12 lines · Eric W. Biederman
purgatory/Makefile +1 -0
index ee1679c..e39adec 100644
@@ -64,6 +64,7 @@ $(PURGATORY): $(PURGATORY_OBJS)
        $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
 
 #      $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) --no-undefined -e purgatory_start -r -o $@ $(PURGATORY_OBJS) $(UTIL_LIB)
+       $(STRIP) --strip-debug $@
 
 echo::
        @echo "PURGATORY_SRCS $(PURGATORY_SRCS)"

looks like configure does not set
STRIP in top Makefile

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#3 lore raw

PATCH 1/1 kexec: Teach configure to find the strip binary.

For some reason my version of the Makefile generated by configure included the line STRIP=strp. Rerunning configure from a fresh slate did not regenerate that line so I don't know how it got there. So add the code to Makefile.in and configure.ac to autodetect the strip binary.

This is needed so that we can remove from purgatory all of the relocations to sections that are not needed at runtime, by stripping out those sections.

---
 Makefile.in                    |    1 +
 configure.ac                   |    2 ++
 purgatory/arch/x86_64/Makefile |    2 +-
 3 files changed, 4 insertions(+), 1 deletions(-)
Makefile.in +1 -0
index ba2e638..7a50200 100644
@@ -64,6 +64,7 @@ SED		= @SED@
 FIND		= @FIND@
 XARGS		= @XARGS@
 DIRNAME		= @DIRNAME@
+STRIP		= @STRIP@
 
 
 pkgdatadir = $(datadir)/$(PACKAGE_NAME)
configure.ac +2 -0
index 401b11e..b7e4f2e 100644
@@ -142,6 +142,7 @@ AC_CHECK_PROG([SED],      sed,      sed,      "no", [$PATH])
 AC_CHECK_PROG([FIND],     find,     find,     "no", [$PATH])
 AC_CHECK_PROG([XARGS],    xargs,    xargs,    "no", [$PATH])
 AC_CHECK_PROG([DIRNAME],  dirname,  dirname,  "no", [$PATH])
+AC_CHECK_PROG([STRIP],    strip,    strip,    "no", [$PATH])
 
 dnl See if I have a usable copy of zlib available
 if test "$with_zlib" = yes ; then
@@ -185,6 +186,7 @@ if test "$SED"     = "no"; then AC_MSG_ERROR([ sed not found]); fi
 if test "$FIND"    = "no"; then AC_MSG_ERROR([ find not found]); fi
 if test "$XARGS"   = "no"; then AC_MSG_ERROR([ xargs not found]); fi
 if test "$DIRNAME" = "no"; then AC_MSG_ERROR([ dirname not found]); fi
+if test "$STRIP"   = "no"; then AC_MSG_ERROR([ strip not found]); fi
 
 dnl ---Output variables...
 AC_SUBST([BUILD_CC])
purgatory/arch/x86_64/Makefile +1 -1
index 7300937..bfc7b24 100644
@@ -16,7 +16,7 @@ dist += purgatory/arch/x86_64/Makefile $(x86_64_PURGATORY_SRCS_native) 	\
 	purgatory/arch/x86_64/purgatory-x86_64.h
 
 # Don't add sources in i386/ to dist, as i386/Makefile adds them
-x86_64_PURGATORY_SRCS += purgatory/arch/i386/entry32-16.S
+x86_64_PURGATORY_SRCS +=  purgatory/arch/i386/entry32-16.S
 x86_64_PURGATORY_SRCS += purgatory/arch/i386/entry32-16-debug.S
 x86_64_PURGATORY_SRCS += purgatory/arch/i386/crashdump_backup.c
 x86_64_PURGATORY_SRCS += purgatory/arch/i386/console-x86.c
Signature · 6 lines
1.7.5.4

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
#4 lore raw

Re: [PATCH] kexec: Teach configure to find the strip binary.

Quoted 11 lines · Eric W. Biederman

For some reason my version of the Makefile generated by configure included the line STRIP=strp. Rerunning configure from a fresh slate did not regenerate that line so I don't know how it got there. So add the code to Makefile.in and configure.ac to autodetect the strip binary.

This is needed so that we can remove from purgatory all of the relocations to sections that are not needed at runtime, by stripping out those sections.

Thanks, I removed the last hunk, which seems to be a white-space only change to purgatory/arch/x86_64/Makefile, and applied the rest.

Quoted 54 lines
---
 Makefile.in                    |    1 +
 configure.ac                   |    2 ++
 purgatory/arch/x86_64/Makefile |    2 +-
 3 files changed, 4 insertions(+), 1 deletions(-)
Makefile.in +1 -0
index ba2e638..7a50200 100644
@@ -64,6 +64,7 @@ SED		= @SED@
 FIND		= @FIND@
 XARGS		= @XARGS@
 DIRNAME		= @DIRNAME@
+STRIP		= @STRIP@
 
 
 pkgdatadir = $(datadir)/$(PACKAGE_NAME)
configure.ac +2 -0
index 401b11e..b7e4f2e 100644
@@ -142,6 +142,7 @@ AC_CHECK_PROG([SED],      sed,      sed,      "no", [$PATH])
 AC_CHECK_PROG([FIND],     find,     find,     "no", [$PATH])
 AC_CHECK_PROG([XARGS],    xargs,    xargs,    "no", [$PATH])
 AC_CHECK_PROG([DIRNAME],  dirname,  dirname,  "no", [$PATH])
+AC_CHECK_PROG([STRIP],    strip,    strip,    "no", [$PATH])
 
 dnl See if I have a usable copy of zlib available
 if test "$with_zlib" = yes ; then
@@ -185,6 +186,7 @@ if test "$SED"     = "no"; then AC_MSG_ERROR([ sed not found]); fi
 if test "$FIND"    = "no"; then AC_MSG_ERROR([ find not found]); fi
 if test "$XARGS"   = "no"; then AC_MSG_ERROR([ xargs not found]); fi
 if test "$DIRNAME" = "no"; then AC_MSG_ERROR([ dirname not found]); fi
+if test "$STRIP"   = "no"; then AC_MSG_ERROR([ strip not found]); fi
 
 dnl ---Output variables...
 AC_SUBST([BUILD_CC])
purgatory/arch/x86_64/Makefile +1 -1
index 7300937..bfc7b24 100644
@@ -16,7 +16,7 @@ dist += purgatory/arch/x86_64/Makefile $(x86_64_PURGATORY_SRCS_native) 	\
 	purgatory/arch/x86_64/purgatory-x86_64.h
 
 # Don't add sources in i386/ to dist, as i386/Makefile adds them
-x86_64_PURGATORY_SRCS += purgatory/arch/i386/entry32-16.S
+x86_64_PURGATORY_SRCS +=  purgatory/arch/i386/entry32-16.S
 x86_64_PURGATORY_SRCS += purgatory/arch/i386/entry32-16-debug.S
 x86_64_PURGATORY_SRCS += purgatory/arch/i386/crashdump_backup.c
 x86_64_PURGATORY_SRCS += purgatory/arch/i386/console-x86.c
Signature · 1 line
1.7.5.4

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#5 lore raw

Re: [PATCH] kexec: Teach configure to find the strip binary.

Quoted 7 lines · Simon Horman
Quoted 6 lines · Eric W. Biederman

For some reason my version of the Makefile generated by configure included the line STRIP=strp. Rerunning configure from a fresh slate did not regenerate that line so I don't know how it got there. So add the code to Makefile.in and configure.ac to autodetect the strip binary.

Quoted 8 lines
Quoted 5 lines

This is needed so that we can remove from purgatory all of the relocations to sections that are not needed at runtime, by stripping out those sections.

Thanks, I removed the last hunk, which seems to be a white-space only change to purgatory/arch/x86_64/Makefile, and applied the rest.

Oops. Thanks for cacthing that. I didn't realize I had that change sitting in my tree.

Quoted 6 lines

purgatory/arch/x86_64/Makefile dist += purgatory/arch/x86_64/Makefile $(x86_64_PURGATORY_SRCS_native) \ · line 22

Quoted 6 lines

# Don't add sources in i386/ to dist, as i386/Makefile adds them

purgatory/arch/x86_64/Makefile +1 -1
-x86_64_PURGATORY_SRCS += purgatory/arch/i386/entry32-16.S
+x86_64_PURGATORY_SRCS +=  purgatory/arch/i386/entry32-16.S
 x86_64_PURGATORY_SRCS += purgatory/arch/i386/entry32-16-debug.S
 x86_64_PURGATORY_SRCS += purgatory/arch/i386/crashdump_backup.c
 x86_64_PURGATORY_SRCS += purgatory/arch/i386/console-x86.c

Eric

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#6 lore raw

Re: [PATCH] kexec: Teach configure to find the strip binary.

Quoted 13 lines · Eric W. Biederman
Quoted 11 lines · Simon Horman
Quoted 10 lines · Eric W. Biederman

For some reason my version of the Makefile generated by configure included the line STRIP=strp. Rerunning configure from a fresh slate did not regenerate that line so I don't know how it got there. So add the code to Makefile.in and configure.ac to autodetect the strip binary.

This is needed so that we can remove from purgatory all of the relocations to sections that are not needed at runtime, by stripping out those sections.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Thanks, I removed the last hunk, which seems to be a white-space only change to purgatory/arch/x86_64/Makefile, and applied the rest.

Oops. Thanks for cacthing that. I didn't realize I had that change sitting in my tree.

after re config it. got

DIRNAME = dirname
STRIP = @STRIP@

instead of

STRIP = strip

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#7 lore raw

Re: [PATCH] kexec: Teach configure to find the strip binary.

Quoted 24 lines · Yinghai Lu
Quoted 13 lines · Eric W. Biederman
Quoted 11 lines · Simon Horman
Quoted 10 lines · Eric W. Biederman

For some reason my version of the Makefile generated by configure included the line STRIP=strp. Rerunning configure from a fresh slate did not regenerate that line so I don't know how it got there. So add the code to Makefile.in and configure.ac to autodetect the strip binary.

This is needed so that we can remove from purgatory all of the relocations to sections that are not needed at runtime, by stripping out those sections.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Thanks, I removed the last hunk, which seems to be a white-space only change to purgatory/arch/x86_64/Makefile, and applied the rest.

Oops. Thanks for cacthing that. I didn't realize I had that change sitting in my tree.

after re config it. got

Quoted 7 lines

DIRNAME = dirname
STRIP = @STRIP@

instead of

STRIP = strip

Run bootstrap. At the very least it looks like you haven't regeneratged configure by running autoconf.

Eric

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#8 lore raw

Re: [PATCH] kexec: Teach configure to find the strip binary.

Quoted 6 lines · Eric W. Biederman
Quoted 2 lines · Yinghai Lu

STRIP = strip

Run bootstrap. At the very least it looks like you haven't regeneratged configure by running autoconf.

works. Thanks.

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec