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

"Illegal instruction" for most trivial of programs

I'm running kernel 2.6.10 on a Coldfire (5484) that I ported from a
Freescale BSP for this family of processors.

Everything seems to work OK but I keep getting the message "Illegal
instruction" after the execution of any program I run. For example:

include <stdio.h>

int main ()
    struct S1D_REGS
        unsigned char INDEX;
        unsigned long VALUE;
    } aS1d_reg;

    printf ("sizeof(aS1d_reg): %d bits\n", sizeof(aS1d_reg)*8);
    printf ("sizeof(unsigned long): %d bits\n", sizeof(unsigned
    printf ("sizeof(unsigned char): %d bits\n", sizeof(unsigned


sizeof(aS1d_reg): 48 bits
sizeof(unsigned long): 32 bits
sizeof(unsigned char): 8 bits
Illegal instruction

The program obviously runs and the instructions seem valid but upon
finishing I always get the very disturbing "Illegal instruction"
message!! I know that typically means your into invalid memory space
but why does it run at all if that's the case. It should stop
executing. Is this a bad memory configuration?

Any ideas or suggestions greatly appreciated.

Reply to: