Next: , Previous: , Up: Dumping   [Contents][Index]

12.5 Reloading phase

12.5.1 File loading

The file is mmap’ed in memory (which ensures a PAGESIZE alignment, at least 4096), or if mmap is unavailable or fails, a 256-bytes aligned malloc is done and the file is loaded.

Some variables are reinitialized from the values found in the header.

The difference between the actual loading address and the reloc_address is computed and will be used for all the relocations.

12.5.2 Putting back the pdump_opaques

The memory contents are restored in the obvious and trivial way.

12.5.3 Putting back the pdump_root_struct_ptrs

The variables pointed to by pdump_root_struct_ptrs in the dump phase are reset to the right relocated object addresses.

12.5.4 Object relocation

All the objects are relocated using their description and their offset by pdump_reloc_one. This step is unnecessary if the reloc_address is equal to the file loading address.

12.5.5 Putting back the pdump_root_objects and pdump_weak_object_chains

Same as Putting back the pdump_root_struct_ptrs.

12.5.6 Reorganize the hash tables

Since some of the hash values in the lisp hash tables are address-dependent, their layout is now wrong. So we go through each of them and have them resorted by calling pdump_reorganize_hash_table.