mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Daniel Rosenthal" <danielrosenthal@acm.org>
To: "Jeff Dike" <jdike@addtoit.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: linux object file containing all kernel symbols and suitable for userspace linking?
Date: Mon, 29 Sep 2008 02:18:00 -0400	[thread overview]
Message-ID: <4b6fba110809282318p3d2f6a6dp5529958b94afa7b@mail.gmail.com> (raw)
In-Reply-To: <20080928140633.GA4956@c2.user-mode-linux.org>

> These are provided by the linker script.

Ok, I took a look at both vmlinux_32.lds.S and uml.lds.S (I'm assuming
these are the linker scripts).  I also took a look at vmlinux.  I
didn't realize at first that vmlinux actually has some symbols in it.
I linked vmlinux to my programs using gcc and it compiled, but I got a
segmentation fault when I ran it.  What is the appropriate binary
format to use to output the kernel binary so it won't segfault in
userspace?  Ideally, I would like to add another target, say
vmlinux-user, that would output the kernel with all the same symbols
that vmlinux contains, but with a binary format suitable for userspace
linkage.  It looks from uml.lds.S that you don't use the default ELF
output format for UML.  Why is this?

I guess I probably need to write another architecture specific *.lds.S
file called something like vmlinux-user.lds.S and add a few lines to
the Makefile in the root directory to achieve what I am trying to do,
but I would like to find as general a solution as I can so that maybe
other architectures and other people can use the same solution for
doing kernel code unit tests without replicating a lot of code.

By the way, I noticed that you only have a single uml.lds.S file, and
consequently UML probably either only works on x86 (and x86-64), or
uses the same binary layout on all platforms.  I couldn't find
anywhere explicitly where you say UML only runs on x86, but just to
clarify, UML is x86 specific, right?

Daniel


> Work email - jdike at linux dot intel dot com

Sorry, I misread the {addtoit,linux.intel} as {addtoit,linux,intel} in
arch/um/Makefile.

      reply	other threads:[~2008-09-29  6:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-28  2:57 Daniel Rosenthal
2008-09-28  3:13 ` Grant Coady
2008-09-28  7:22   ` Daniel Rosenthal
2008-09-28 14:06     ` Jeff Dike
2008-09-29  6:18       ` Daniel Rosenthal [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=4b6fba110809282318p3d2f6a6dp5529958b94afa7b@mail.gmail.com \
    --to=danielrosenthal@acm.org \
    --cc=jdike@addtoit.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®