]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gas: Fix checking for backwards .org with negative offset
authorAlex Coplan <alex.coplan@arm.com>
Fri, 29 May 2020 15:04:50 +0000 (16:04 +0100)
committerAlan Modra <amodra@gmail.com>
Wed, 10 Jun 2020 06:21:02 +0000 (15:51 +0930)
commit7324292cd94269c6542492beea9a11f11d0bd8b1
treee14a68a99bd2558feaeef7e5730fb8adc0f1dac3
parentae4695558dccab099b92059d5b182673ee41d012
gas: Fix checking for backwards .org with negative offset

This patch fixes internal errors in (at least) arm and aarch64 GAS
when assembling code that attempts a negative .org.  The bug appears
to be a regression introduced in binutils-2.29 by commit 9875b36538d.

* write.c (relax_segment): Fix handling of negative offset when
relaxing an rs_org frag.
* testsuite/gas/aarch64/org-neg.d: New test.
* testsuite/gas/aarch64/org-neg.l: Error output for test.
* testsuite/gas/aarch64/org-neg.s: Input for test.
* testsuite/gas/arm/org-neg.d: New test.
* testsuite/gas/arm/org-neg.l: Error output for test.
* testsuite/gas/arm/org-neg.s: Input for test.

(cherry picked from commit c39c821c1da3e8a64eff5984a39e104eb798e8b8)
gas/ChangeLog
gas/testsuite/gas/aarch64/org-neg.d [new file with mode: 0644]
gas/testsuite/gas/aarch64/org-neg.l [new file with mode: 0644]
gas/testsuite/gas/aarch64/org-neg.s [new file with mode: 0644]
gas/testsuite/gas/arm/org-neg.d [new file with mode: 0644]
gas/testsuite/gas/arm/org-neg.l [new file with mode: 0644]
gas/testsuite/gas/arm/org-neg.s [new file with mode: 0644]
gas/write.c