lucet icon indicating copy to clipboard operation
lucet copied to clipboard

Keep .rodata in a distinct segment?

Open awortman-fastly opened this issue 5 years ago • 1 comments

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?

awortman-fastly avatar Jun 07 '19 23:06 awortman-fastly

Yes!

jedisct1 avatar Jun 07 '19 23:06 jedisct1