This PR is a follow-on from the discussion in issue https://github.com/DynamoRIO/dynamorio/issues/3385
The sort of questions I've been trying to answer are (based on my simple understanding of the code):
- Which part(s) of the code maps the segments into memory? Just module_add_segment_data() or something else as well?
- When looking for which part of the ELF loader calls mmap() I noticed they go via post_system_call(). Why?
I suppose the main question is why not map+load the whole file into memory and populate the relevant DR data structures (os_module_data_t etc) in one go rather than mapping+loading piecemeal?