From 8e72eea50b282e77163cc3c907170a9da8a638e3 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 21 Aug 2020 06:45:49 +0000 Subject: [PATCH] Turn on -Wl,-z,relro,-z,now by default. --- gcc/doc/invoke.texi | 3 +++ gcc/gcc.c | 1 + 2 files changed, 4 insertions(+) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 9d9a4b78ffd..129dc5b11f3 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -14666,6 +14666,9 @@ For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the linker. When using the GNU linker, you can also get the same effect with @option{-Wl,-Map=output.map}. +NOTE: In Alpine Linux, for LDFLAGS, the option +@option{-Wl,-z,relro,now} is used. To disable, use @option{-Wl,-z,norelro}. + @item -u @var{symbol} @opindex u Pretend the symbol @var{symbol} is undefined, to force linking of diff --git a/gcc/gcc.c b/gcc/gcc.c index b2200c5185a..625c9ab7902 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -1039,6 +1039,7 @@ proper position among the other output files. */ "%{flto|flto=*:%