diff -puN makedumpfile.org/Makefile makedumpfile/Makefile
--- makedumpfile.org/Makefile	2006-09-14 17:59:31.000000000 +0900
+++ makedumpfile/Makefile	2006-09-14 18:04:07.000000000 +0900
@@ -1,13 +1,15 @@
 CC	= gcc
 CFLAGS	= -g -O2 -Wall
 CFLAGS2	= -g -O2 -Wall `gtk-config --cflags` `gtk-config --libs` -D_FILE_OFFSET_BITS=64
+CFLAGS_ARCH	= -g -O2 -Wall `gtk-config --cflags`
 
-ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
+ARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/sun4u/sparc64/ \
 			       -e s/arm.*/arm/ -e s/sa110/arm/ \
 			       -e s/s390x/s390/ -e s/parisc64/parisc/ \
 			       -e s/ppc64/powerpc/ )
 CFLAGS += -D__$(ARCH)__
 CFLAGS2 += -D__$(ARCH)__
+CFLAGS_ARCH += -D__$(ARCH)__
 CFLAGS_DEBUG	= $(CFLAGS) -DDEBUG
 DW	= dwarfinfo
 DW3	= dwarfinfo/../dwarfinfo
@@ -17,6 +19,7 @@ SRC2	= $(DW)/dwarf_alloc.c $(DW)/dwarf_d
 	  $(DW)/dwarf_loc.c $(DW)/dwarf_query.c $(DW)/dwarf_util.c \
 	  $(DW)/dwarf_leb.c $(DW)/malloc_check.c $(DW)/dwarfdump.c \
 	  $(DW)/print_die.c
+SRC_ARCH = x86.c x86_64.c
 SRC_DEBUG = \
 	  $(DW3)/dwarf_alloc.c $(DW3)/dwarf_die_deliv.c $(DW3)/dwarf_error.c \
 	  $(DW3)/dwarf_form.c $(DW3)/dwarf_init_finish.c $(DW3)/dwarf_line.c \
@@ -29,6 +32,7 @@ OBJ2	= $(DW)/dwarf_alloc.o $(DW)/dwarf_d
 	  $(DW)/dwarf_loc.o $(DW)/dwarf_query.o $(DW)/dwarf_util.o \
 	  $(DW)/dwarf_leb.o $(DW)/malloc_check.o $(DW)/dwarfdump.o \
 	  $(DW)/print_die.o
+OBJ_ARCH = x86.o x86_64.o
 OBJ_DEBUG = \
 	  $(DW3)/dwarf_alloc.o $(DW3)/dwarf_die_deliv.o $(DW3)/dwarf_error.o \
 	  $(DW3)/dwarf_form.o $(DW3)/dwarf_init_finish.o $(DW3)/dwarf_line.o \
@@ -60,11 +64,14 @@ $(OBJ2): $(SRC2) $(HEAD2)
 	$(CC) $(CFLAGS) -I. -c -o ../$@ ../$(@:.o=.c) ; \
 	cd ..;
 
-makedumpfile: $(SRC) $(OBJ2)
-	$(CC) $(CFLAGS2) -I./dwarfinfo $(OBJ2) -lelf -lz -o $@ $<
+$(OBJ_ARCH): $(SRC_ARCH)
+	$(CC) $(CFLAGS_ARCH) -c -o ./$@ ./$(@:.o=.c) 
+
+makedumpfile: $(SRC) $(OBJ2) $(OBJ_ARCH)
+	$(CC) $(CFLAGS2) -I./dwarfinfo $(OBJ_ARCH) $(OBJ2) -lelf -lz -o $@ $<
 
 clean:
-	rm $(OBJ2) makedumpfile
+	rm $(OBJ2) $(OBJ_ARCH) makedumpfile
 
 debug: readdwarfinfo
 
Common subdirectories: makedumpfile.org/dwarfinfo and makedumpfile/dwarfinfo
diff -puN makedumpfile.org/makedumpfile.c makedumpfile/makedumpfile.c
--- makedumpfile.org/makedumpfile.c	2006-09-14 18:01:37.000000000 +0900
+++ makedumpfile/makedumpfile.c	2006-09-14 18:05:47.000000000 +0900
@@ -16,17 +16,18 @@
 
 /*
  * TODO
- * 1. get a structure size and a field offset. : Done.
+ * 1. exclude free pages.
  * 2. get the memory management information from the symbol "pgdat_list".
- * 3. exclude free pages.
- * 4. (i386) fill PT_LOAD headers with appropriate virtual addresses.
+ * 3. (i386) fill PT_LOAD headers with appropriate virtual addresses.
  */
 
 #include "makedumpfile.h"
-
-struct symbol_table	symbol_table;
-struct size_table	size_table;
-struct offset_table	offset_table;
+#include <globals.h>
+#include <dwarf_incl.h>
+  
+extern struct symbol_table	symbol_table;
+extern struct size_table	size_table;
+extern struct offset_table	offset_table;
 int retcd = COMPLETED;	/* return code */
 
 /*
@@ -880,29 +881,6 @@ get_structure_info(struct DumpInfo *info
 }
 
 int
-get_machdep_info_x86(struct DumpInfo *info)
-{
-	/* PAE */
-	if ((SYMBOL(pkmap_count) != NOT_FOUND_SYMBOL)
-	    && (SYMBOL(pkmap_count_next) != NOT_FOUND_SYMBOL)
-	    && ((SYMBOL(pkmap_count_next)-SYMBOL(pkmap_count))/sizeof(int))
-	    == 512)
-		info->section_size_bits = _SECTION_SIZE_BITS_PAE;
-	else
-		info->section_size_bits = _SECTION_SIZE_BITS;
-
-	return TRUE;
-}
-
-int
-get_machdep_info_x86_64(struct DumpInfo *info)
-{
-	info->section_size_bits = _SECTION_SIZE_BITS;
-
-	return TRUE;
-}
-
-int
 is_sparsemem_extreme(struct DumpInfo *info)
 {
 	/*
diff -puN makedumpfile.org/makedumpfile.h makedumpfile/makedumpfile.h
--- makedumpfile.org/makedumpfile.h	2006-09-14 18:01:37.000000000 +0900
+++ makedumpfile/makedumpfile.h	2006-09-14 18:04:07.000000000 +0900
@@ -27,8 +27,6 @@
 #include <glib.h>
 #include <zlib.h>
 #include "diskdump_mod.h"
-#include <globals.h>
-#include <dwarf_incl.h>
 
 /*
  * Result of command
@@ -77,7 +75,7 @@ enum {
 #define LSEEKED_PDESC	(2)
 #define LSEEKED_PDATA	(3)
 
-int
+static inline int
 test_bit(int nr, unsigned long addr)
 {
 	int mask;
@@ -262,9 +260,9 @@ do { \
 #define STR_OFFSET(X)	"OFFSET("X")="
 
 /*
- * The values of linux 2.6.15.1
+ * The value of dependence on machine
  */
-#ifdef __i386__
+#ifdef __x86__
 #define PAGE_OFFSET		(0xc0000000)
 #define __VMALLOC_RESERVE       (128 << 20)
 #define MAXMEM                  (-PAGE_OFFSET-__VMALLOC_RESERVE)
@@ -272,15 +270,28 @@ do { \
 #define KVBASE			(SYMBOL(_stext) & ~KVBASE_MASK)
 #define _SECTION_SIZE_BITS	(26)
 #define _SECTION_SIZE_BITS_PAE	(30)
-#define get_machdep_info	get_machdep_info_x86
-#endif /* i386 */
+#endif /* x86 */
 
 #ifdef __x86_64__
 #define PAGE_OFFSET		(0xffff810000000000)
 #define MAXMEM			(0x3fffffffffffUL)
 #define KVBASE			PAGE_OFFSET
 #define _SECTION_SIZE_BITS	(27)
-#define _SECTION_SIZE_BITS_PAE	(0)
+#endif /* x86_64 */
+
+#ifdef __ia64__ /* ia64 */
+#endif          /* ia64 */
+
+/*
+ * The function of dependence on machine
+ */
+#ifdef __x86__
+int get_machdep_info_x86();
+#define get_machdep_info	get_machdep_info_x86
+#endif /* x86 */
+
+#ifdef __x86_64__
+int get_machdep_info_x86_64();
 #define get_machdep_info	get_machdep_info_x86_64
 #endif /* x86_64 */
 
@@ -419,3 +430,8 @@ struct offset_table {
 		long	section_mem_map;
 	} mem_section;
 };
+
+struct symbol_table	symbol_table;
+struct size_table	size_table;
+struct offset_table	offset_table;
+
diff -puN makedumpfile.org/x86.c makedumpfile/x86.c
--- makedumpfile.org/x86.c	1970-01-01 09:00:00.000000000 +0900
+++ makedumpfile/x86.c	2006-09-14 18:04:07.000000000 +0900
@@ -0,0 +1,40 @@
+/* 
+ * x86.c
+ *
+ * Copyright (C) 2006  NEC Corporation
+ *
+ * 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; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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.
+ */
+#ifdef __x86__
+
+#include "makedumpfile.h"
+
+extern struct symbol_table	symbol_table;
+extern struct size_table	size_table;
+extern struct offset_table	offset_table;
+
+int
+get_machdep_info_x86(struct DumpInfo *info)
+{
+	/* PAE */
+	if ((SYMBOL(pkmap_count) != NOT_FOUND_SYMBOL)
+	    && (SYMBOL(pkmap_count_next) != NOT_FOUND_SYMBOL)
+	    && ((SYMBOL(pkmap_count_next)-SYMBOL(pkmap_count))/sizeof(int))
+	    == 512)
+		info->section_size_bits = _SECTION_SIZE_BITS_PAE;
+	else
+		info->section_size_bits = _SECTION_SIZE_BITS;
+
+	return TRUE;
+}
+
+#endif /* x86 */
+
diff -puN makedumpfile.org/x86_64.c makedumpfile/x86_64.c
--- makedumpfile.org/x86_64.c	1970-01-01 09:00:00.000000000 +0900
+++ makedumpfile/x86_64.c	2006-09-14 18:04:07.000000000 +0900
@@ -0,0 +1,33 @@
+/* 
+ * x86_64.c
+ *
+ * Copyright (C) 2006  NEC Corporation
+ *
+ * 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; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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.
+ */
+#ifdef __x86_64__
+
+#include "makedumpfile.h"
+
+extern struct symbol_table	symbol_table;
+extern struct size_table	size_table;
+extern struct offset_table	offset_table;
+
+int
+get_machdep_info_x86_64(struct DumpInfo *info)
+{
+	info->section_size_bits = _SECTION_SIZE_BITS;
+
+	return TRUE;
+}
+
+#endif /* x86_64 */
+
