no way at all ot predict data placements (unless align specified, then you 
have to watch array's bias)

you may avoid this problem using 'char' assigments:

        TxFrame1[offset++] = 0x01;
        TxFrame1[offset] = 0x00;

instead of:

         *(int *)&TxFrame1[offset] = 0x0001;

~d


On Tuesday 05 August 2003 19:02, Akshay wrote:
> Thanks Dmitry,
>
> Is there a way to fix this problem?
>
> Akshay
>
> --__--__--
>
> Message: 6
>  From: Dmitry <di...@mail.ru>
> Organization: EIS
> To: mspgcc-users@lists.sourceforge.net
> Subject: Re: [Mspgcc-users] linker error
> Date: Mon, 4 Aug 2003 23:40:41 +0400
> Reply-To: mspgcc-users@lists.sourceforge.net
>
> This thing is covered in docs (tips & tricks):
> when performing type conversion, you must be sure, that=20
> biased char variable is located at even address.
>
> So, if &TxFrame1[offset] is odd located, you have a problem.
>
> When you comment line 'offset++', you set =20
> &TxFrame1[offset]
> even-located and everything is ok.
>
> ~d
>
> Message: 5
> Date: 4 Aug 2003 19:13:37 -0000
>  From: "Akshay" <aksh...@rediffmail.com>
> To: mspgcc-users@lists.sourceforge.net
> Subject: [Mspgcc-users] linker error
> Reply-To: mspgcc-users@lists.sourceforge.net
>
> Hello All,
>
> I'm getting a linker error when I try to copy strings.
>
> Following is the code snippet:
>
> ===================================================
>    {
>      int offset=DNS_NAME_OFS;
>
>    TxFrame1[offset] = 0x03;
>    offset++;
>
>    strcpy(&TxFrame1[offset], "www");
>    offset += strlen("www");
>
>    TxFrame1[offset] = 0x03;
>    offset++;
>
>    strcpy(&TxFrame1[offset], "msn");
>    offset += strlen("msn");
>
>    TxFrame1[offset] = 0x03;
>    offset++;
>
>    strcpy(&TxFrame1[offset], "com");
>    offset += strlen("com");
>
>    //  TxFrame1[offset] = 0x00;  >> Error occurs when I
> uncomment
>    //  offset++;                 >> these lines
>
>    *(unsigned int *)&TxFrame1[offset] = 0x0001;
>    offset += 2;
>
>    *(unsigned int *)&TxFrame1[offset] = 0x0001;
>
>    }
> ===================================================
>
> Here's the error:
>
> ===================================================
> msp430-gcc.exe cs8900.c tcpip.c main.c -mmcu=msp430x149 -o
> ourserver.exe -g -lc -lgcc
> msp430-gcc.exe cs8900.c tcpip.c main.c -mmcu=msp430x149 -g -O -o
> ourserver.elf
> /cygdrive/c/DOCUME~1/ASAXEN~1.CS-/LOCALS~1/Temp/ccyj0kYi.o(.text+0x188c):
> In function `PrepareUDP_DATA_FRAME':
> /cygdrive/c/Documents and
> Settings/asaxena.CS-UML/iCricket/NW_Stack/tcpip.c:1034: internal
> error: unsupported relocation error
> /cygdrive/c/DOCUME~1/ASAXEN~1.CS-/LOCALS~1/Temp/ccyj0kYi.o(.text+0x1890):/c
>ygdrive/c/Documents and
> Settings/asaxena.CS-UML/iCricket/NW_Stack/tcpip.c:1037:
> internal error: unsupported relocation error
> msp430-gcc.exe cs8900.c tcpip.c main.c -mmcu=msp430x149 -S
> msp430-objcopy.exe -O ihex ourserver.exe ourserver.d43
> msp430-objcopy.exe -O srec ourserver.exe ourserver.s19
> ===================================================
>
>
> Akshay
> aksh...@rediffmail.com
> aks...@saxena.com
>
> ___________________________________________________
> Download the hottest & happening ringtones here!
> OR SMS: Top tone to 7333
> Click here now:
> http://sms.rediff.com/cgi-bin/ringtone/ringhome.pl
>
>
>
>
> -------------------------------------------------------
> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> Data Reports, E-commerce, Portals, and Forums are available now.
> Download today and enter to win an XBOX or Visual Studio .NET.
> http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
> _______________________________________________
> Mspgcc-users mailing list
> Mspgcc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users

-- 
/*****************************************************************
     ("`-''-/").___..--''"`-._     (\   Dimmy the Wild     UA1ACZ
      `6_ 6  )   `-.  (     ).`-.__.`)  State Polytechnical Univ.
      (_Y_.)'  ._   )  `._ `. ``-..-'   Radio-Physics Departament
    _..`--'_..-_/  /--'_.' ,'           Saint Petersburg,  Russia
   (il),-''  (li),'  ((!.-'             +7 (812) 5403923, 5585314
 *****************************************************************/


Reply via email to