I got the following error during compilation
(.sram.text+0x1283): dangerous relocation: windowed longcall crosses 1GB boundary; return may fail: (UND+0xdeadcafe)
in one of the functions.
The architecture is Xtensa and the toolchain used is a GNU toolchain built for Xtensa. This error is inside the function elf_xtensa_do_reloc() in the file elf32-xtensa.c in binutils source code.
Please let me know the cause of this error and any possible solution.
After struggling with the same error when developing for ESP32 on PlatformIO, the solution I found was to change the optimatazion flags from
-Os
to-O3
.