[uClibc]Invalid ELF header

Mark and Janice Juszczec juszczec at hotmail.com
Wed Feb 5 03:25:41 UTC 2003


Hi folks

I'm getting an "Invalid ELF header" when I try to use BusyBox with 
uClibc-0.9.17.

It comes from ldso/ldso/ldso.c

if (!header || header->e_ident[EI_CLASS] != ELFCLASS32 ||
		header->e_ident[EI_VERSION] != EV_CURRENT
#if !defined(__powerpc__) && !defined(__mips__) && !defined(__sh__)
	|| _dl_strncmp((void *) header, ELFMAGIC, SELFMAG) != 0
#else
	        || header->e_ident[EI_MAG0] != ELFMAG0
	        || header->e_ident[EI_MAG1] != ELFMAG1
	        || header->e_ident[EI_MAG2] != ELFMAG2
	        || header->e_ident[EI_MAG3] != ELFMAG3
#endif
		) {
		SEND_STDERR("Invalid ELF header\n");
		_dl_exit(0);
	}


I broke up the if conditions to see which one was failing and it turns out 
to be (drumroll):

if (!header){
   SEND_STDERR("header is 0x00\n");
}

header gets its value from:

header = (elfhdr *) auxvt[AT_BASE].a_un.a_ptr;

What is in auxvt[AT_BASE].a_un.a_ptr?  Is it some number of bytes from the 
beginning of the program I'm trying to execute?  Is it some constant value 
representing what a mipsel-linux elf header looks like?  Is it something 
built in at uClibc compile time?  Is is something else?  Any suggestions 
where to look to correct this?

Mark

_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE*  
http://join.msn.com/?page=features/virus




More information about the uClibc mailing list