[Bug 197806] devel/binutils: fix undefined behavior in gas's tc-arm.c

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Wed Feb 18 20:33:33 UTC 2015


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=197806

            Bug ID: 197806
           Summary: devel/binutils: fix undefined behavior in gas's
                    tc-arm.c
           Product: Ports & Packages
           Version: Latest
          Hardware: arm
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: Individual Port(s)
          Assignee: bapt at FreeBSD.org
          Reporter: dim at FreeBSD.org
             Flags: maintainer-feedback?(bapt at FreeBSD.org)
          Assignee: bapt at FreeBSD.org

Created attachment 153160
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=153160&action=edit
Fix undefined behavior in gas/contrib/tc-arm.c's rotate_left() macro

In bug 197395, which is about an exp-run for clang 3.6.0, failures were
reported for two arm cross development ports:

http://pb2.nyi.freebsd.org/data/headi386PR197395-default/2015-02-12_00h00m41s/logs/errors/arm-none-eabi-gcc-4.9.1_2.log
http://pb2.nyi.freebsd.org/data/headi386PR197395-default/2015-02-12_00h00m41s/logs/errors/armv6-freebsd10.0-xdev-10.0.log

Both of these failures were due to gas emitting "Error: invalid constant (ff)
after fixup" on valid assembly, such as "mov ip, #0xff".

It turns out this is due to undefined behavior in gas, specifically in
gas/config/tc-arm.c, in the rotate_left() macro, which was fixed by this
upstream commit:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=d840c081f8082e8b9e63fead5306643975a97bb3

The attachment adds this as a patch to devel/binutils/files, so it will get
picked up by devel/arm-*-binutils too.  This will also fix the
arm-none-eabi-gcc and armv6-freebsd10.0-xdev ports.

--- Comment #1 from Bugzilla Automation <bugzilla at FreeBSD.org> ---
Auto-assigned to maintainer bapt at FreeBSD.org

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-ports-bugs mailing list