How to make position independent code with S32DS ?

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

How to make position independent code with S32DS ?

2,334 Views
wangtao8899
Contributor I

My question is How to make position independent code with S32DS? The compliler is arm-none-eabi-gcc.
I tried to add the compilation parameters "-fpie" , But the program that complied with "-fpie"
always jmp to default isr when assign value to global variables.
I also tried to add both compilation parameters "-fpie" and linker parameters "-pie", But
it will cause linker errors as shown below
-------------------------------------------------------------------
section `.interp' will not fit in region `m_flash_config'
section .interp loaded at [00004410,00004420] overlaps section .text loaded at [00004410,0000593b]
region `m_flash_config' overflowed by 1280 bytes
-------------------------------------------------------------------
May be modify the linker script file and add the section ".interp" will solve this problem ?
But will there be other potential problems?

Labels (1)
0 Kudos
3 Replies

1,452 Views
mikedoidge
NXP Employee
NXP Employee

There is a new blog on mcuoneclipse.com which covers this topic in great detail: 

Position-Independent Code With GCC for arm Cortex M 

0 Kudos

1,853 Views
mikedoidge
NXP Employee
NXP Employee

Hello,

We have posted a new example which demonstrates the implementation of position independent code. Please see https://community.nxp.com/docs/DOC-345595 for details.

Hope it helps,

Mike

0 Kudos

1,853 Views
stanish
NXP Employee
NXP Employee

Hi

there have been some issues observed with position independent code/executable compiler switch.

Please see the posts below:

https://community.nxp.com/message/1015654 

kinetis with fPIC (position independent code) 

Anyway, could you possibly describe more in the detail what is your goal? perhaps there are other ways to achieve it.

Thanks.

Stan

0 Kudos