diff --git a/gas/ChangeLog b/gas/ChangeLog index 1416f86d8ed..12b6694c4e6 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2014-04-22 Max Filippov + + * config/tc-xtensa.c (xtensa_handle_align): record alignment for the + first section frag. + 2014-04-22 Christian Svensson * Makefile.am: Remove openrisc and or32 support. Add support for or1k. diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c index ea23c965323..58ace3809e8 100644 --- a/gas/config/tc-xtensa.c +++ b/gas/config/tc-xtensa.c @@ -5609,7 +5609,6 @@ xtensa_handle_align (fragS *fragP) && ! fragP->tc_frag_data.is_literal && (fragP->fr_type == rs_align || fragP->fr_type == rs_align_code) - && fragP->fr_address + fragP->fr_fix > 0 && fragP->fr_offset > 0 && now_seg != bss_section) { diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index cb0bf195459..ace547bc842 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2014-04-22 Max Filippov + + * 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 * 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 3683b78f4ad..b1e6c826433 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 00000000000..aafcb41bc93 --- /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 00000000000..c120af002d5 --- /dev/null +++ b/gas/testsuite/gas/xtensa/first_frag_align.s @@ -0,0 +1,5 @@ + .text + .align 4 +f1: + entry a1, 32 + retw