AnsweredAssumed Answered

Illegal instructions when using -fpic

Question asked by Gustav Andersson on Dec 22, 2017
Latest reply on Jan 25, 2018 by Davin Morris

Hello,

 

I'm trying to make my application position independent so that I can place the software anywhere in the flash of the SPC564B I'm using.

 

Is this possible using the free FreeGCC v4.9.3 with VLE support?

If so, is there a guide available on how to solve this?

 

When I'm trying to just add -fpic, -fPIC or -fpie I get illegal instructions:

make all 

ppc-freevle-eabi-gcc -c -mcpu=e200z4 -meabi -msdata=none -mregnames -mvle -O2  -gdwarf-2 -fomit-frame-pointer -falign-functions=16 -fno-gcse -Wno-missing-field-initializers -fpie -ffunction-sections -fdata-sections -fno-common  -Wall -Wextra -Wstrict-prototypes -Wa,-alms=build/lst/queue.lst  -DPPC_USE_VLE=1 -D__FREERTOS__ -DconfigUSE_APPLICATION_TASK_TAG=1 -DconfigUSE_TRACE_FACILITY=1 -D__SPC5__ -DNPI_USE_BLEIO -DNPI_USE_UART -DNPI_MASTER -DDEBUG -DEVTLOGPINS -D__POLESTAR_PAK -DPAKM_LOW_POWER -DNATIVE_BIG_ENDIAN=1 -DSODIUM_STATIC -DNPI_POLESTAR -DPAKM_PROTO_V1 -DPAKM_PROTO_V2 -MD -MP -MF .dep/queue.o.d -I. -I./components/spc56ecxx_platform_component_rla/lib/include -I./components/spc5_freertos_component_rla/lib/include -I./components/spc5_freertos_component_rla/lib/portable -I./components/spc56ecxx_low_level_drivers_component_rla/lib/include -I./components/flash_driver/lib/include -I./components/spc5_crypto_spc56ecxx_cse_driver/lib/include -I./components/spc5_crypto_spc56ecxx_cse_driver/lib/include/common -I./components/spc5_crypto_spc56ecxx_cse_driver/cfg -I./components/spc5_crypto_spc56ecxx_cse_driver/lib/test -I./components/spc5_crypto_spc56ecxx_cse_support/lib/include -I./components/spc5_crypto_spc56ecxx_cse_support/cfg -I./components/spc5_crypto_spc56ecxx_cse_support/lib/test -I./components/spc5_crypto_spc56ecxx_cse_support/../cse_crypto_driver/cfg -I./components/spc5_crypto_spc56ecxx_cse_support/../cse_crypto_driver/lib/include -I./components/spc56ecxx_board_initialization_component_rla/lib/include -I./components/spc56ecxx_clock_component_rla/lib/include -I./components/spc56ecxx_irq_component_rla/lib/include -I./components/spc56ecxx_osal_component_rla/lib/include -I./components/spc56ecxx_platform_component_rla/cfg -I./components/spc5_freertos_component_rla/cfg -I./components/spc56ecxx_low_level_drivers_component_rla/cfg -I./components/flash_driver/cfg -I./components/spc5_crypto_spc56ecxx_cse_driver/cfg -I./components/spc5_crypto_spc56ecxx_cse_support/cfg -I./components/spc56ecxx_board_initialization_component_rla/cfg -I./components/spc56ecxx_clock_component_rla/cfg -I./components/spc56ecxx_irq_component_rla/cfg -I./components/spc56ecxx_osal_component_rla/cfg -I./source/ -I./components -I../../platform/drivers/st_spc5/spc5_only -I../.. -Icomponents/spc56ecxx_low_level_drivers_component_rla/cfg ./components/spc5_freertos_component_rla/lib/src/queue.c -o build/obj/queue.o
C:\Users\username\AppData\Local\Temp\cc4I5qUf.s: Assembler messages:
C:\Users\username\AppData\Local\Temp\cc4I5qUf.s:2569: Error: Illegal instruction for VLE mode: `bl'
C:\Users\username\AppData\Local\Temp\cc4I5qUf.s:2590: Error: Illegal instruction for VLE mode: `lwz'
C:\Users\username\AppData\Local\Temp\cc4I5qUf.s:2642: Error: Illegal instruction for VLE mode: `lwz'
C:\Users\username\AppData\Local\Temp\cc4I5qUf.s:2766: Error: Illegal instruction for VLE mode: `bl'
C:\Users\username\AppData\Local\Temp\cc4I5qUf.s:2780: Error: Illegal instruction for VLE mode: `lwz'
C:\Users\username\AppData\Local\Temp\cc4I5qUf.s:2835: Error: Illegal instruction for VLE mode: `bl'
C:\Users\username\AppData\Local\Temp\cc4I5qUf.s:2848: Error: Illegal instruction for VLE mode: `lwz'
C:\Users\username\AppData\Local\Temp\cc4I5qUf.s:2880: Error: Illegal instruction for VLE mode: `lwz'
C:\Users\username\AppData\Local\Temp\cc4I5qUf.s:2913: Error: Illegal instruction for VLE mode: `bl'
C:\Users\username\AppData\Local\Temp\cc4I5qUf.s:2926: Error: Illegal instruction for VLE mode: `lwz'
C:\Users\username\AppData\Local\Temp\cc4I5qUf.s:2953: Error: Illegal instruction for VLE mode: `lwz'
make: *** [build/obj/queue.o] Error 1

Outcomes