Meta: Enable full RELRO on Linux
Pass -z relro and -z now to ELF linkers on Linux when the linker supports them. This makes relocation sections read-only after startup and disables lazy binding so the GOT is protected as well.
This commit is contained in:
parent
67c9c62262
commit
30ec75ee74
1 changed files with 2 additions and 0 deletions
|
|
@ -199,6 +199,8 @@ endif()
|
|||
|
||||
if (LINUX)
|
||||
add_cxx_compile_definitions(_FILE_OFFSET_BITS=64)
|
||||
add_cxx_link_option_if_supported(LINKER:-z,relro)
|
||||
add_cxx_link_option_if_supported(LINKER:-z,now)
|
||||
endif()
|
||||
|
||||
if (APPLE)
|
||||
|
|
|
|||
Loading…
Reference in a new issue