bss_init and data_init doesn't work with -fPIC

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

bss_init and data_init doesn't work with -fPIC

989 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by pgr on Thu Apr 03 05:33:03 MST 2014
Hi,

I have then realized that the functions bss_init() and data_init() from cr_startup are never called when compiling the application using -fPIC option. The variables __data_section_table, __data_section_table_end, __bss_section_table and __bss_section_table_end are all set to 0.

Is this the expected behavior ?

Thanks in advance

0 项奖励
回复
3 回复数

913 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Thu Apr 03 06:46:30 MST 2014
To load and run position independent code (PIC) you need a loader that will
- read the image
- set up the GOT
- initialise the registers (normally R9)
- jump into your application.

PIC is not designed to be run standalone. We do not support the use of PIC.
0 项奖励
回复

913 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by pgr on Thu Apr 03 06:23:35 MST 2014
Ok thanks for your quick answer.
What is really strange is that the debugger see the right (expected) values when debugging... but the code that run see 0.
0 项奖励
回复

913 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Thu Apr 03 05:53:37 MST 2014
This is expected as the Managed Linker Scripts do not support position independent code.
0 项奖励
回复