LCDs, strings and linkers (oh my)

Jim Bates jbates2@hrn.ascend.com
Sun Apr 1 00:00:00 GMT 2001


Mark,

Ok, I was lazy yesterday, I found two options:
 Page 235 of "Using and Porting the GNU Collection(GCC)
    Chapter 7, section 7.6
     7.6 Incompatibilities of GCC
       ...
       -traditional   (eliminates some incompatibilities)
       ...
       GCC normally makes string constants read-only...
       ...sscanf does not work on some systems when passed a string
          constant...writes to the string

       -fwritable-strings  tells GCC to handle string constants
          the same way most C compilers do.

-jim


Mark Palmerino wrote:
> 
> Hi all,
> 
> I have received a couple of responses to my questions about my experiences
> with using strings in a program that is running on a robominds board
> (68332).
> 
> I have built an m68k-elf cross-compiler using gcc-2.95.2, binutils-2.9.1 and
> newlib-1.8.2.
> 
> To summarize, my problem seems to revolve around the fact that a program
> bombs if my c-program includes references to strings like:
> 
> strcpy(stringVar, "this is some text");
> lcd_print("this is some text");
> 
> However, the program does not bomb if I do the following:
> 
> 1. Include any reference to 'printf'
> 2. Use the construction 'char const stringVar[] = "this is some text"
> 3. Build up the string in the following fashion:
>    stringVar[0] = 't';
>    stringVar[1] = 'h';
>    stringVar[2] = 'i';
>    and so on.
> 
> The responses suggest that perhaps there is a compiler flag that I could use
> to make sure that strings get put in the right segments or that I may need
> to rebuild the cross-compiler with some different flags.
> 
> I have looked at the man pages for gcc, as and ld and don't see any flags
> that may help (but believe me, I'm not yet adept at understanding some of
> these things).  Any suggestions for specific flags to use?
> 
> Also, if anyone knows of specific cross-compiler building steps that I
> should consider, please let me know.
> 
> Thanks again to everyone!
> 
> ------
> Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
> Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com

-- 
James A Bates Jr.	
jimbo@hrn.ascend.com
703-925-4181

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com



More information about the crossgcc mailing list