1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:27:45 +00:00

Kernel: Specify protection flags for ELF load headers

These are currently unused by the prekernel and ld used the same flags
by default - except for the .ksyms section which was marked as
read-write.
This commit is contained in:
Gunnar Beutner 2021-07-20 02:34:02 +02:00 committed by Andreas Kling
parent 2019cf3289
commit ac1455d3ba

View file

@ -8,15 +8,19 @@ ENTRY(init)
# define KERNEL_BASE 0x2000000000 # define KERNEL_BASE 0x2000000000
#endif #endif
#define PF_X 0x1
#define PF_W 0x2
#define PF_R 0x4
KERNEL_VIRTUAL_BASE = KERNEL_BASE; KERNEL_VIRTUAL_BASE = KERNEL_BASE;
PHDRS PHDRS
{ {
super_pages PT_LOAD ; super_pages PT_LOAD FLAGS(PF_R | PF_W) ;
text PT_LOAD ; text PT_LOAD FLAGS(PF_R | PF_X) ;
data PT_LOAD ; data PT_LOAD FLAGS(PF_R | PF_W) ;
bss PT_LOAD ; bss PT_LOAD FLAGS(PF_R | PF_W) ;
ksyms PT_LOAD ; ksyms PT_LOAD FLAGS(PF_R) ;
} }
SECTIONS SECTIONS