bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gas/18625] New: Thumb2 branch out of range error


From: prathamesh.kulkarni at linaro dot org
Subject: [Bug gas/18625] New: Thumb2 branch out of range error
Date: Sun, 05 Jul 2015 16:14:46 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=18625

            Bug ID: 18625
           Summary: Thumb2 branch out of range error
           Product: binutils
           Version: 2.26 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gas
          Assignee: unassigned at sourceware dot org
          Reporter: prathamesh.kulkarni at linaro dot org
  Target Milestone: ---

Hi,
During LTO compilation of chromium with gcc trunk for single partition
(-flto --param lto-partitions=1) I get the following assembly error:
Thumb2 branch out of range.
LTO compilation of chromium with multiple partitions has no issues,
this happens only for single or no partitioning.

Assembly file: https://www.dropbox.com/s/yl171mwqd9lad9c/chrome.ltrans0.s?dl=0
Options passed to gas: -march=armv7-a -mfloat-abi=hard -mfpu=neon -meabi=5

Backtrace:
I get the following backtrace under gdb:
#0  as_bad_where (file=0x7fffffffe29f
"chromium/src/out/Release/chrome.ltrans0.s", line=20710144,
format=0x552ed2 "Thumb2 branch out of range")
    at
/home/prathamesh.kulkarni/gnu-toolchain/src/binutils-gdb.git/gas/messages.c:259
#1  0x000000000045e7dd in md_apply_fix (fixP=0x931ea6e0,
valP=0x7fffffffdaa8, seg=0x7cf7c0)
    at
/home/prathamesh.kulkarni/gnu-toolchain/src/binutils-gdb.git/gas/config/tc-arm.c:22700
#2  0x000000000042f0fd in fixup_segment (fixP=0x931ea6e0,
this_segment=0x7cf7c0)
    at
/home/prathamesh.kulkarni/gnu-toolchain/src/binutils-gdb.git/gas/write.c:1067
#3  0x000000000042f36e in fix_segment (abfd=0x7b81f0, sec=0x7cf7c0,
xxx=0x0) at
/home/prathamesh.kulkarni/gnu-toolchain/src/binutils-gdb.git/gas/write.c:1132
#4  0x0000000000473540 in bfd_map_over_sections (abfd=0x7b81f0,
operation=0x42f334 <fix_segment>, user_storage=0x0)
    at
/home/prathamesh.kulkarni/gnu-toolchain/src/binutils-gdb.git/bfd/section.c:1365
#5  0x0000000000430f9c in write_object_file () at
/home/prathamesh.kulkarni/gnu-toolchain/src/binutils-gdb.git/gas/write.c:2038
#6  0x0000000000406123 in main (argc=2, argv=0x7b85c0) at
/home/prathamesh.kulkarni/gnu-toolchain/src/binutils-gdb.git/gas/as.c:1276

The program aborts from here by calling as_bad_where() in
tc-arm.c:md_apply_fix():
if ((value & ~0x3fffff) && ((value & ~0x3fffff) != ~0x3fffff))
        {
          if (!(ARM_CPU_HAS_FEATURE (cpu_variant, arm_arch_t2)))
            as_bad_where (fixP->fx_file, fixP->fx_line, BAD_RANGE);
          else if ((value & ~0x1ffffff)
                   && ((value & ~0x1ffffff) != ~0x1ffffff))
            as_bad_where (fixP->fx_file, fixP->fx_line,
                          _("Thumb2 branch out of range"));
        }
For the case when branch is out of range, "value" equals ffffffda.

This probably happens because the section generated during LTO build is too
large, and function call exceeds the range for short-call.
Forcing gcc to emit long calls for each function call doesn't result in this
error. I wonder if this is gas or gcc bug ?

Thank you,
Prathamesh

-- 
You are receiving this mail because:
You are on the CC list for the bug.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]