From 1552df2ccb17a2c68a9efcba73a92c9c8ab5e1b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20G=C3=BCndling?= Date: Wed, 18 Sep 2024 22:03:52 +0200 Subject: [PATCH] -z noexecstack --- create_resource.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/create_resource.cmake b/create_resource.cmake index bddbd76..0414938 100755 --- a/create_resource.cmake +++ b/create_resource.cmake @@ -144,6 +144,7 @@ function(create_resource root input_paths lib) COMMAND ld ${arch-flag} + -z noexecstack -r -o ${CMAKE_CURRENT_BINARY_DIR}/${lib}/obj/${lib}-res.o -sectcreate binary ${short-lib} ${CMAKE_CURRENT_BINARY_DIR}/${lib}/all_res.bin ${CMAKE_CURRENT_BINARY_DIR}/${lib}/obj/stub.o @@ -277,7 +278,7 @@ reinterpret_cast(&_binary_${mangled-path}_start)},\n") string(APPEND emplace-statements " m.emplace(\"${rel-path}\", ${id});\r\n") file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${lib}/obj) add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${lib}/obj/res_${id}.o - COMMAND ${resource-linker} ${flags} -r -b binary -o ${CMAKE_CURRENT_BINARY_DIR}/${lib}/obj/res_${id}.o ${rel-path} + COMMAND ${resource-linker} ${flags} -z noexecstack -r -b binary -o ${CMAKE_CURRENT_BINARY_DIR}/${lib}/obj/res_${id}.o ${rel-path} DEPENDS ${p} WORKING_DIRECTORY ${root} COMMENT "Generating resource ${rel-path} (${CMAKE_CURRENT_BINARY_DIR}/${lib}/obj/res_${id}.o)"