How to make position independent code with S32DS ?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to make position independent code with S32DS ?

2,995 次查看
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?

标签 (1)
标记 (5)
0 项奖励
回复
3 回复数

2,113 次查看
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 项奖励
回复

2,514 次查看
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 项奖励
回复

2,514 次查看
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 项奖励
回复