 
  #if !defined(__BYTE_ORDER) || !defined(__LITTLE_ENDIAN) || !defined(__BIG_ENDIAN)
  #error Endian defines missing
+Index: kexec-tools-2.0.0/kexec/kexec.h
+===================================================================
+--- kexec-tools-2.0.0.orig/kexec/kexec.h.old	2008-05-16 13:28:19.000000000 +0200
++++ kexec-tools-2.0.0/kexec/kexec.h	2009-05-16 17:32:15.000000000 +0200
+@@ -197,7 +197,7 @@
+ extern char *slurp_file(const char *filename, off_t *r_size);
+ extern char *slurp_file_len(const char *filename, off_t size);
+ extern char *slurp_decompress_file(const char *filename, off_t *r_size);
+-extern unsigned long virt_to_phys(unsigned long addr);
++/* extern unsigned long virt_to_phys(unsigned long addr); */
+ extern void add_segment(struct kexec_info *info,
+	const void *buf, size_t bufsz, unsigned long base, size_t memsz);
+ extern void add_segment_phys_virt(struct kexec_info *info,
+Index: kexec-tools-2.0.0/purgatory/string.c
+===================================================================
+--- kexec-tools-2.0.0.orig/purgatory/string.c.old	2008-05-16 13:28:19.000000000 +0200
++++ kexec-tools-2.0.0/purgatory/string.c	2009-05-16 17:49:04.000000000 +0200
+@@ -1,5 +1,5 @@
+ #include <stddef.h>
+-#include <string.h>
++/* #include <string.h> */
+
+ size_t strnlen(const char *s, size_t max)
+ {

 #include <limits.h>
 #include <stdint.h>
 #include <purgatory.h>
@@ -18,8 +18,10 @@
	sha256_starts(&ctx);
	end = &sha256_regions[sizeof(sha256_regions)/sizeof(sha256_regions[0])];
	for(ptr = sha256_regions; ptr < end; ptr++) {
-		sha256_update(&ctx, (uint8_t *)((uintptr_t)ptr->start),
+/*		sha256_update(&ctx, (uint8_t *)((uintptr_t)ptr->start),
			      ptr->len);
+*/
+		sha256_update(&ctx, ptr->start, ptr->len);
	}
	sha256_finish(&ctx, digest);
	if (memcmp(digest, sha256_digest, sizeof(digest)) != 0) {

===================================================================
--- kexec-tools-2.0.0.orig/purgatory/Makefile	2009-04-24 14:15:34.037827479 +0100
+++ kexec-tools-2.0.0/purgatory/Makefile	2009-04-24 14:15:47.022825503 +0100
@@ -55,9 +54,7 @@
			-I$(srcdir)/purgatory/arch/$(ARCH)/include \
			-I$(srcdir)/util_lib/include \
			-I$(shell $(CC) -print-file-name=include)
-$(PURGATORY): LDFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS)\
-			--no-undefined -nostartfiles -nostdlib -nodefaultlibs \
-			-e purgatory_start -r
+$(PURGATORY): LDFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS)

 $(PURGATORY): $(PURGATORY_OBJS)
	$(MKDIR) -p $(@D)
Index: kexec-tools-2.0.0/purgatory/purgatory.c
===================================================================
--- kexec-tools-2.0.0.orig/purgatory/purgatory.old	2009-05-16 13:28:19.000000000 +0200
