SDCC link error

Friends,

I'm running sdcc for 8051 in small mode. When compiling the file, I'm getting the following error:

?ASlink-Error-Could not get 10 consecutive bytes in internal RAM for area OSEG.

The memory map is as follows:

0 1 2 3 4 5 6 7 8 9 A B C D E F 0x00:|0|0|0|0|0|0|0|0|a|a|a|a|a|a|a|a| 0x10:|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a| 0x20:|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a| 0x30:|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a| 0x40:|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a| 0x50:|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a| 0x60:|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a| 0x70:|a|a|a|a|a|a|a|a|a|a|a|a|Q|S|S|S| 0x80:|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S| 0x90:|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S| 0xa0:|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S| 0xb0:|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S| 0xc0:|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S| 0xd0:|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S| 0xe0:|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S| 0xf0:|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S|

I can work around this problem by declaring a variable (on heap) and at a certain place in the code add the following line:

linker_bug_workaround = !!linker_bug_workaround;

In this scenario the memory map looks as follows:

0 1 2 3 4 5 6 7 8 9 A B C D E F 0x00:|0|0|0|0|0|0|0|0|a|a|a|a|a|a|a|a| 0x10:|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a| 0x20:|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a| 0x30:|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a| 0x40:|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a| 0x50:|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a| 0x60:|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a| 0x70:|a|a|a|a|a|a|Q|Q|Q|Q|Q|Q|Q|Q|Q|Q| 0x80:|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S| 0x90:|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S| 0xa0:|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S| 0xb0:|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S| 0xc0:|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S| 0xd0:|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S| 0xe0:|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S| 0xf0:|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S|

It doesn't look like it is running out of memory. Any idea what might cause such behavior?

Thanks, Runnin

Reply to
runin225
Loading thread data ...

Take a look at the suggestions in the thread at

Where did this (very strange) idea come from? Magic tricks to get code to apparently work aren't particularly robust.

--
Rich Webb     Norfolk, VA
Reply to
Rich Webb

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.