Unexpected struct initialiser in RELRO section
kevin-brodsky-arm opened this issue · 0 comments
kevin-brodsky-arm commented
It seems that Clang will always put a struct initialiser in .data.rel.ro
if the struct contains capabilities, even though they are zero-initialised. Reduced case from the Linux kernel: https://cheri-compiler-explorer.cl.cam.ac.uk/z/Pnn9fE. This seems to be target-independent, the same occurs with Morello Clang.
While this is simply unnecessary for standard dynamic binaries, for the Linux kernel this is a more serious issue as no RELRO section is expected (and the linker script asserts that there is none).