diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2014-04-15 19:12:46 +0400 |
---|---|---|
committer | Max Filippov <jcmvbkbc@gmail.com> | 2014-04-22 22:53:49 +0400 |
commit | a35d5e823fdfe8a6e7e05ca8e3fb8bb5697335b1 (patch) | |
tree | f6c54cb44c457093f199a20d9bcf1a37a33f32ab /gas/testsuite | |
parent | 483805cf9ea5a6dace41415d8830e93fccc49c43 (diff) | |
download | gdb-a35d5e823fdfe8a6e7e05ca8e3fb8bb5697335b1.zip gdb-a35d5e823fdfe8a6e7e05ca8e3fb8bb5697335b1.tar.gz gdb-a35d5e823fdfe8a6e7e05ca8e3fb8bb5697335b1.tar.bz2 |
Fix alignment for the first section frag on xtensa
Linking object files produced by partial linking with link-time
relaxation enabled sometimes fails with the following error message:
dangerous relocation: call8: misaligned call target: (.text.unlikely+0x63)
This happens because no basic block with an XTENSA_PROP_ALIGN flag in the
property table is generated for the first basic block, even if the
.align directive is present.
It was believed that the first frag alignment could be derived from the
section alignment, but this was not implemented for the partial linking
case: after partial linking first frag of a section may become not
first, but no additional alignment frag is inserted before it.
Basic block for such frag may be merged with previous basic block into
extended basic block during relaxation pass losing its alignment
restrictions.
Fix this by always recording alignment for the first section frag.
2014-04-22 Max Filippov <jcmvbkbc@gmail.com>
gas/
* config/tc-xtensa.c (xtensa_handle_align): record alignment for the
first section frag.
gas/testsuite/
* gas/xtensa/all.exp: Add test for the first section frag alignment.
* gas/xtensa/first_frag_align.d: First section frag alignment expected
dump.
* gas/xtensa/first_frag_align.s: First section frag alignment test
source.
Diffstat (limited to 'gas/testsuite')
-rw-r--r-- | gas/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | gas/testsuite/gas/xtensa/all.exp | 1 | ||||
-rw-r--r-- | gas/testsuite/gas/xtensa/first_frag_align.d | 9 | ||||
-rw-r--r-- | gas/testsuite/gas/xtensa/first_frag_align.s | 5 |
4 files changed, 23 insertions, 0 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index cb0bf19..ace547b 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2014-04-22 Max Filippov <jcmvbkbc@gmail.com> + + * gas/xtensa/all.exp: Add test for the first section frag alignment. + * gas/xtensa/first_frag_align.d: First section frag alignment expected + dump. + * gas/xtensa/first_frag_align.s: First section frag alignment test + source. + 2014-04-22 Christian Svensson <blue@cmd.nu> * Makefile.am: Remove openrisc and or32 support. Add support for or1k. diff --git a/gas/testsuite/gas/xtensa/all.exp b/gas/testsuite/gas/xtensa/all.exp index 3683b78..b1e6c82 100644 --- a/gas/testsuite/gas/xtensa/all.exp +++ b/gas/testsuite/gas/xtensa/all.exp @@ -99,6 +99,7 @@ if [istarget xtensa*-*-*] then { run_dump_test "weak-call" run_dump_test "jlong" run_dump_test "trampoline" + run_dump_test "first_frag_align" } if [info exists errorInfo] then { diff --git a/gas/testsuite/gas/xtensa/first_frag_align.d b/gas/testsuite/gas/xtensa/first_frag_align.d new file mode 100644 index 0000000..aafcb41 --- /dev/null +++ b/gas/testsuite/gas/xtensa/first_frag_align.d @@ -0,0 +1,9 @@ +#as: +#objdump: -s +#name: record alignment for the first section frag + +.*: +file format .*xtensa.* +#... +Contents of section .xt.prop: + 0000 00000000 00000000 00002804 .* +#... diff --git a/gas/testsuite/gas/xtensa/first_frag_align.s b/gas/testsuite/gas/xtensa/first_frag_align.s new file mode 100644 index 0000000..c120af0 --- /dev/null +++ b/gas/testsuite/gas/xtensa/first_frag_align.s @@ -0,0 +1,5 @@ + .text + .align 4 +f1: + entry a1, 32 + retw |