bss_init and data_init doesn't work with -fPIC

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

bss_init and data_init doesn't work with -fPIC

975件の閲覧回数
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 返答(返信)

899件の閲覧回数
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 件の賞賛
返信

899件の閲覧回数
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 件の賞賛
返信

899件の閲覧回数
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 件の賞賛
返信