From 4e96980d5af468ae639995925e54abbbe73dc622 Mon Sep 17 00:00:00 2001 From: Gallaecio Date: Wed, 17 Jan 2018 18:01:58 +0000 Subject: [PATCH] Build with the "read-only relocation" hardening linker flag Summary: Improve binary security by enabling a hardening linker flag. Test Plan: Patch already used on Debian. Tested locally by @Gallaecio as well. Reviewed By: LudovicRousseau Trac Tickets: #4894 Differential Revision: https://code.wildfiregames.com/D1123 This was SVN commit r20896. --- binaries/data/mods/public/gui/credits/texts/programming.json | 1 + build/premake/premake4.lua | 2 +- build/premake/premake5.lua | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/binaries/data/mods/public/gui/credits/texts/programming.json b/binaries/data/mods/public/gui/credits/texts/programming.json index cac3e81da9..d0bb0733aa 100644 --- a/binaries/data/mods/public/gui/credits/texts/programming.json +++ b/binaries/data/mods/public/gui/credits/texts/programming.json @@ -225,6 +225,7 @@ {"nick": "trompetin17", "name": "Juan Guillermo"}, {"nick": "user1", "name": "A. C."}, {"nick": "usey11"}, + {"nick": "vincent_c", "name": "Vincent Cheng"}, {"nick": "vladislavbelov", "name": "Vladislav Belov"}, {"nick": "vts", "name": "Jeroen DR"}, {"nick": "WhiteTreePaladin", "name": "Brian Ashley"}, diff --git a/build/premake/premake4.lua b/build/premake/premake4.lua index a8ebb0d72f..73c45dc824 100644 --- a/build/premake/premake4.lua +++ b/build/premake/premake4.lua @@ -271,7 +271,7 @@ function project_set_build_flags() if os.is("linux") or os.is("bsd") then buildoptions { "-fPIC" } - linkoptions { "-Wl,--no-undefined", "-Wl,--as-needed" } + linkoptions { "-Wl,--no-undefined", "-Wl,--as-needed", "-Wl,-z,relro" } end if arch == "x86" then diff --git a/build/premake/premake5.lua b/build/premake/premake5.lua index cd7d884027..4d8ee46fad 100644 --- a/build/premake/premake5.lua +++ b/build/premake/premake5.lua @@ -257,7 +257,7 @@ function project_set_build_flags() if os.istarget("linux") or os.istarget("bsd") then buildoptions { "-fPIC" } - linkoptions { "-Wl,--no-undefined", "-Wl,--as-needed" } + linkoptions { "-Wl,--no-undefined", "-Wl,--as-needed", "-Wl,-z,relro" } end if arch == "x86" then