From: Max Filippov Date: Sun, 11 Feb 2018 05:59:54 +0000 (-0800) Subject: gas: xtensa: fix trampoline placement X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=db5d5ad16fb02ceb636ccef232ec846086c6cef3;p=binutils-gdb.git 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 * config/tc-xtensa.c (xg_find_best_trampoline): Skip trampoline frag that contains source address. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index adf45692eb6..3d9b50fc329 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2018-02-13 Max Filippov + + * config/tc-xtensa.c (xg_find_best_trampoline): Skip trampoline + frag that contains source address. + 2018-02-13 Nick Clifton PR 22773 diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c index 58c2e10c187..b522447b513 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