bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/13812] New: Suboptimal default linker script cause "internal err


From: gjl at gcc dot gnu.org
Subject: [Bug ld/13812] New: Suboptimal default linker script cause "internal error: out of range error"
Date: Mon, 05 Mar 2012 21:26:36 +0000

http://sourceware.org/bugzilla/show_bug.cgi?id=13812

             Bug #: 13812
           Summary: Suboptimal default linker script cause "internal
                    error: out of range error"
           Product: binutils
           Version: 2.23 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
        AssignedTo: address@hidden
        ReportedBy: address@hidden
                CC: address@hidden
    Classification: Unclassified
            Target: avr


On big devices where stubs are generated to reach all targets of indirect
jumps, the following error might occur:

>> warning: internal error: out of range error

Reason is the following part of the default linker script that
places .trampolines after .progmem:

    /* For data that needs to reside in the lower 64k of progmem.  */
    *(.progmem.gcc*)
    *(.progmem*)
    . = ALIGN(2);
     __trampolines_start = . ;
    /* The jump trampolines for the 16-bit limited relocs will reside here.  */
    *(.trampolines)
    *(.trampolines*)
     __trampolines_end = . ;

Thus, if there is lot of data in the .progmem.data section (which is avr-gcc's
default section for data located in flash), the .trampolines section is located
outside the first 64 Ki word segment.

There are two issues:

1) The error message is not helpful at all. It should mention that something
   goes wrong with the .trampolines or gs() modifiers or stubs generation.

2) The error could be avoided by placing .trampolines prior to .progmem like
so:

    /* For data that needs to reside in the lower 64k of progmem.  */
    *(.progmem.gcc*)
    . = ALIGN(2);
     __trampolines_start = . ;
    /* The jump trampolines for the 16-bit limited relocs will reside here.  */
    *(.trampolines)
    *(.trampolines*)
     __trampolines_end = . ;
    *(.progmem*)

The .progmem.gcc* section is used for jump dispatch tables (e.g.
.progmem.gcc_sw_table) and must be located in lower 64 KiB

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- 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]