From 559fb136c980cd1d52af43202c3a9dc511ea2240 Mon Sep 17 00:00:00 2001 From: Kito Cheng Date: Sat, 21 Apr 2018 01:03:30 +0000 Subject: [PATCH] RISC-V: Pass --no-relax to linker if -mno-relax is present. gcc/ 2018-04-20 Kito Cheng * config/riscv/elf.h (LINK_SPEC): Pass --no-relax if -mno-relax is present. * config/riscv/linux.h (LINK_SPEC): Ditto. From-SVN: r259540 --- gcc/ChangeLog | 6 ++++++ gcc/config/riscv/elf.h | 1 + gcc/config/riscv/linux.h | 1 + 3 files changed, 8 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 750958465f9..63acb1fbc8e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-04-20 Kito Cheng + + * config/riscv/elf.h (LINK_SPEC): Pass --no-relax if + -mno-relax is present. + * config/riscv/linux.h (LINK_SPEC): Ditto. + 2018-04-20 Martin Sebor PR c/85365 diff --git a/gcc/config/riscv/elf.h b/gcc/config/riscv/elf.h index f39e83234d2..a8357bb6e18 100644 --- a/gcc/config/riscv/elf.h +++ b/gcc/config/riscv/elf.h @@ -19,6 +19,7 @@ along with GCC; see the file COPYING3. If not see #define LINK_SPEC "\ -melf" XLEN_SPEC "lriscv \ +%{mno-relax:--no-relax} \ %{shared}" /* Link against Newlib libraries, because the ELF backend assumes Newlib. diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h index ad03654e8d6..aa8a28d5d31 100644 --- a/gcc/config/riscv/linux.h +++ b/gcc/config/riscv/linux.h @@ -51,6 +51,7 @@ along with GCC; see the file COPYING3. If not see #define LINK_SPEC "\ -melf" XLEN_SPEC "lriscv \ +%{mno-relax:--no-relax} \ %{shared} \ %{!shared: \ %{!static: \ -- 2.30.2