In the case we mmap'd the code at the top of the function would
already
have triggered and returned the ELF image because the whole file would
already been read in/mmap'd in memory. So if we get to the build-id
check we know that either the file is big and incomplete, or not eagerly
read in already. It is the second case we want to check for. So the
core->map_address check should not be moved before the build-id check,
because we still only want to use the (big) mmap'd (partial) memory when
no build-id is found.
Please add some comments so this is all clear when reading the code cold.