From: SourceForge.net <no...@so...> - 2009-10-15 14:54:14
|
Bugs item #2879083, was opened at 2009-10-14 19:45 Message generated for change (Comment added) made by maartenbrock You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=2879083&group_id=599 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. >Category: mcs51(8051) target >Group: fixed >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Kurt Sanger (kurtmsanger) >Assigned to: Maarten Brock (maartenbrock) Summary: ASLink error unassigned global bit variable? Initial Comment: I'm running sdcc V2.9.2 on Windows XP from build sdcc-20090817-5492-setup.exe. When I define a bit variable in a function, compile functions separately, then link together I get a linker warning that the global variable referenced by the module is undefined. ?ASlink-Warning-Undefined Global '_FOO_VARIABLENAME_1_1' referenced by module 'FOO' I have a main application. mainApp.c, along with a subordinate application myFoo.c compiled in DOS using; sdcc -mmcs51 --model-small --iram-size 256 -I C:\SDCC\Include -c mainApp.c sdcc -mmcs51 --model-small --iram-size 256 -I C:\SDCC\Include -c myFoo.c then link using: sdcc -mmcs51 --model-small --iram-size 256 ^ --code-loc 0x0500 --stack-loc 0x0080 --xram-loc 0x3000 ^ -L C:\SDCC\MyCode\EZ-USB_Lib -l EZUSB -I C:\SDCC\Include ^ mainApp.rel myFoo.rel myFoo.rel will contain a function such as: bit myFunction( void) { bit myFlag; myFlag = TRUE; return(myFlag); } unfortunately the above code worked and didn't exhibit the same issue. The main failed though. // Function prototype. bit myFunction( void); void main(void) { bit myFlag; unsigned char tempByte; myFlag = myFunction(); } gives me a linker error ?ASlink-Warning-Undefined Global '_main_myFlag_1_1' referenced by module 'fw' Here my main is in fw.c. I suppose I could stop using bit variables as flags in functions. Or make them all globals. But the sdccman appears to support local bit functions too. I also question if its a bseg size issue? I'm using the Cypress CY7C68013 with 16 8-bit bit addressable registers. Will the linker support that or think that I've only got 16 bits available? That might explain why some of the time it may work depending upon when it assigns the bit address. New info. I don't think its BSEG size related. I had 10 flags defined when the error occurred, now I'm up to 17 and if I create flag variables as global they all work. I think its more related to not assigning local bit variables within functions. Though I did have one show up. Maybe just the first one works and the rest are supposed to overlay it but don't. ---------------------------------------------------------------------- >Comment By: Maarten Brock (maartenbrock) Date: 2009-10-15 16:54 Message: Kurt, I'm sorry. I was misled by my own actions. This bug has already been fixed in the latest snapshot but I too tested with a too old version. Maarten ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=2879083&group_id=599 |