RISC-V/GAS: Correct branch relaxation for weak symbols.
authorAndrew Waterman <andrew@sifive.com>
Mon, 9 Jan 2017 09:22:33 +0000 (09:22 +0000)
committerNick Clifton <nickc@redhat.com>
Mon, 9 Jan 2017 09:22:33 +0000 (09:22 +0000)
* config/tc-riscv.c (relaxed_branch_length): Use the long
sequence when the target is a weak symbol.

gas/ChangeLog
gas/config/tc-riscv.c

index c93a61bc19d8e8ca12e2588bde9f2f65efa190f2..00f6d1aa8e3fe174b6a81ee5591ec5b71ca53ec5 100644 (file)
@@ -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.
index 1f617303493185ffc63b86ea86984d153cc3b44b..b8da6ce390be2d07edd6fda93cb2c8dedd531914 100644 (file)
@@ -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;