rtld: add RELRO support
"RELRO" means PLT (partial) or PLT+GOT (full) data is shifted to a
dedicated page by the linker which triggers the dynamic linker to
protect the page by setting the memory to read-only. This feature
assists in detecting memory corruption and also prevents some types
of buffer overflow exploits.
Until now, this feature was only supported by Linux's glibc. No BSD
had relro support in their dynamic linker. I proposed the patch and
it was reviewed by a FreeBSD dynamic linker expert. Attempts to
access protected data currently results in a bus error signal, but the
next commit will update the kernel trap files to cause the segfault
signal to be emitted instead.
Reviewed-by: Kostik Belousov