[<<] [<] Page 1 of 1 [>] [>>] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject:
Re: [gnupic] "pagesel $" dup error
From: "David Barnett" ####@####.#### Date: 17 Nov 2006 15:52:07 +0000 Message-Id: <094301c70a5f$e8210f00$0401a8c0@barnett2> ----- 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. Any suggestions? David [Content type application/octet-stream not shown. Download] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject:
Re: [gnupic] "pagesel $" dup error
From: "Scott Dattalo" ####@####.#### Date: 16 Dec 2006 18:48:15 +0000 Message-Id: <64050.71.139.5.51.1166294834.squirrel@ruckus.brouhaha.com> On Fri, 2006-12-15 at 13:51 -0600, David Barnett wrote: > 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. Applied. Thanks David. I tried the test suite and all tests continue to pass. (I wonder if we should add your example to the suite?). Scott | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[<<] [<] Page 1 of 1 [>] [>>] |