c - ARM link error when calling a function residing in different memory -
i wanted clean code , a.c file included in b.c file. wanted build a.c file whole project , files in project can access functions defined in a.c file.
after building a.c file whole project , not compile time errors. call function defined in a.c file different file arm link errors.
************* linking armlink : error l6291: cannot assign fixed execution region load address:. load address must greater or equal next available load address:. armlink : not enough information produce symdefs file. armlink : finished: 1 information, 0 warning , 1 error messages. make[1]: *** [common.axf] error 1 make[1]: leaving directory `/scripts' make: *** error 2
the file calling function in a.c resides in sram. while a.c resides in dram. if call function file resides in dram, not link error.
following map files generated:
function in a.c not called calling file. calling file resides in sram:
0x0000faa8 0x00000008 code ro 5150 i.time__delay_ticks rtos.o 0x0000fab0 0x00000008 code ro 5203 sram_code_arm callingfile.o 0x0000fab8 0x00000020 data ro 1397 .constdata file1.o 0x0000fad8 0x0000000e data ro 3725 .constdata file2.o 0x0000fae6 0x00000002 pad 0x0000fae8 0x00000009 data ro 4526 .constdata file3.o 0x0000faf1 0x00000003 pad 0x0000faf4 0x0000000e data ro 5398 .constdata file4.o
after calling function resides in a.c. callingfile(sram)->calls function test()->test() in a.c(dram)
0x0000faa8 0x00000008 code ro 5150 i.time__delay_ticks rtos.o 0x0000fac8 0x00000008 code ro 5203 sram_code_arm callingfile.o 0x0000fad0 0x00038758 data ro 996 .constdata a.o 0x00048228 0x00000020 data ro 1397 .constdata file1.o 0x00048248 0x0000000e data ro 3725 .constdata file2.o 0x00048256 0x00000002 pad 0x00048258 0x00000009 data ro 4526 .constdata file3.o 0x00048261 0x00000003 pad
why see bytes 0x00038758(a.o) when function called calling file?
Comments
Post a Comment