Hi Borut,

On Sun, 13 Jan 2013 21:34:45 +0100, Borut Ražem <borut.ra...@gmail.com>  
wrote:

> On 13. 01. 2013 19:26, Molnár Károly wrote:
>> On Sun, 13 Jan 2013 17:37:00 +0100
>> Raphael Neider <rnei...@web.de> wrote:
>>
>>> We end up with ADRESL and ADRESw
>>> occupying 0xFC3 as well as ADRSH and ADRESw occupying 0xFC4. *Should*
>>> the linker allow this?!?
>>>
>> But, unfortunately, I has just discovered that the gplink produce  
>> errors. :-((
>
> What kind of errors? Aren't sfr definitions just mapped to EQUs in asm?
> Can you please provide a short example so that I can analyze it from the
> gplink perspective?

sfr definitions are turned into udata / udata_ovr sections (see below) in  
order to properly allocate the memory for/to the register.

neider@neider-virtual:/media/daten/neider/test/sfr16$ cat main.c
__at(0x40) unsigned foo;
__at(0x41) __sfr bar;

void main () {}
neider@neider-virtual:/media/daten/neider/test/sfr16$  
../../sdcc.svn/build/bin/sdcc -mpic14 -p16f877a main.c --use-non-free
message: using default linker script  
"/home/neider/local.svn/share/gputils/lkr/16f877a_g.lkr"
error: multiple sections using address 0x41

main.asm contains:
UD_abs_main_40  udata_ovr       0x0040
_foo
        res     2
UD_abs_main_41  udata_ovr       0x0041
_bar
        res     1


 From my point of view, this is exactly the right thing to do for the  
linker. If we want the overlap, we should use a union. Otherwise, the  
linker should ensure that apparently separate data objects are in fact  
separate, i.e., they reside in disjoint memory regions.

Kind regards
Raphael

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_123012
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to