bfd: xtensa: fix callx relaxation
authorMax Filippov <jcmvbkbc@gmail.com>
Sat, 16 Feb 2019 00:43:23 +0000 (16:43 -0800)
committerMax Filippov <jcmvbkbc@gmail.com>
Wed, 20 Feb 2019 10:51:01 +0000 (02:51 -0800)
commiteed62915fd5b733632af343fbf3d47c7364f8e36
treeeaa3e22f860ab7872196fea0cd0f7740d4b6da80
parente6c3b5bfb449d1a02d26f3c4bae5b732951479fc
bfd: xtensa: fix callx relaxation

Big section alignment requirements between source and destination of a
long call can result in making call range bigger than what's reachable
by the call opcode. Add biggest section alignment of sections between
the call site and call destination to the call distance when making
long call relaxation decision.

2019-02-20  Eric Tsai  <erictsai@cadence.com>
bfd/
* elf32-xtensa.c (is_resolvable_asm_expansion): Scan output
sections between the call site and call destination and adjust
call distance by the largest alignment.

ld/
* testsuite/ld-xtensa/call_overflow.d: New test definition.
* testsuite/ld-xtensa/call_overflow1.s: New test source.
* testsuite/ld-xtensa/call_overflow2.s: New test source.
* testsuite/ld-xtensa/call_overflow3.s: New test source.
* testsuite/ld-xtensa/xtensa.exp: Add call_overflow test.
bfd/ChangeLog
bfd/elf32-xtensa.c
ld/ChangeLog
ld/testsuite/ld-xtensa/call_overflow.d [new file with mode: 0644]
ld/testsuite/ld-xtensa/call_overflow1.s [new file with mode: 0644]
ld/testsuite/ld-xtensa/call_overflow2.s [new file with mode: 0644]
ld/testsuite/ld-xtensa/call_overflow3.s [new file with mode: 0644]
ld/testsuite/ld-xtensa/xtensa.exp