Re: Program to convert core file to executable.

From: Daniel Jacobowitz
Date: Wed May 24 2006 - 13:37:39 EST


On Wed, May 24, 2006 at 10:48:31PM +0530, vamsi krishna wrote:
> Hello All,
>
> o I have written the following program to convert a core file to a
> executable, and tried to execute the converted executable but my
> system __HANGED__, The kernel did'nt give any messages the complete
> system was stuck.
>
> o Theoretically , the OS loader should jump into the virtual address
> specified at 'ELF_HDR.e_entry and start executing instructions from
> that point if the ELF_TYPE is ET_EXEC.
>
> o So I wrote a program which
> changes ELF_TYPE form ET_CORE to ET_EXEC and modifies e_entry to
> virtual address of the 'main' symbol, since the core file has valid offset
> to access the PHDRS, and for ET_EXEC the elf loader just need to map
> the PHDRS at the vaddr specified and start jump to e_entry.

Look at the program headers. Many of them probably have a file size of
zero. The code segments from the executable and shared libraries
aren't present in the core file.

Of course, the kernel shouldn't crash! It sounds like a bug.

--
Daniel Jacobowitz
CodeSourcery
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/