summaryrefslogtreecommitdiff
path: root/node.gypi
diff options
context:
space:
mode:
authorShao,Ting <ting.shao@intel.com>2018-05-03 16:51:56 +0800
committerAnna Henningsen <anna@addaleax.net>2018-05-14 19:10:50 +0200
commit2d4dd108296d327b874492fbd55ebbe00d003ef4 (patch)
tree842d4ad5b678a727ac181abddefcf3e619162dee /node.gypi
parentfcc46ee5a9ea9fdc66934cbba6a5e7b1486bb1aa (diff)
downloadandroid-node-v8-2d4dd108296d327b874492fbd55ebbe00d003ef4.tar.gz
android-node-v8-2d4dd108296d327b874492fbd55ebbe00d003ef4.tar.bz2
android-node-v8-2d4dd108296d327b874492fbd55ebbe00d003ef4.zip
build: add '-z relro -z now' linker flags
These flags could make some sections and the GOT entries of node process read only to avoid being modified after dynamic linking is done, thus the security could be enhanced. Fixes: https://github.com/nodejs/node/issues/20122 PR-URL: https://github.com/nodejs/node/pull/20513 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'node.gypi')
-rw-r--r--node.gypi5
1 files changed, 4 insertions, 1 deletions
diff --git a/node.gypi b/node.gypi
index 0d66a842ad..fd7c70a12b 100644
--- a/node.gypi
+++ b/node.gypi
@@ -291,7 +291,10 @@
[ 'OS=="sunos"', {
'ldflags': [ '-Wl,-M,/usr/lib/ld/map.noexstk' ],
}],
-
+ [ 'OS in "freebsd linux"', {
+ 'ldflags': [ '-Wl,-z,relro',
+ '-Wl,-z,now' ]
+ }],
[ 'node_use_openssl=="true"', {
'defines': [ 'HAVE_OPENSSL=1' ],
'conditions': [