base: Explicitly state ELF segment flags

The code in base-hw/src/bootstrap/platform.cc uses segment flags for
identification purposes. Based on this information the code decides
what to do with each segment. Unfortunately the linker script does
not actually ensure the flags for a specific named segment match
expectations. The code relies on implicit linker behaviour.
This implicit behaviour can vary between linkers. This breaks
arm_v7a base-hw builds linked with LLVM's lld linker. The segment
named "ro" ends up having writeable flag set when using LLD.

This patch ensures that all ELF segments in genode.ld have their
required perimssion flags set explicitly.

Fixes #3988
This commit is contained in:
Piotr Tworek 2020-12-09 00:15:27 +01:00 committed by Norman Feske
parent 80e8cf99e2
commit 8b172bf22e

View File

@ -15,8 +15,8 @@ ENTRY(_start)
PHDRS
{
ro PT_LOAD;
rw PT_LOAD;
ro PT_LOAD FLAGS(5);
rw PT_LOAD FLAGS(6);
boot PT_LOAD FLAGS(4);
}