Problem with GCC_ARM linker on STM32L5 backport

Hi,

I am on a rather special quest, that involves back porting STM32L5 target from the latest MBED-OS ie., 6.4.0 into an older version of MBED-Os, specifically mbed-os 5.12.1.

For this unusual task I have selected to first try on a bear-metal code example. What I have done sofare is:

  1. I have taken the latest mbed os- (6.4.0) and exported the beare metal application
  2. Ensured that I can compile and link using GCC_ARM for target MCU_STM32L562xE (check)
  3. Copied the entire folder to another location
  4. cd mbed os and “mbed update mbed-os-5.12.1” to move to an older version of mbed (Check)
  5. Copied the target.json together with the STm32L5 target code from the latest mbed os build to this folder
  6. compile and ensured that I can compile (need to copy and some more files), 100% compiled (check)
  7. now come the linker, here I get the following error:

Link: mbed-os-example-blinky-baremetal
c:/program files (x86)/gnu tools arm embedded/6 2017-q2-update/bin/…/lib/gcc/arm-none-eabi/6.3.1/…/…/…/…/arm-none-eabi/bin/ld.exe: No address assigned to the veneers output section .gnu.sgstubs
c:/program files (x86)/gnu tools arm embedded/6 2017-q2-update/bin/…/lib/gcc/arm-none-eabi/6.3.1/…/…/…/…/arm-none-eabi/bin/ld.exe: cannot size stub section: Invalid operation
c:/program files (x86)/gnu tools arm embedded/6 2017-q2-update/bin/…/lib/gcc/arm-none-eabi/6.3.1/…/…/…/…/arm-none-eabi/bin/ld.exe: …/BUILD/KWM2200/GCC_ARM/mbed-os-example-blinky-baremetal_application.elf: warning: allocated section .text' not in segment c:/program files (x86)/gnu tools arm embedded/6 2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/bin/ld.exe: ../BUILD/KWM2200/GCC_ARM/mbed-os-example-blinky-baremetal_application.elf: warning: allocated section .ARM.exidx’ not in segment
c:/program files (x86)/gnu tools arm embedded/6 2017-q2-update/bin/…/lib/gcc/arm-none-eabi/6.3.1/…/…/…/…/arm-none-eabi/bin/ld.exe: …/BUILD/KWM2200/GCC_ARM/mbed-os-example-blinky-baremetal_application.elf: warning: allocated section .data' not in segment collect2.exe: error: ld returned 1 exit status [ERROR] c:/program files (x86)/gnu tools arm embedded/6 2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/bin/ld.exe: No address assigned to the veneers output section .gnu.sgstubs c:/program files (x86)/gnu tools arm embedded/6 2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/bin/ld.exe: cannot size stub section: Invalid operation c:/program files (x86)/gnu tools arm embedded/6 2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/bin/ld.exe: ../BUILD/KWM2200/GCC_ARM/mbed-os-example-blinky-baremetal_application.elf: warning: allocated section .text’ not in segment
c:/program files (x86)/gnu tools arm embedded/6 2017-q2-update/bin/…/lib/gcc/arm-none-eabi/6.3.1/…/…/…/…/arm-none-eabi/bin/ld.exe: …/BUILD/KWM2200/GCC_ARM/mbed-os-example-blinky-baremetal_application.elf: warning: allocated section .ARM.exidx' not in segment c:/program files (x86)/gnu tools arm embedded/6 2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/bin/ld.exe: ../BUILD/KWM2200/GCC_ARM/mbed-os-example-blinky-baremetal_application.elf: warning: allocated section .data’ not in segment
collect2.exe: error: ld returned 1 exit status

The linker script is the same as the one from mbed-os 6.4.0 … am i missing something here?

I assume this is something todo with " No address assigned to the veneers output section .gnu.sgstubs",
any idea of what this means and how I can fix it? :smiley:

Edit: I can compile and link with IAR compiler, but not with GCC_ARM.