Reuse one byte of the pmc map_in struct to record the capture system’s PAGE_SHIFT, leaving the remaining three bytes reserved and available for future use.
Update pmcstat and pmc to use the recorded page size when calculating user executable mappings. Kernel and kernel-module mappings continue using the ELF segment’s p_align, since their MAP_IN records describe linker load bases.
This fixes a bug where a binary using max-page-size=0x200000 can result in a bogus relocation offset when running on a system with a smaller page size, as this can cause samples to fall outside the image mapping or be translated to the wrong address (resulting in bad symbol resolution). We noticed this because we run a patchset which enables 16K pages on amd64 and we have been compiling our binaries with a 2MB page size. Since we started doing that, profiling userspace binaries has been terrible.