x64: make .fixup section writable

The content of .fixup section is sorted during boot. Moreover, since
.fixup contains pointers to locations in .text section it requires
R_X86_64_RELATIVE relocations.

Reviewed-by: Glauber Costa <glommer@cloudius-systems.com>
Signed-off-by: Pawel Dziepak <pdziepak@quarnos.org>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
trace: make section .tracepoint_patch_sites writable

.tracepoint_patch_sites contains pointers to locations in .text section
which needs to be relocated.

Reviewed-by: Glauber Costa <glommer@cloudius-systems.com>
Signed-off-by: Pawel Dziepak <pdziepak@quarnos.org>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
elf: set segment permissions exactly as specified in p_flags

Reviewed-by: Glauber Costa <glommer@cloudius-systems.com>
Signed-off-by: Pawel Dziepak <pdziepak@quarnos.org>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
elf: make area described in GNU_RELRO read-only

Segment GNU_RELRO is used to inform dynamic linker which sections needs
to be writable only when relocating ELF file and can be made read-only
later. Usually GNU_RELRO overlaps with standard LOAD segment that contains
readable and writable data but ELF file is generated in such way that it
is possible to properly set per-page permissions.

Signed-off-by: Pawel Dziepak <pdziepak@quarnos.org>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
tests: move memory permission check implementation to header file

This code is going to be shared by tst-mmap and tst-elf-permissions.

Signed-off-by: Pawel Dziepak <pdziepak@quarnos.org>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
tests: test elf segments permissions

Signed-off-by: Pawel Dziepak <pdziepak@quarnos.org>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>