This is the mail archive of the crossgcc@cygnus.com mailing list for the crossgcc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Newlib 1.8.1 vfprintf problem on embedded PowerPC


Roger Williams wrote:
> 
> Hi --
> 
> While waiting for my s/w guru to develop application code, I'm writing
> hardware debug utilities for my embedded MPC860 hardware.  With the
> help of the CrossGCC FAQ, it was a simple matter to build GCC 2.8.1
> and Newlib 1.8.1 and get a simple "Hello, world" program running.
> 
> Most of the libc functions, including sscanf, etc., work fine.
> However, any call to vfprintf goes off to Never-Never Land, so sprintf
> doesn't work.
> 
> Any ideas about where to start looking?  The printf innards are rather
> hairy...  (Unfortunately, I don't have access to an ICD right now, so
> my job is even tougher.)

Don't sweat it, it's a lot simpler than that... (once you know where to
look of course!)

> Am I right in assuming that printf et al. are working for other
> powerpc-eabi developers?

Printf works fine, but the startup code supplied with newlib (see
libgloss/rs6000/*crt0.S) doesn't clear memory in the 'sbss' section to
all zeros, it only clears the 'bss' section. This is what's sending
printf etc. into the weeds.

Once crt0.S is fixed, your program should run just fine.

Scott Howard
scott@objsw.com
_______________________________________________
New CrossGCC FAQ: http://www.objsw.com/CrossGCC
_______________________________________________
To remove yourself from the crossgcc list, send
mail to crossgcc-request@cygnus.com with the
text 'unsubscribe' (without the quotes) in the
body of the message.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]