mirror of
https://github.com/simplex-chat/haskell.nix.git
synced 2026-06-03 09:17:32 +00:00
When declared as constant, read-only relocatable data are written to an unwriteable .rel.ro.data section. Being unwriteable, the gold linker doesn't put them inside the GNU_RELRO segment, but in a always read-only segment. Starting the relocation phase of such a built program then ends in a segmentation fault. By declaring read-only relocatable data as writeable, they will be put inside a writeable .rel.ro.data section. The gold linker will then assume that those can be put inside the GNU_RELRO segment, that will only be writeable during the relocation phase. The as assembler and ld linker will always consider the .rel.ro.data as writeable before relocation, and put the associated data in the GNU_RELRO. Co-authored-by: Michivi <webmaster@michvi.com>