View Issue Details

IDProjectCategoryView StatusLast Update
0036931FPCCompilerpublic2020-04-19 11:38
ReporterChristo Crause Assigned To 
Status newResolutionopen 
Product Version3.3.1 
Summary0036931: Xtensa - Linker error when linking a freertos demo program
DescriptionWhen linking a wifi example program using ESP-IDF libraries the linker generates an error:

/fpc/avr-new/rtl/units/xtensa-freertos/system.o: in function `SYSTEM_$$_SYSTEM_EXIT':
system.pp:(.text.n_SYSTEM_$$_SYSTEM_EXIT+0x0): dangerous relocation: j: cannot encode: _haltproc

Compiling and linking simpler examples work, so I suspect that the range between the jump instruction and the _haltproc address exceeds about 131070 bytes. In the general case it seems safer to rather generate a J.L macro so that the linker can decide whether J or JX can be used. The downside is of course that an extra register needs to be passed to J.L.
TagsNo tags attached.
Fixed in Revision
Attached Files



2020-04-19 09:38

administrator   ~0122241

I implemented a first workaround in r44837. Note: this is not save yet because it might destroy an argument in a15.

Christo Crause

2020-04-19 11:38

reporter   ~0122243

The work-around fixes my linking problem, thanks Florian. I'm keen to see a proper fix!

Issue History

Date Modified Username Field Change
2020-04-18 14:57 Christo Crause New Issue
2020-04-19 09:38 Florian Note Added: 0122241
2020-04-19 11:38 Christo Crause Note Added: 0122243