2023-07-17 06:43:13 +00:00
|
|
|
From ff4dd4ce33133e675b7bedc86b73357c04631cb9 Mon Sep 17 00:00:00 2001
|
2022-10-13 22:13:10 +00:00
|
|
|
From: Ariadne Conill <ariadne@dereferenced.org>
|
|
|
|
Date: Fri, 21 Aug 2020 06:45:49 +0000
|
2023-07-25 20:18:13 +00:00
|
|
|
Subject: [PATCH 03/35] specs: turn on -Wl,-z,now by default
|
2022-10-13 22:13:10 +00:00
|
|
|
|
|
|
|
Previously, we also used to turn on -z relro here, but we now build
|
|
|
|
binutils with --enable-relro, which is functionally equivalent.
|
|
|
|
|
|
|
|
Binutils does not appear to have a similar option for enabling -z
|
|
|
|
now by default.
|
|
|
|
---
|
|
|
|
gcc/doc/invoke.texi | 3 +++
|
|
|
|
gcc/gcc.cc | 1 +
|
|
|
|
2 files changed, 4 insertions(+)
|
|
|
|
|
|
|
|
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
|
2023-07-17 06:43:13 +00:00
|
|
|
index b6731a4673c..f393c7846c6 100644
|
2022-10-13 22:13:10 +00:00
|
|
|
--- a/gcc/doc/invoke.texi
|
|
|
|
+++ b/gcc/doc/invoke.texi
|
2023-07-17 06:43:13 +00:00
|
|
|
@@ -17961,6 +17961,9 @@ For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
|
2022-10-13 22:13:10 +00:00
|
|
|
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,now} is used. To disable, use @option{-Wl,-z,nonow}.
|
|
|
|
+
|
|
|
|
@opindex u
|
2023-05-15 08:15:31 +00:00
|
|
|
@item -u @var{symbol}
|
2022-10-13 22:13:10 +00:00
|
|
|
Pretend the symbol @var{symbol} is undefined, to force linking of
|
|
|
|
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
|
2023-05-15 08:15:31 +00:00
|
|
|
index 33b56e721d2..f82fae23c22 100644
|
2022-10-13 22:13:10 +00:00
|
|
|
--- a/gcc/gcc.cc
|
|
|
|
+++ b/gcc/gcc.cc
|
2023-05-15 08:15:31 +00:00
|
|
|
@@ -1144,6 +1144,7 @@ proper position among the other output files. */
|
2022-10-13 22:13:10 +00:00
|
|
|
"%{flto|flto=*:%<fcompare-debug*} \
|
|
|
|
%{flto} %{fno-lto} %{flto=*} %l " LINK_PIE_SPEC \
|
|
|
|
"%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \
|
|
|
|
+ "-z now " \
|
|
|
|
"%X %{o*} %{e*} %{N} %{n} %{r}\
|
|
|
|
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \
|
|
|
|
%{Wno-poison-system-directories:--no-poison-system-directories} \
|
2023-05-15 08:15:31 +00:00
|
|
|
--
|
2023-06-09 18:45:27 +00:00
|
|
|
2.41.0
|
2023-05-15 08:15:31 +00:00
|
|
|
|