Altera_Forum
Honored Contributor
19 years agoGCC
Dear gurus,
I have the following problem. I have built a library which is compiled and linked separately from the rest of software. This library is stored in flash memory as a standalone piece of software. Then I have built an application which uses this library by calling its functions at some defined flash addresses. The application has been compiled and linked separately from the library and it resides at different addresses in flash. Both the library and the application use global variables. These variables are allocated at different ram addresses. Since GCC uses global pointer to reference to global variables, when the application calls a library function, that function is not able to reference its globals because the global pointer is assigned to the application's ram area and not to library's ram area. Can you suggest a way to workaround this problem ? (without suggesting to rewrite the compiler ...) Best Regards /Alessandro