MIPS/GAS: Correct branch relaxation for weak symbols
authorMaciej W. Rozycki <macro@imgtec.com>
Sat, 9 Apr 2016 10:59:36 +0000 (11:59 +0100)
committerMaciej W. Rozycki <macro@imgtec.com>
Wed, 13 Apr 2016 12:38:50 +0000 (13:38 +0100)
commit991f40a9fa668eb65159ee9884bf89c8cbc09f02
treee5fd317846540cfafc8d7d702169cb17609c0466
parentc1f61bd2b0644fc710dcfbb378a63f0b34be8903
MIPS/GAS: Correct branch relaxation for weak symbols

Weak symbols can be preempted at link time so always choose the longer
sequence in branch relaxation, according to the relaxation level chosen,
so that any symbol finally used as the branch target is reachable.

2016-04-13  Maciej W. Rozycki  <macro@imgtec.com>
            Andrew Bennett  <andrew.bennett@imgtec.com>

gas/
* config/tc-mips.c (relaxed_branch_length): Use the long
sequence where the target is a weak symbol.
(relaxed_micromips_32bit_branch_length): Likewise.
(relaxed_micromips_16bit_branch_length): Likewise.
* testsuite/gas/mips/branch-weak-1.d: New test.
* testsuite/gas/mips/branch-weak-2.d: New test.
* testsuite/gas/mips/branch-weak-3.d: New test.
* testsuite/gas/mips/branch-weak-4.d: New test.
* testsuite/gas/mips/branch-weak-5.d: New test.
* testsuite/gas/mips/branch-weak.l: New stderr output.
* testsuite/gas/mips/branch-weak.s: New test source.
* testsuite/gas/mips/mips.exp: Run the new tests.
gas/ChangeLog
gas/config/tc-mips.c
gas/testsuite/gas/mips/branch-weak-1.d [new file with mode: 0644]
gas/testsuite/gas/mips/branch-weak-2.d [new file with mode: 0644]
gas/testsuite/gas/mips/branch-weak-3.d [new file with mode: 0644]
gas/testsuite/gas/mips/branch-weak-4.d [new file with mode: 0644]
gas/testsuite/gas/mips/branch-weak-5.d [new file with mode: 0644]
gas/testsuite/gas/mips/branch-weak.l [new file with mode: 0644]
gas/testsuite/gas/mips/branch-weak.s [new file with mode: 0644]
gas/testsuite/gas/mips/mips.exp