elf_got remaps GOT region as read-only too early
67c422ca taught the linker to remap regions as read-only after linking where appropriate. However, it is a bit overzealous in the case of GOTs (as I originally noted in #16776 (comment 204499)). Specifically, elf_got.c:makeGot
mprotect
s the GOT region after partially filling it. However, elf_got.c:fillGot
also needs to write to the GOT region and is called after the mprotect
. Consequently we crash.