[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4b6fba110809282318p3d2f6a6dp5529958b94afa7b@mail.gmail.com>
Date: Mon, 29 Sep 2008 02:18:00 -0400
From: "Daniel Rosenthal" <danielrosenthal@....org>
To: "Jeff Dike" <jdike@...toit.com>
Cc: LKML <linux-kernel@...r.kernel.org>
Subject: Re: linux object file containing all kernel symbols and suitable for userspace linking?
> 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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists