lucet
lucet copied to clipboard
Keep .rodata in a distinct segment?
lucetc artifacts currently result in .so
that have .text
and .rodata
merged together. From readelf -l a.out
:
Section to Segment mapping:
Segment Sections...
00 .hash .gnu.hash .dynsym .dynstr .rela.dyn .text .rodata
01 .dynamic .data
02 .dynamic
03
04 .dynamic
as a result, pages in segment 0 are all executable:
Program Headers:
Type Offset VirtAddr PhysAddr
FileSiz MemSiz Flags Align
LOAD 0x0000000000000000 0x0000000000000000 0x0000000000000000
0x0000000000021a30 0x0000000000021a30 R E 0x200000
(important bit being the E flag!)
Do we want to put .rodata
in a read-only (no-execute) segment?
Yes!