[Bug target/54854] New: [avr] Deprecate and finally remove the -mshort-calls command line option

gjl at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Oct 8 06:51:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54854

             Bug #: 54854
           Summary: [avr] Deprecate and finally remove the -mshort-calls
                    command line option
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: gjl@gcc.gnu.org
        ReportedBy: gjl@gcc.gnu.org
            Target: avr


-mshort-calls uses RJMP/RCALL regardless of the flash size of the target
device.  This will lead to a linker error if a JMP/CALL target is out of reach
of RJMP/RCALL:

file.c:(.text+0x1234): relocation truncated to fit: R_AVR_13_PCREL against
symbol `function' defined in in module.o

The -mshort-calls option dates back to the times before the linker could relax
JMP/CALL to RJMP/RCALL if the jump offset allows this.

The above error message is a blocker and hard to understand for users.

Instead of -mstort-calls, the compiler can be called with -mrelax or
-Wl,--relax to direct the linker to use the shortest possible instruction.



More information about the Gcc-bugs mailing list