This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] RISC-V/GAS: Correct branch relaxation for weak symbols.
- From: Nick Clifton <nickc at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 9 Jan 2017 09:23:11 -0000
- Subject: [binutils-gdb] RISC-V/GAS: Correct branch relaxation for weak symbols.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=011561117eeaff00862eb5f465c3470f29e8a9a9
commit 011561117eeaff00862eb5f465c3470f29e8a9a9
Author: Andrew Waterman <andrew@sifive.com>
Date: Mon Jan 9 09:22:33 2017 +0000
RISC-V/GAS: Correct branch relaxation for weak symbols.
* config/tc-riscv.c (relaxed_branch_length): Use the long
sequence when the target is a weak symbol.
Diff:
---
gas/ChangeLog | 5 +++++
gas/config/tc-riscv.c | 1 +
2 files changed, 6 insertions(+)
diff --git a/gas/ChangeLog b/gas/ChangeLog
index c93a61b..00f6d1a 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2017-01-09 Andrew Waterman <andrew@sifive.com>
+
+ * config/tc-riscv.c (relaxed_branch_length): Use the long
+ sequence when the target is a weak symbol.
+
2017-01-04 Szabolcs Nagy <szabolcs.nagy@arm.com>
* config/tc-aarch64.c (aarch64_features): Add rcpc.
diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c
index 1f61730..b8da6ce 100644
--- a/gas/config/tc-riscv.c
+++ b/gas/config/tc-riscv.c
@@ -360,6 +360,7 @@ relaxed_branch_length (fragS *fragp, asection *sec, int update)
if (fragp->fr_symbol != NULL
&& S_IS_DEFINED (fragp->fr_symbol)
+ && !S_IS_WEAK (fragp->fr_symbol)
&& sec == S_GET_SEGMENT (fragp->fr_symbol))
{
offsetT val = S_GET_VALUE (fragp->fr_symbol) + fragp->fr_offset;