Skip to contentSkip to conversation

uclibc is faulty for big endian cpu's..?

DISCUSSION atul srivastava 1 participant 1 message Oct 31, 2002 MIPS

lore
Share & tools
lore
#0 lore raw

I was trying a ramdisk with busybox compiled with uclibc(big emndian) for big endian mips IDT board. but while exec'ing it fails in identifying the ELF HEADER of binaries , though it reads correctly ELFMAG field. in fs/binfmt_elf.c
if (memcmp(elf_ex.e_ident, ELFMAG, SELFMAG) != 0)

                goto out;

/****above passes but these following tests fails*****/

        if (elf_ex.e_type != ET_EXEC && elf_ex.e_type != 
ET_DYN)
          goto out;

        if (!elf_check_arch(&elf_ex))
            goto out;

ET_EXEC is 0x2 and EM_MIPS is 0x8 respectively.
on target it reads e_type as 0x200 and e_machine as 0x800
now on my host after mount -o loop the ramdisk and taking hexdump of binary give me

# hexdump ./sh | more

0000000 457f 464c 0201 0001 0000 0000 0000 0000
0000010 0200 0800 0000 0100 4000 b000 0000 3400

here in second line the et_type and e_machine field of elf header is stored in little endian order.

for more clarity # hexdump -c ./sh gives

0000000 177   E   L   F 001 002 001  \0  \0  \0  \0  \0  \0  \0  \0  \0
0000010  \0 002  \0  \b  \0  \0  \0 001  \0   @  \0   °  \0  \0  \0   4

am i thinking in right direction that my uclibc is not generating correct binaries for big endian mips? should i give a try with another lib package?

Best Rergards,
Atul....
__________________________________________________________
Give your Company an email address like
ravi @ ravi-exports.com. Sign up for Rediffmail Pro today! Know more. http://www.rediffmailpro.com/signup/