Restore the core-dumping of all writable segments for ELF executables, minus the NULL pointer dereference in rev. 1.33.  Also simplify things somewhat by eliminating one traversal of the VM map entries. Finally, eliminate calls to vm_map_{un,}lock_read() which aren't needed here.  I originally took them from procfs_map.c, but here we know we are dealing only with the map of the current process.
Restore the core-dumping of all writable segments for ELF executables,
minus the NULL pointer dereference in rev. 1.33.  Also simplify
things somewhat by eliminating one traversal of the VM map entries.
Finally, eliminate calls to vm_map_{un,}lock_read() which aren't
needed here.  I originally took them from procfs_map.c, but here
we know we are dealing only with the map of the current process.

jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase