[exlr] (error) small data overflow

 

I am using GHS compiler and facing the above attached linker error. 

Please suggest me what might be the issue.

 

Thanks in advance,

 

Best Regards,

Uma

  • Hello Uma,

    This error could be caused by 3 possible root causes :

    1 - When you have an issue with defining SDA (Small Data Area) sections (.rosdata, .sbss, .sdata ...) in the linker script by not using .sdabase, .sda_start, and .sda_end in a propre way.

    Here the right way to define the SDA:

    RAM SDA sections must be listed in the following order:

    • Empty section used by Green Hills debug servers and startup code(.sda_start)
    • Default SDA section for initialized data (.sdata)
    • Custom SDA sections for initialized data, if any
    • Default SDA section for zero-initialized data (.sbss)
    • Custom SDA sections for zero-initialized data, if any
    • Empty section used by Green Hills debug servers and startup code (.sda_end)

    ROM SDA sections must be listed in the following order:

    • Empty section used by Green Hills debug servers and startup code(.rosda_start)
    • Default ROM SDA section (.rosdata)
    • Custom ROM SDA sections, if they exist
    • Empty section used by Green Hills debug servers and startup code(.rosda_end)

    2- When the value assigned to gp and tp registers are wrong in your startup code and not matching the SDA configuration.

    Check if gp and tp registers has the same values as the linker generated symbols __gp and __tp (found in .map file)

    The right way to initialize the registers gp and tp in the startup code is :

    mov (__gp), gp
    mov (__tp), tp

    3- When you really use more than 64K of SDA data. in this case use the linker option "-large_sda".

    Best regards,
    Amine