- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I met the problem whem linking:
Unable to reach (at 0x0009bf4c) from the global pointer (at 0x000861e0) because the offset (89452) is out of the allowed range, -32678 to 32767. The code was more than 64KB。 How to solve it? A document said that the -G compiler option should be fixed. This option sets the threshold size. But how to make it? Help me. Thanks!Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi Dugufei,
did you try -G0 ? i had this problem with redboot... fixed with this option. found somewhere here in this forum. maybe it works for you, too. regards, martin- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, I've tried from -G0 to -G4. But it didn't work!
The Altera's document didn't say clearly. --- Quote Start --- originally posted by mrwgm@Oct 26 2006, 04:24 AM hi dugufei,
did you try -g0 ?
i had this problem with redboot... fixed with this option. found somewhere here in this forum. maybe it works for you, too.
regards, martin
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=18925)
--- quote end ---
--- Quote End ---
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
you should double check your code, something should be wrong with your source.
you can try get rid of the variable which lead to fail.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Dugufei,
I sometimes get this error when trying to access data in a different section. I have a section of battery-backed SRAM, away from the RAM used for my code and bss. To put something in the NVR I have to use: # define COMM_NVR __attribute__((section(".common_nvr"))) // example of putting variable in NVR. unsigned char fred COMMON_NVR; When I want to access fred from another file I have to: extern unsigned char fred COMMON_NVR; If I forget to add the COMMON_NVR attribute then I get the linker error you describe, 'Can't reach....'. So maybe your unreachable variable isn't where you think it is. Banx.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
But I can run seccussfly the same code in ARM7 platform. So, I think the code is all right.
Now I want to port the code into Nios2. The problem is what is the right -G compiler option。
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page