Generating position-independent code for Kinetis KEA64 causes MCU to crash

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Generating position-independent code for Kinetis KEA64 causes MCU to crash

962 Views
erikjohnson
Contributor I

When I add the -fpie option to the compiler command line and the -pie option to the linker command line, I can build fine, but no longer debug my application - launching debug results in the following error (after a successful build):

Error launching <snip>:
Can't find executable file. It may need to be rebuilt.

Running the application results in an immediate crash. However, without PIC turned on, the application compiles/runs/debugs fine (until I need to use the position-independent features)

0 Kudos
Reply
1 Reply

835 Views
jorge_a_vazquez
NXP Employee
NXP Employee

Hi

Position-independent executable is not supported by CodeWarrior, you can add this flags to your project, but if you check the disassembly code, this code still has absolute paths, moreover, you need to add special code loader which can understand where to place this code (as it suppose to be independent, it shouldn't have any specific address).

Sorry for the inconveniences that this may cause you.

Best regards

0 Kudos
Reply