Skip to main content
Associate II
March 3, 2026
Solved

CubeIDE 2.1.0: system_stm32wl3x.o dangerous relocation: unsupported relocation

  • March 3, 2026
  • 5 replies
  • 869 views

I have created a project for the STM32WL33 several weeks ago, using the DEEPSTOP mode with context restoration provided by ST. Even if there are some pitfalls with this the project worked mostly fine. But after the update to STM32CubeIDE 2.1.0 I get a compilation error:

./System/Startup/cpu_context_switch.o(CPUcontextRestore): Unknown destination type (ARM/Thumb) in ./Core/Src/system_stm32wl3x.o
dangerous relocation: unsupported relocation
make: *** [makefile:89: Euris3-EHKV-WMBus.elf] Error 1

I've reverted the version to 2.0.0 and the error is gone.

Best answer by Andrew Neil

@RWalko wrote:

system_stm32wl3x.o
dangerous relocation: unsupported relocation


Same message here: Solved: system_stm32wb0x.c - dangerous relocation: unsupported relocation (CubeIDE, CubeMX).

 

@Ghofrane GSOURI - Internal Ticked 228023 raised by @Mahmoud Ben Romdhane

5 replies

Ghofrane GSOURI
Technical Moderator
March 3, 2026

Hello @RWalko 

Could you please provide your project?

THX

Ghofrane

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
RWalkoAuthor
Associate II
March 3, 2026

Sorry, I cannot provide my project as it includes company code and I cannot quickly clean it up. If you can provide a safe data transfer possibility I may be able to send you the project.

Andrew Neil
Andrew NeilBest answer
Super User
March 3, 2026

@RWalko wrote:

system_stm32wl3x.o
dangerous relocation: unsupported relocation


Same message here: Solved: system_stm32wb0x.c - dangerous relocation: unsupported relocation (CubeIDE, CubeMX).

 

@Ghofrane GSOURI - Internal Ticked 228023 raised by @Mahmoud Ben Romdhane

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
gbm
Principal
March 3, 2026

That's simply a new wording for an old linker error message "undefined symbol". Some strange update happened to LD.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
Andrew Neil
Super User
March 10, 2026

@gbm wrote:

That's simply a new wording for an old linker error message "undefined symbol". 


Seems to be slightly different ?

The problem seems to the that the Assembler and/or Linker has become more picky about the specific details of the definition - the definition does exist, but is not qualified with this new %function directive requirement ?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Andrew Neil
Super User
March 3, 2026

From the ARM forums:

"Since binutils version 2.44, functions in assembly must include the assembler directive .type name, %function, otherwise they fail at linking."

binutils 2.44 and GCC 15.1.0 - dangerous relocation: unsupported relocation error when trying to build U-Boot.

 

See also: https://gcc.gnu.org/pipermail/gcc-help/2025-May/144189.html

And: https://lists.denx.de/pipermail/u-boot/2025-May/589101.html 

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
HNish.2
Associate
April 13, 2026

Could you tell me how to write this in C?
Would I need to use inline assembly?

Andrew Neil
Super User
April 13, 2026

It seems to be purely an issue for assembler?

I think you need to start a separate thread of your own (this one is already marked as solved), giving a full description of your particular situation.

You can always give a link back to this thread, for context.

 

How to write your question to maximize your chances to find a solution

 

 

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Andrew Neil
Super User
April 1, 2026

@Ghofrane GSOURI @Mahmoud Ben Romdhane 

Another example of the same issue has just appeared - this time with H7 & X-CUBE-AUDIO-KIT:
livetune Designer Source Code Compilation Error

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Andrew Neil
Super User
April 27, 2026

@Andrew Neil wrote:

@Ghofrane GSOURI @Mahmoud Ben Romdhane 

Another example of the same issue has just appeared - this time with H7 & X-CUBE-AUDIO-KIT:


And another here: Unknown destination type (ARM/Thumb) linking error in cube ide

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.