Tool/software: TI C/C++ Compiler
I am trying to separate a library's bindings at linker time to have a weak bond between the application and the library.
I have a function in the library called "GoMain". If I call it, then the library is brought into the final binary, and it works...but the link feels strong between them in that if GoMain moves around, the application will have to know where it is.
So, 1) GNU _attributes("section...") would work to put "GoMain" at a fixed location (let's say 0x80_0000, SRAM for C64+x).
2) a function pointer could be implemented, such as
void* MyFunc = (void*) 0x800000;
MyFunc(); // does not need to know GoMain's address, just calls the function at 0x80000.
Is this possible to do while ensuring GoMain's library is built into the final out file, but removing the direct call to "GoMain()"?
If not, is dynamic linking the answer? (I have follow on questions on how this would work that I'm not sure answers)
Thanks,
Will
C6457
CCS 5.1.0900
CGT 7.3.23