gnupic: Re: [gnupic] "pagesel $" dup error


Previous by date: 15 Dec 2006 19:51:55 +0000 Re: [gnupic] Debian templates for dsPIC build toolchain 2.05, Xiaofan Chen
Next by date: 15 Dec 2006 19:51:55 +0000 using Byron Jeff's TLVProgrammer, Maxim Wexler
Previous in thread: 15 Dec 2006 19:51:55 +0000 Re: [gnupic] "pagesel $" dup error, David Barnett
Next in thread: 15 Dec 2006 19:51:55 +0000 Re: [gnupic] "pagesel $" dup error, Scott Dattalo

Subject: Re: [gnupic] "pagesel $" dup error
From: "David Barnett" ####@####.####
Date: 15 Dec 2006 19:51:55 +0000
Message-Id: <01c801c72082$63e15ea0$0401a8c0@barnett2>

----- Original Message ----- 
From: "David Barnett" ####@####.####
To: ####@####.####
Sent: Friday, November 17, 2006 9:48 AM
Subject: Re: [gnupic] "pagesel $" dup error


> ----- Original Message ----- 
> From: "David Barnett" ####@####.####
> To: ####@####.####
> Sent: Wednesday, November 15, 2006 11:40 AM
> Subject: [gnupic] "pagesel $" dup error
>
>
>> I got a "duplicate label (_$_000088)" message from gpasm on a "pagesel $"
>> instruction.  I commented it out and it works fine.  It even works when
>> assembling for a different PIC (16F73 instead of 16F876A).  The code in
>> question goes through several levels of include/macro-type indirection.
>>
>> Can anyone shed some light on this error?
>
> I found the problem.  It's a bug in gpasm.  I attached a simple asm file
> that exploits the bug.
>
> The code is relocatable.  gpasm generates the relocatable symbol for '$' 
> as
> ('_$_' + line offset).  There was a coincidence here that two code 
> sections
> referred to '$' at the same offset and created a duplicate label.  To fix
> this, we could add the code section name into the label or add in some 
> kind
> of global counter.

Scott,

MPASM uses the name of the code section in the relocatable label.  It 
generated '_sec1_0000' and '_sec2_0000' for the problem code I attached 
previously.  I patched gpasm to do exactly that (except gpasm still uses 6 
digits instead of 4).  I tested it and it seems to work great, so here's the 
patch.

BTW, I'd forgotten how much of a pain CVS is to work with...

David 

[Content type application/octet-stream not shown. Download]

Previous by date: 15 Dec 2006 19:51:55 +0000 Re: [gnupic] Debian templates for dsPIC build toolchain 2.05, Xiaofan Chen
Next by date: 15 Dec 2006 19:51:55 +0000 using Byron Jeff's TLVProgrammer, Maxim Wexler
Previous in thread: 15 Dec 2006 19:51:55 +0000 Re: [gnupic] "pagesel $" dup error, David Barnett
Next in thread: 15 Dec 2006 19:51:55 +0000 Re: [gnupic] "pagesel $" dup error, Scott Dattalo


Powered by ezmlm-browse 0.20.