--- ./makedumpfile.c.org	2006-08-30 12:21:57.000000000 +0900
+++ ./makedumpfile.c	2006-08-30 12:23:31.000000000 +0900
@@ -193,7 +193,7 @@ vaddr_to_fileoffset(struct DumpInfo *inf
  * Get the number of the page descriptors from the ELF info.
  */
 unsigned int
-num_page_descriptor(struct DumpInfo *info)
+get_max_mapnr(struct DumpInfo *info)
 {
 	int i;
 	off_t max_paddr;
@@ -517,6 +517,9 @@ get_elf_info(struct DumpInfo *info)
 			if(!dump_Elf64_pt_load(info, load64 + i, i))
 				goto out;
 	}
+	info->max_mapnr = get_max_mapnr(info);
+	info->len_bitmap = 2*divideup(info->max_mapnr, BITPERBYTE);
+
 	g_free(tmp_elf_header);
 	return TRUE;
 out:
@@ -528,18 +531,14 @@ out:
 int
 get_symbol_info(struct DumpInfo *info)
 {
-	unsigned int max_mapnr;
-	unsigned long sym_mem_map = 0, sym_num_physpages = 0;
+	unsigned long sym_mem_map = 0;
 	unsigned long sym_system_utsname = 0;
 	unsigned long addr_mem_map;
 	struct new_utsname system_utsname;
 	char buf[BUFSIZE_FGETS], *mapitems[MAXARGS], *endp;
 
-	if (info->name_sysmap == NULL) {
-		info->max_mapnr = num_page_descriptor(info);
-		info->len_bitmap = 2*divideup(info->max_mapnr, BITPERBYTE);
+	if (info->name_sysmap == NULL)
 		return TRUE;
-	}
 
 	/*
 	 * Get a symbol info from the System.map.
@@ -557,16 +556,6 @@ get_symbol_info(struct DumpInfo *info)
 				return FALSE;
 			}
 		}
-		if (strcmp(mapitems[2], "num_physpages") == 0) {
-			sym_num_physpages = strtoul(mapitems[0], &endp, 16);
-        		if ((!sym_num_physpages
-			    || sym_num_physpages == ULONG_MAX)
-			    || strlen(endp) != 0) {
-				ERRMSG("The map file has invalid address of %s",
-				    mapitems[2]);
-				return FALSE;
-			}
-		}
 		if (strcmp(mapitems[2], "system_utsname") == 0) {
 			sym_system_utsname = strtoul(mapitems[0], &endp, 16);
         		if ((!sym_system_utsname
@@ -578,7 +567,6 @@ get_symbol_info(struct DumpInfo *info)
 			}
 		}
 		if ((sym_mem_map != 0)
-		    && (sym_num_physpages != 0)
 		    && (sym_system_utsname != 0))
 			break;
 	}
@@ -605,20 +593,6 @@ get_symbol_info(struct DumpInfo *info)
 	info->addr_mem_map = addr_mem_map;
 
 	/*
-	 * Get the number of the page descriptors.
-	 */
-	if (!sym_num_physpages || !readmem(info, sym_num_physpages, &max_mapnr,
-	     sizeof max_mapnr) || !max_mapnr)
-			max_mapnr = num_page_descriptor(info);
-
-	if (!max_mapnr) {
-		ERRMSG("Can't get the number of the page descriptors.\n");
-		return FALSE;
-	}
-	info->max_mapnr = max_mapnr;
-	info->len_bitmap = 2*divideup(info->max_mapnr, BITPERBYTE);
-
-	/*
 	 * Get the kernel version from the symbol "system_utsname".
 	 */
 	if (!sym_system_utsname) {
