Actions

icon Post
text/html Subscribe
text/html Unsubscribe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [coldfire-gnu-discuss] Override printf


  • To: coldfire-gnu-discuss@xxxxxxxxxxxxxxxx
  • Subject: RE: [coldfire-gnu-discuss] Override printf
  • From: Bryan Kattwinkel <bryan@xxxxxxxxxx>
  • Date: Fri, 11 Jul 2008 13:23:44 -0400

-nodefaultlibs works for me.

in my linker script, the entire STARTUP and GROUP lines are commented out, and there are some comments and lines related to "crt" that I don't understand.

in my code, I have:

/* The GNU compiler converts printf of a single char into putchar,
 * and printf of a constant string\n to puts of that string w/o \n.
 * Since we are not using the C lib, provide these substitues.
 */

int putchar( int c )
{
    out_char( c );
    return c;
}

int puts( const char *s )
{
    return printf( "%s\n", s );
}