diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2018-02-10 21:59:54 -0800 |
---|---|---|
committer | Max Filippov <jcmvbkbc@gmail.com> | 2018-02-13 09:32:47 -0800 |
commit | db5d5ad16fb02ceb636ccef232ec846086c6cef3 (patch) | |
tree | 27dd3c8fd404fd28a7f792e044bf8f6bb1e0a150 /gas/config | |
parent | 24b9144d4ba83d37751786b08b48ad62fb7aef26 (diff) | |
download | gdb-db5d5ad16fb02ceb636ccef232ec846086c6cef3.zip gdb-db5d5ad16fb02ceb636ccef232ec846086c6cef3.tar.gz gdb-db5d5ad16fb02ceb636ccef232ec846086c6cef3.tar.bz2 |
gas: xtensa: fix trampoline placement
For jumps requiring multiple trampolines trampoline placement code may
place multiple sequential trampolines into the same frag. Don't do that.
gas/
2018-02-13 Max Filippov <jcmvbkbc@gmail.com>
* config/tc-xtensa.c (xg_find_best_trampoline): Skip trampoline
frag that contains source address.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-xtensa.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c index 58c2e10..b522447 100644 --- a/gas/config/tc-xtensa.c +++ b/gas/config/tc-xtensa.c @@ -9339,6 +9339,12 @@ static size_t xg_find_best_trampoline (struct trampoline_index *idx, trampoline_frag->fr_address > target)) continue; + /* Don't choose trampoline that contains the source. */ + if (source >= trampoline_frag->fr_address + && source <= trampoline_frag->fr_address + + trampoline_frag->fr_fix) + continue; + off = trampoline_frag->fr_address - fulcrum; /* Stop if some trampoline is found and the search is more than J_RANGE / 4 from the projected fulcrum. A trampoline w/o jump |