gas: use literals/const16 for xtensa loop relaxation
authorMax Filippov <jcmvbkbc@gmail.com>
Tue, 2 Apr 2019 21:32:42 +0000 (14:32 -0700)
committerMax Filippov <jcmvbkbc@gmail.com>
Wed, 3 Apr 2019 17:24:15 +0000 (10:24 -0700)
commit403b0b61f6d4358aee8493cb1d11814e368942c9
treead564c6c9f423c3a756aead6577a242c46da5e1e
parent1c6aafe894645ca1da5c0dd0661bca19caf37ad0
gas: use literals/const16 for xtensa loop relaxation

Loop opcode relaxation that uses addi/addmi doesn't work well with other
relaxations that may cause code movement. Instead of encoding fixed loop
end offset in the relaxed sequence use l32r or a pair of const16 to load
loop end address. This way the address of the loop end gets a relocation
record and it gets updated appropriately.

gas/
2019-04-03  Max Filippov  <jcmvbkbc@gmail.com>

* config/tc-xtensa.c (convert_frag_immed): Drop
convert_frag_immed_finish_loop invocation.
(convert_frag_immed_finish_loop): Drop declaration and
definition.
* config/xtensa-relax.c (widen_spec_list): Replace loop
widening that uses addi/addmi with widening that uses l32r
and const16.
gas/ChangeLog
gas/config/tc-xtensa.c
gas/config/xtensa-relax.c