aboutsummaryrefslogtreecommitdiff
path: root/ld/emultempl
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>2018-03-11 14:25:30 +0100
committerAndreas Schwab <schwab@suse.de>2018-03-15 09:54:51 +0100
commit202d116e5714a0c21d0c38b7dd45b5d4ee494880 (patch)
treee9ba1906c8b2010e64d324edf53baa43257ff386 /ld/emultempl
parentf9671640954362a918c669700bcc9a57be25782d (diff)
downloadgdb-202d116e5714a0c21d0c38b7dd45b5d4ee494880.zip
gdb-202d116e5714a0c21d0c38b7dd45b5d4ee494880.tar.gz
gdb-202d116e5714a0c21d0c38b7dd45b5d4ee494880.tar.bz2
RISC-V: Don't enable relaxation in relocatable link
PR ld/22949 * emultempl/riscvelf.em (riscv_elf_before_allocation): Don't enable relaxation in relocatable link.
Diffstat (limited to 'ld/emultempl')
-rw-r--r--ld/emultempl/riscvelf.em13
1 files changed, 8 insertions, 5 deletions
diff --git a/ld/emultempl/riscvelf.em b/ld/emultempl/riscvelf.em
index eaaf4c5..409dd50 100644
--- a/ld/emultempl/riscvelf.em
+++ b/ld/emultempl/riscvelf.em
@@ -33,11 +33,14 @@ riscv_elf_before_allocation (void)
if (link_info.discard == discard_sec_merge)
link_info.discard = discard_l;
- /* We always need at least some relaxation to handle code alignment. */
- if (RELAXATION_DISABLED_BY_USER)
- TARGET_ENABLE_RELAXATION;
- else
- ENABLE_RELAXATION;
+ if (!bfd_link_relocatable (&link_info))
+ {
+ /* We always need at least some relaxation to handle code alignment. */
+ if (RELAXATION_DISABLED_BY_USER)
+ TARGET_ENABLE_RELAXATION;
+ else
+ ENABLE_RELAXATION;
+ }
link_info.relax_pass = 3;
}