2022-08-13 15:17:36 +00:00
|
|
|
From 40e45739e7d3787acd13b5b9a4c27d843de0ffe2 Mon Sep 17 00:00:00 2001
|
2020-08-21 10:18:02 +00:00
|
|
|
From: Ariadne Conill <ariadne@dereferenced.org>
|
|
|
|
Date: Fri, 21 Aug 2020 06:45:49 +0000
|
2022-01-06 15:11:38 +00:00
|
|
|
Subject: [PATCH] specs: turn on -Wl,-z,now by default
|
2020-08-21 10:18:02 +00:00
|
|
|
|
2022-01-06 15:11:38 +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.
|
2020-08-21 10:18:02 +00:00
|
|
|
---
|
|
|
|
gcc/doc/invoke.texi | 3 +++
|
2022-08-13 15:17:36 +00:00
|
|
|
gcc/gcc.cc | 1 +
|
2020-08-21 10:18:02 +00:00
|
|
|
2 files changed, 4 insertions(+)
|
|
|
|
|
|
|
|
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
|
2022-08-13 15:17:36 +00:00
|
|
|
index b2de464798a..83bd1bde433 100644
|
2020-08-21 10:18:02 +00:00
|
|
|
--- a/gcc/doc/invoke.texi
|
|
|
|
+++ b/gcc/doc/invoke.texi
|
2022-08-13 15:17:36 +00:00
|
|
|
@@ -16872,6 +16872,9 @@ For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
|
2020-08-21 10:18:02 +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
|
2022-01-06 15:11:38 +00:00
|
|
|
+@option{-Wl,-z,now} is used. To disable, use @option{-Wl,-z,nonow}.
|
2020-08-21 10:18:02 +00:00
|
|
|
+
|
|
|
|
@item -u @var{symbol}
|
|
|
|
@opindex u
|
|
|
|
Pretend the symbol @var{symbol} is undefined, to force linking of
|
2022-08-13 15:17:36 +00:00
|
|
|
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
|
|
|
|
index 47fb5802194..d18b5d7b59a 100644
|
|
|
|
--- a/gcc/gcc.cc
|
|
|
|
+++ b/gcc/gcc.cc
|
|
|
|
@@ -1157,6 +1157,7 @@ proper position among the other output files. */
|
2020-08-21 10:18:02 +00:00
|
|
|
"%{flto|flto=*:%<fcompare-debug*} \
|
|
|
|
%{flto} %{fno-lto} %{flto=*} %l " LINK_PIE_SPEC \
|
|
|
|
"%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \
|
2022-01-06 15:11:38 +00:00
|
|
|
+ "-z now " \
|
2020-08-21 10:18:02 +00:00
|
|
|
"%X %{o*} %{e*} %{N} %{n} %{r}\
|
|
|
|
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \
|
|
|
|
%{Wno-poison-system-directories:--no-poison-system-directories} \
|