Forum Discussion
Altera_Forum
Honored Contributor
21 years agoI think the problem may be to do with the way you are declaring the C externs which you are using to access the data. Please post the C code you used, particularly if the suggestion below doesn't solve your problem.
I'm guessing your code looks a bit like this:extern char _alt_partition_MEMORY_NAME_start;
printf("%X\n", &_alt_partition_MEMORY_NAME_start); That's declaring a one byte symbol. gcc will assume, because the symbol is small, that it will be in section sdata or sbss and use gp relative addressing to get to it. You need to do something like this: extern char _alt_partition_MEMORY_NAME_start;
printf("%X\n", _alt_partition_MEMORY_NAME_start); This declares a symbol of undefined length. gcc won't make any asusmptions about where it is and will use hi/lo addressing to operate on the symbol. Alternatively, you could use __attribute__ ((section ("section"))) to tell GCC which section the symbol will be in, but this is probably not needed in this case.