From: SourceForge.net <no...@so...> - 2004-01-10 21:41:49
|
Feature Requests item #872250, was opened at 2004-01-07 10:59 Message generated for change (Comment added) made by borutr You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=350599&aid=872250&group_id=599 Category: None Group: None Status: Open Priority: 5 Submitted By: ganesh meenu (ganeshaadityan) Assigned to: Nobody/Anonymous (nobody) Summary: order of library search Initial Comment: A change in the order in which the folders are searched for *.lib files is required. First the folders specified in the command line via -L option should be searched before attempting to search the sdcclib. This change will enable the end users to modify/rewrite the functions which are there in the standard library. Thanks in advance ganesh ---------------------------------------------------------------------- >Comment By: Borut Razem (borutr) Date: 2004-01-10 22:41 Message: Logged In: YES user_id=568035 OK, now I see: the problem is not with -k lines, but with -l lines in .lnk file: libsdcc.lib is scanned before utils.lib. Can you provide the command line of sdcc invocation? Did you try with the lates sdcc snapshot? Sorry for so many questions, Borut ---------------------------------------------------------------------- Comment By: ganesh meenu (ganeshaadityan) Date: 2004-01-09 13:10 Message: Logged In: YES user_id=945594 I rewrote the strcpy function to add 0x200 to the bytes as they are copied. I named the function as strcpy and the file containing this function as strcpy.c. I placed this file in a folder called lib in my working folder. I compiled this file with sdcc -c strcpy.c and it compiled OK creating the strcpy.rel file. I added an entry strcpy in my already existing utils.lib file. Now I created TEST_LIB.c file which has the main() function. In this, I created a string ucase[] = "ABCDEFGHIJKLMNOP". I copied this to another string lcase [17] using strcpy(lcase, ucase); I displayed both the strings in the 2x16 LCD connected to my kit. I expect to see ABCDEFGHIJKLMNOP & abcdefghijklmnop, but I see uppercase in both the lines. (I get expected result if I rename my function to zstrcpy and call zstrcpy in the main. ) The following are the extracts from the .map and .lnk files: Extract from TEST_LIB.map -----------------8><--------------------------------------------- ------- Libraries Linked [ object file ] lib/LCD.lib [ lcd_pos ] D:\SDCC_235_20030610\bin\..\lib\small/libsdcc.lib [ _strcpy ] lib/LCD.lib [ lcd_string ] D:\SDCC_235_20030610\bin\..\lib\small/libsdcc.lib [ _startup ] D:\SDCC_235_20030610\bin\..\lib\small/libsdcc.lib [ _gptrput ] D:\SDCC_235_20030610\bin\..\lib\small/libsdcc.lib [ _bp ] D:\SDCC_235_20030610\bin\..\lib\small/libsdcc.lib [ _gptrget ] lib/utils.lib [ delay1ms ] -----------------8><--------------------------------------------- ------- Extract from TEST_LIB.lnk -----------------8><--------------------------------------------- ------- -k lib -k D:\SDCC_235_20030610\bin\..\lib\small -l libsdcc -l libint -l liblong -l libfloat -l utils.lib -l LCD.lib -l i2c.lib -l Serial.lib -l SerialStack.lib -l MDBStack.lib TEST_LIB.rel -e -----------------8><--------------------------------------------- ------- I feel even though the folders are searched in the required order (myfolder followed by sdccfolder) the lib files are taken the otherway around (sdcclib followed by mylib). As I had mentioned earlier, having mylib searched first will help the user to rewrite the some lib functions to suit his requirement. Regards Ganesh ---------------------------------------------------------------------- Comment By: Borut Razem (borutr) Date: 2004-01-07 14:52 Message: Logged In: YES user_id=568035 Did you try with a newer SDCC version? Can you attach an short example, comman line and the produced .lkr file? I took a look to the code, and it seems OK: -k entries for -L paths are (or at least should be :-) before system library path entries. If the .lkr file is OK, then this is probably a linker problem... Borut ---------------------------------------------------------------------- Comment By: ganesh meenu (ganeshaadityan) Date: 2004-01-07 14:31 Message: Logged In: YES user_id=945594 I use sdcc 2.3.5 (June 10 2003) (MINGW32) on Win2K box. My target device is mcs51. Sorry about not giving this info in first place Regards Ganesh ---------------------------------------------------------------------- Comment By: Borut Razem (borutr) Date: 2004-01-07 13:35 Message: Logged In: YES user_id=568035 Please be more specific about the target and SDDC version, vhere you found the problem. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=350599&aid=872250&group_id=599 |