Tool/software: TI C/C++ Compiler
Hi there,
I have the requirement to be able to place the program's entry point (the function pointer that gets reflected by the address stored in section .reset) at a pre-determined address.
To my understanding the linker does this without instruction currently and links _c_int00_noargs_noexit at some stage but it is not deterministic. Instead, I can see that main always gets placed deterministically at my .text section's beginning but I have been able to mess this up deliberately by changing the link priority.
I want to write a script that changes the output binary to have a custom entry point in a specific page and I can do this with my deterministic page code and placing the entry point (0xA000) in 0xFFFE (.reset), but to call _c_int00_noargs_noexit afterwards is not possible because its location cannot be known, and if the program that exists in A400 through FFFF changes, the code in the 0xA000 page can no longer call it.
I plan to have a bootloader of-sorts in this page, that determines whether or not the code in 0xA400-0xFFFF matches a CRC, and if it does, it will call its _c_int00_noargs_noexit, otherwise it copies the image from 0x4400-0x9FFF into 0xA400-0xFFFF and then calls the respective _c_int00_noargs_noexit that has to be in the same location.
I think so far, the only option I see is to modify boot and possibly boot_special sources/headers to have the correct pragmas.
Is there a better way?
Edit:
I read in another thread I might just be able to add .text:_c_int00_noargs_noexit : {} > 0xA000 in my linker script, is that a solution?