This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi, I'm not very familiar with compiler level detail. I used to use COFF format and using the tools from sprab60 (I modified it and run under Linux, Loader is the same as in page 21).
I'm developing on OMAP3530, and ARM core is responsible for setting up memory for DSP (put binary data to the correct location in memory). It works totally fine.
However, when I switched to ELF, I used almost same Linker cmd file,
-c -a -heap 0x2000 -stack 0x2000 MEMORY { RAM: o = 0x8E000000 l = 0x02000000 /* Currently use RAM */ } SECTIONS { boot > RAM { -l rts64plus_elf.lib<boot.obj>(.text) } .text : palign(1024) > RAM .stack : palign(4) > RAM .bss : palign(4) > RAM .cio : palign(4) > RAM .const : palign(4) > RAM .data : palign(4) > RAM .sysmem : palign(4) > RAM .far : palign(4) > RAM .args : palign(4) > RAM .ppinfo : palign(4) > RAM .ppdata : palign(4) > RAM /* TI-ABI sections */ .pinit : palign(4) > RAM .cinit : palign(4) > RAM /* EABI sections */ .binit : palign(4) > RAM .init_array: palign(4) > RAM .neardata : palign(4) > RAM .fardata : palign(4) > RAM .rodata : palign(4) > RAM .c6xabi.exidx : palign(4) > RAM .c6xabi.extab : palign(4) > RAM }
and hex6x with the following setting
-boot -m3 --map=hello_world_hex.map --memwidth 32 --romwidth 32 -e=_c_int00
I wrote a simple program to extract out the boot table (according to spru186w 11.10.2)and tried to use my old loader program (there was a run address in the older boot table, I removed it), but it doesn't work. I don't have a debugger...so I have no idea what happens.
1.entry point I believe is correctly set to _c_int00
2.I also tried -b option, it doesn't work.
2. My test program is attached:
REG(0x00F04000) = 0xABABCDCD; REG(L2RAM_TEST_LOC)= 0xCAFEF00D; while(1);
(the variable was define in an .h file)
Could anyone give me some instruction? Thanks a lot.
I'd like to point you to some example of starting up the C64+ on a OMAP3530 when the C64+ code is built with ELF. But I'm afraid there is no such example, and even if there is, it would be difficult to find. I'm willing to look for it for you. But, first, I have to ask: Why not just stay with COFF? Why are you using ELF?
Thanks and regards,
-George
Hi George,
Thanks for your reply.
I'm trying to generate position independent code, The whole program uses PC-relative address not a fixed address in memory. I'm not sure if compiler can do that. And I have not yet figure out how to load it either....
The reason I want position independent code is for a multitasking minimum DSP kernel (a kernel project for fun...so not using TI's rtos ) , so I don't have to specify a different Linker cmd file for each program (eh..not using virtual memory...manually manage the memory for DSP....)
Please point out if I am thinking totally wrong...
Thanks.
Hi George,
Would you also point me to some documentation that explains what is involved in
boot > RAM { -l rts64plus_elf.lib<boot.obj>(.text) }
What boot.obj does? I think my problem might due to my limited knowledge about compiler and run time environment.
Thanks,
Airie Zhou said:I'm trying to generate position independent code, The whole program uses PC-relative address not a fixed address in memory. I'm not sure if compiler can do that.
The compiler has a --pic option. But it is intended to build code for a dynamic shared library. Please see this wiki article.
I've searched a bit for an example of starting up the code on a C64+ core of an OMAP3530 when the C64+ code is built for ELF. So far no luck. I'm increasingly convinced no one at TI has done this before.
Airie Zhou said:Please point out if I am thinking totally wrong...
You're thinking seems reasonable. But I doubt the --pic option does what you need.
Thanks and regards,
-George
Airie Zhou said:What boot.obj does?
Boot.obj contains the system startup code. It is common to customize it to your system. In the latest compiler releases you can find it in the directory install_root\lib\src\boot.c.
Thanks and regards,
-George
Thank you very much for this information. I'll go through it.
I might stay with COFF if there is no one in TI ever does that....