Skip to main content
Graduate
December 18, 2023
Solved

Linker complains after working fine for 4 days! (linkerscript was only changed 4 days ago).

  • December 18, 2023
  • 2 replies
  • 1890 views

How in the world of programming is this possible? I got enough other problems to fix already.

It worked flawless before!

 

ld.exe: G431RBT6_Bootloader.elf section `.text' will not fit in region `FLASH'
ld.exe: section .applicationBlock LMA [000000000801f800,000000000801fa7b] overlaps section .text LMA [00000000080001e0,0000000008026e33]
ld.exe: region `FLASH' overflowed by 4294965884 bytes

    This topic has been closed for replies.
    Best answer by Tobe

    Found the problem: i not just had a big object, i included whole libraries! I made my own lib which will run on STM32 and windows. It overflowed by over 4GB !

    2 replies

    ST Employee
    December 18, 2023

    Hello @Tobe 

    4294965884 bytes is an enormous overflow of data  

    Look at the build analyzer or the map file for the build configuration that creates the elf file. It will show you what's consuming data.

    TobeAuthor
    Graduate
    December 18, 2023

    The build analyser shows nothing at all.

    Here is the overview of the mapfile: (Highest number is like 0xXXXXX and 0xffffffffffffffff at *default* - "* ... *" means i left out text)

     


    Discarded input sections

    .text 0x0000000000000000 0x0

    * ... (many 0x0000)*

    Memory Configuration

    Name Origin Length Attributes
    RAM 0x0000000020000000 0x0000000000008000 xrw
    FLASH 0x0000000008000000 0x0000000000020000 xr
    *default* 0x0000000000000000 0xffffffffffffffff

    .isr_vector 0x0000000008000000 0x1d8
    * ... *
    0x000000000802b7c8 _sidata = LOADADDR (.data)

    .data 0x0000000020000000 0x2d4 load address 0x000000000802b7c8
    * ... *
    0x00000000200022a0 . = ALIGN (0x8)

    /DISCARD/
    libc.a(*)
    libm.a(*)
    libgcc.a(*)

    .ARM.attributes
    0x0000000000000000 0x30
    * ... *
    .ARM.attributes
    0x0000000000002f84 0x1e * ... *none-eabi/10.3.1/thumb/v7e-m+fp/hard/crtn.o
    OUTPUT(G431RBT6_Bootloader.elf elf32-littlearm)
    LOAD linker stubs
    LOAD * ... *../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard\libc.a
    LOAD * ... */.././../../arm-none-eabi/lib/thumb/v7e-m+fp/hard\libm.a
    LOAD * ... *ib/gcc/arm-none-eabi/10.3.1/thumb/v7e-m+fp/hard\libgcc.a

    .debug_info 0x0000000000000000 0x15bd6
    * ... *



     

    Super User
    December 18, 2023

    It tells you the issue:

    > ld.exe: section .applicationBlock LMA [000000000801f800,000000000801fa7b] overlaps section .text LMA [00000000080001e0,0000000008026e33]

    You've allocated a large array or object that doesn't fit within the available memory. This would be done in your code, not the linker script.

    TobeAuthorAnswer
    Graduate
    December 18, 2023

    Found the problem: i not just had a big object, i included whole libraries! I made my own lib which will run on STM32 and windows. It overflowed by over 4GB !