[Bug gas/20312] [2.24 regression] Assertion failure from an attempt to decrease text section alignment to 0 on unsuccessful assembly

2016-06-30 Thread ma...@linux-mips.org
https://sourceware.org/bugzilla/show_bug.cgi?id=20312

Maciej W. Rozycki  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Maciej W. Rozycki  ---
Fixed on trunk as per the commit message.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gas/20312] [2.24 regression] Assertion failure from an attempt to decrease text section alignment to 0 on unsuccessful assembly

2016-06-30 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=20312

--- Comment #1 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Maciej W. Rozycki :

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=93a24ba79b59ec343611c16cd0024a116a705274

commit 93a24ba79b59ec343611c16cd0024a116a705274
Author: Maciej W. Rozycki 
Date:   Wed Jun 29 01:38:50 2016 +0100

PR gas/20312: Do not pad sections to alignment on failed assembly

Correct a regression from commit 85024cd8bcb9 ("Run write_object_file
after errors") causing unsuccessful assembly, which may be due to any
reason, such as supplying a valid source like this:

.text
.byte   0
.err

to terminate with an assertion failure like:

test.s: Assembler messages:
test.s:3: Error: .err encountered
../as-new: BFD (GNU Binutils) 2.24.51.20140628 internal error, aborting at
.../gas/write.c line 608 in size_seg
../as-new: Please report this bug.

on targets whose default text section alignment is above 0, typically
RISC machines.

This is due to an attempt to set last text section's frag alignment to
0, requested from `subsegs_finish_section' where `frag_align_code
(alignment, 0)' is called with `alignment' set to 0 rather than the
section alignment if `had_errors' has returned true.  The call to
`subsegs_finish_section' is made from `subsegs_finish' from
`write_object_file' at unsuccessful completion, which previously wasn't
made.

Always set last section's frag alignment from the section alignment
then, forcing no section padding instead if completing unsuccessfully,
so that in that case alignment padding is still suppressed from any
listing generated, fixing assertion failures for these targets:

alpha-linuxecoff  -FAIL: all pr20312
arm-aout  -FAIL: all pr20312
mips-freebsd  -FAIL: all pr20312
mips-img-linux  -FAIL: all pr20312
mips-linux  -FAIL: all pr20312
mips-mti-linux  -FAIL: all pr20312
mips-netbsd  -FAIL: all pr20312
mips-sgi-irix5  -FAIL: all pr20312
mips-sgi-irix6  -FAIL: all pr20312
mips-vxworks  -FAIL: all pr20312
mips64-freebsd  -FAIL: all pr20312
mips64-img-linux  -FAIL: all pr20312
mips64-linux  -FAIL: all pr20312
mips64-mti-linux  -FAIL: all pr20312
mips64-openbsd  -FAIL: all pr20312
mips64el-freebsd  -FAIL: all pr20312
mips64el-img-linux  -FAIL: all pr20312
mips64el-linux  -FAIL: all pr20312
mips64el-mti-linux  -FAIL: all pr20312
mips64el-openbsd  -FAIL: all pr20312
mipsel-freebsd  -FAIL: all pr20312
mipsel-img-linux  -FAIL: all pr20312
mipsel-linux  -FAIL: all pr20312
mipsel-mti-linux  -FAIL: all pr20312
mipsel-netbsd  -FAIL: all pr20312
mipsel-vxworks  -FAIL: all pr20312
mipsisa32-linux  -FAIL: all pr20312
mipsisa32el-linux  -FAIL: all pr20312
mipsisa64-linux  -FAIL: all pr20312
mipsisa64el-linux  -FAIL: all pr20312
sh-pe  -FAIL: all pr20312
sparc-aout  -FAIL: all pr20312

gas/
PR gas/20312
* write.c (subsegs_finish_section): Force no section padding to
alignment on failed assembly, always set last frag's alignment
from section.
* testsuite/gas/all/pr20312.l: New list test.
* testsuite/gas/all/pr20312.s: New test source.
* testsuite/gas/all/gas.exp: Run the new test

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils