[ELDK] string comparison Problem - ELDK version differences

Thirumalai Adhi thirumalai.rtos at gmail.com
Sat Apr 3 11:36:17 CEST 2010

Dear Wolfgang Denk,

              The problem is getting solved by clearing powerpc condition
register once I am returning from strcmp function.

I started to disassemble both u-boot.elf [ELDK4.0 generated and ELDK-4.2
generated] file and compared both strcmp and printf function. There we found
one difference that on printf function of ELDK-4.2 generated elf is having
an extra statement to clear the condition register.

So as a first step we included one clear statement in the code.

Then there was no exception. I don't know exactly what it means.

Kindly let me know the changes.

For your reference,
Sample program:
#include <common.h>
#include <exports.h>
int hello_world (int argc, char *argv[])
        int i;
        /* Print the ABI version */
        printf ("Example expects ABI version %d\n", XF_VERSION);
        printf ("Actual U-Boot ABI version %d\n", (int)get_version());
        printf ("Hello World\n");
        /*added for Testing */
                printf("Both strings are same");
        printf ("argc = %d\n", argc);
        for (i=0; i<=argc; ++i) {
                printf ("argv[%d] = \"%s\"\n",
                        argv[i] ? argv[i] : "<NULL>");
        printf ("Hit any key to exit ... ");
        while (!tstc())
        /* consume input */
        (void) getc();
        printf ("\n\n");
        return (0);

DP-0405> tftp 0x40000 hello_world.bin
Using i82559#0 device
TFTP from server; our IP address is
Filename 'hello_world.bin'.
Load address: 0x40000
Loading: #####
Bytes transferred = 66532 (103e4 hex)
DP-0405> go 0x40004
## Starting application at 0x00040004 ...
Example expects ABI version 9
Actual U-Boot ABI version 9
Hello World
Bad trap at PC: ff70198, SR: 8000, vector=800
NIP: 0FF70198 XER: 20000000 LR: 0004007C REGS: 0fd3d778 TRAP: 0800 DAR:
MSR: 00008000 EE: 1 PR: 0 FP: 0 ME: 0 IR/DR: 00
GPR00: 00040354 0FD3D868 00FD7F80 0FD3D8E4 00040354 0FD3D8D8 00000000
GPR08: FFFFFFFC 00000020 00000000 0FF70154 90000000 40000000 0FFA3000
GPR16: 0FF90620 00000000 00000000 00000000 00000000 00000000 00000000
GPR24: 00000000 0FD422B0 00000000 00000000 0FD42364 00000001 000583B4
Call backtrace:
Exception in kernel pc ff70198 signal 0


On Thu, Apr 1, 2010 at 1:57 AM, Wolfgang Denk <wd at denx.de> wrote:

> Dear Thirumalai Adhi,
> In message <t2wae0f6fbd1003311044x36a87314s70bfbb456cb3c7c7 at mail.gmail.com>
> you wrote:
> >
> >    I am using u-boot-1.3.4 on my MPC7410 based target. I am facing one
> > problem on using different ELDK version. On my custom application i just
> > want compare two strings, based upon that i need to print some string.
> First I want to point out that U-Boot 1.3.4 is very old; I strongly
> recommend you to update your code and use a recent version instead.
> > The problem is when i print the string directly using printf statement
> the
> > processor is raising FPU unavailable exception. But the same thing is
> > working fine with puts function.
> >
> > Another observation is So when i use ELDK-4.2 there is not problem for me
> > but in case of using
> >
> > ELDK-4.0 FPU unavailable exception is coming.
> We never have seen any such problems in any project. I think ther
> emust be some problem with your code. Can you try and prepare a small
> example (say, 10...15 lines of C code) that shows the behaviour you
> claim here?
> Best regards,
> Wolfgang Denk
> --
> DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
> How long does it take a  DEC  field  service  engineer  to  change  a
> lightbulb?       It depends on how many bad ones he brought with him.

More information about the eldk mailing list