All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <dan@debian.org>
To: vamsi krishna <vamsi.krishnak@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Program to convert core file to executable.
Date: Wed, 24 May 2006 13:38:22 -0400	[thread overview]
Message-ID: <20060524173821.GA1292@nevyn.them.org> (raw)
In-Reply-To: <3faf05680605241018q302d5c0em6844765f81669498@mail.gmail.com>

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

  parent reply	other threads:[~2006-05-24 17:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-24 17:18 Program to convert core file to executable vamsi krishna
2006-05-24 17:25 ` vamsi krishna
2006-05-24 17:38 ` Daniel Jacobowitz [this message]
2006-05-24 20:06   ` vamsi krishna
2006-05-24 20:08     ` Daniel Jacobowitz
2006-05-24 20:19       ` vamsi krishna
2006-05-24 20:25         ` Daniel Jacobowitz
2006-05-24 20:31     ` H. Peter Anvin
2006-05-24 20:52     ` Eric Piel
2006-05-24 21:33     ` Greg KH
2006-05-25 11:04 ` Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060524173821.GA1292@nevyn.them.org \
    --to=dan@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vamsi.krishnak@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.