Hi all: Palmer has been added -mno-relax option before, I propose it should also pass to linker during link phase.
ChangeLog: 2018-04-18 Kito Cheng <kito.ch...@gmail.com> * config/riscv/elf.h (LINK_SPEC): Pass --no-relax if -mno-relax is present. * config/riscv/linux.h (LINK_SPEC): Ditto.
From 1f18c78eb54c9e5aa66b4490af61f8803fa47267 Mon Sep 17 00:00:00 2001 From: Kito Cheng <kito.ch...@gmail.com> Date: Wed, 18 Apr 2018 11:22:45 +0800 Subject: [PATCH] RISC-V: Pass --no-relax to linker if -mno-relax is present. 2018-04-18 Kito Cheng <kito.ch...@gmail.com> * config/riscv/elf.h (LINK_SPEC): Pass --no-relax if -mno-relax is present. * config/riscv/linux.h (LINK_SPEC): Ditto. --- gcc/config/riscv/elf.h | 1 + gcc/config/riscv/linux.h | 1 + 2 files changed, 2 insertions(+) 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.11.2