Example 4: GNU_RELRO in its own LOAD segment (Compliant)
In plain words
A .so file is 16 KB compliant even if GNU_RELRO doesn't end on a 16 KB boundary, provided it ends where its containing LOAD segment ends and no writable data follows.
- Example: (0x4680 + 0x0980) % 0x4000 gives 0x1000, not zero, yet the file is still 16 KB compliant.
- Compare GNU_RELRO with its containing LOAD segment: both start at VirtAddr 0x4680 and end at the same address, 0x5000.
- The LOAD segment contains only RELRO data, so there is no writable .data or .bss in the range 0x5000 to 0x8000.
- Either the library has no non-RELRO writable data, or any later writable LOAD segment starts at 0x8000 or beyond, on a separate 16 KB page boundary.
- The read-only protection won't overlap writable data, so no segmentation fault occurs.
From the official text
In this example, GNURELRO does not end on a 16 KB boundary, but it is still compliant because no writable data follows it in the same LOAD segment: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align LOAD 0x000000 0x0000000000000000 0x0000000000000000 0x000680 0x000680 R E 0x4000 LOAD 0x000680 0x0000000000004680 …
Read the full official text ↗ Open in the StoreRules library Ask whether your app complies
Change history
- · added
Developers' cases about this clause
No cases yet.