can i only link one elf to 2nd elf for sym addr resolution?
Posted: Mon Aug 06, 2012 12:33 pm
Memory map of project is 32k (0- 32k)ROM for boot bin, 16k (32k- 48k) stack RAM, then 64k ( 48k - 112k) kernel RAM.
I have boot bin of 20k size, but ROM size is 32k, so i wanted to use 12K space available, and shift some kernel code in boot.
So i made a separate SECTION ( say .BOOT) taking one file ( say common.c) from kernel and built section .BOOT at address 20k in boot linker srcipt ld file. I got the common.elf, common.o, common.bin what ever is needed, either by copying section .BOOT using 'objcopy' or by building only common.o. I programmed this kernel.bin at address 20k in my hardware setup. i used readelf binutil to cross check that common.c functions has got proper address starting from 20k.
Now i want to call functions present in common.c ( burnt as kernel.bin into hw) from kernel during execution.
I included the kernel.h file as needed in kernel build so that kernel compilation can pass. Now i want to use common.elf to link with kernel build so that all references to functions in common.c are resolved. is it possible ? I tried , but linking fails
I dont want to use static lib from kernel.elf, coz it will copy kernel.o again in kernel build which would be 2nd copy of kernel.o. And since its running in HW so i cant make use of shared lib.
Please help !
I have boot bin of 20k size, but ROM size is 32k, so i wanted to use 12K space available, and shift some kernel code in boot.
So i made a separate SECTION ( say .BOOT) taking one file ( say common.c) from kernel and built section .BOOT at address 20k in boot linker srcipt ld file. I got the common.elf, common.o, common.bin what ever is needed, either by copying section .BOOT using 'objcopy' or by building only common.o. I programmed this kernel.bin at address 20k in my hardware setup. i used readelf binutil to cross check that common.c functions has got proper address starting from 20k.
Now i want to call functions present in common.c ( burnt as kernel.bin into hw) from kernel during execution.
I included the kernel.h file as needed in kernel build so that kernel compilation can pass. Now i want to use common.elf to link with kernel build so that all references to functions in common.c are resolved. is it possible ? I tried , but linking fails
I dont want to use static lib from kernel.elf, coz it will copy kernel.o again in kernel build which would be 2nd copy of kernel.o. And since its running in HW so i cant make use of shared lib.
Please help !