aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/riscv/linux.h
diff options
context:
space:
mode:
authorYanzhang Wang <yanzhang.wang@intel.com>2023-10-07 19:32:25 +0800
committerPan Li <pan2.li@intel.com>2023-10-08 08:40:58 +0800
commitb20e59f49b51b7baf05e1b727be5da947e617496 (patch)
tree4d092d40b25feb037896579b4825f1751469303c /gcc/config/riscv/linux.h
parentf1ccee6181000bde1f11f557c44d2aef3804e598 (diff)
downloadgcc-b20e59f49b51b7baf05e1b727be5da947e617496.zip
gcc-b20e59f49b51b7baf05e1b727be5da947e617496.tar.gz
gcc-b20e59f49b51b7baf05e1b727be5da947e617496.tar.bz2
RISC-V: add static-pie support
We only need to pass options to the linker when static-pie is passed. There's another patch to enable static-pie in glibc. And we need to enable in GCC first. gcc/ChangeLog: * config/riscv/linux.h: Pass the static-pie specific options to the linker. Signed-off-by: Yanzhang Wang <yanzhang.wang@intel.com>
Diffstat (limited to 'gcc/config/riscv/linux.h')
-rw-r--r--gcc/config/riscv/linux.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h
index 7323ff3..8901671 100644
--- a/gcc/config/riscv/linux.h
+++ b/gcc/config/riscv/linux.h
@@ -55,9 +55,10 @@ along with GCC; see the file COPYING3. If not see
%{shared} \
%{!shared: \
%{!static: \
- %{rdynamic:-export-dynamic} \
- -dynamic-linker " GNU_USER_DYNAMIC_LINKER "} \
- %{static:-static}}"
+ %{!static-pie: \
+ %{rdynamic:-export-dynamic} \
+ -dynamic-linker " GNU_USER_DYNAMIC_LINKER "}} \
+ %{static:-static} %{static-pie:-static -pie --no-dynamic-linker -z text}}"
#define STARTFILE_PREFIX_SPEC \
"/lib" XLEN_SPEC "/" ABI_SPEC "/ " \