From: Alex Pennace <alex@pennace.org>
To: Anumula Venkat <anumulavenkat@yahoo.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: ELF doubt
Date: Fri, 9 Nov 2001 05:39:00 -0500 [thread overview]
Message-ID: <20011109053900.A29926@buick.pennace.org> (raw)
In-Reply-To: <20011109061144.50768.qmail@web12005.mail.yahoo.com>
In-Reply-To: <20011109061144.50768.qmail@web12005.mail.yahoo.com>
On Thu, Nov 08, 2001 at 10:11:22PM -0800, Anumula Venkat wrote:
> Though it may not be question related to this group
> i am asking this question. Kindly clarify me.
>
> I am reading runtime image of kernel module from
> another module. I heard that First 52 bytes will bw
> ELF header. But i got strange values. Can somebody
> clarify my doubt.
My understanding may be flawed.
linux/vmlinux is an ELF file with a full symbol table; nm uses this to
make System.map. linux/vmlinux is made by the linker folliwng the
instructions in a linker file; this linker file tells the linker
"ignore your defaults, the image does not start at absolute virtual
address 0x804800, it starts here." It also tells the linker how to
shuffle about special kernel sections, like .text.init and .data.init.
Now that the code knows where it will be in memory, nm is run to make
System.map. Then the architecture-specific boot stuff takes over. At
some point the equivalent of "objcopy -O binary" is run on
linux/vmlinux. This strips all the ELF stuff out, leaving code that
still expects to be loaded at the address it was destined for. This
ELF-less image is what you are reading in memory.
prev parent reply other threads:[~2001-11-09 10:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-11-09 6:11 Anumula Venkat
2001-11-09 10:39 ` Alex Pennace [this message]
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=20011109053900.A29926@buick.pennace.org \
--to=alex@pennace.org \
--cc=anumulavenkat@yahoo.com \
--cc=linux-kernel@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®