From: "Charles A. Clinton" <cac@cac.seattle.wa.us>
To: user-mode-linux-devel@lists.sourceforge.net
Subject: Re: [uml-devel] Segfault on UML load
Date: Thu, 1 Apr 2004 14:16:12 -0800 (PST) [thread overview]
Message-ID: <Pine.LNX.4.58.0404011358130.15283@cac> (raw)
In-Reply-To: <Pine.LNX.4.58.0403311549380.25444@cac>
On Wed, 31 Mar 2004, I wrote:
> When I build a UML kernel on my Fedora Core 1 machine, it segfaults when
> it tries to load.
Blaisorblade pointed me to a 2.6 patch set which provides the answer.
The link.ld script puts an empty 4K page at the front of the UML image.
The Fedora glibc expects the elf program headers to be at the start of the
image and searched them form information regarding stack executability.
The empty page is not mapped, and the search segfaults. I suspect that
there is a bug in binfmt_elf that is not taking into account the load
offset when setting up the aux vector, but the code is so convoluted there
that I am mostly dazed.
Anyway, the following patch (adapted from
http://toast.debian.net/~may/umlproject/unpackaged/align.patch) when
applied on top of uml-patch-2.4.22-1, fixes the problem. It should work
for any of the 2.4.x patches.
Thanks to Blaisorblade for pointing me to the UML for Fedora page.
diff -Naur linux-2.4.22/arch/um/dyn_link.ld.in linux-2.4.22.works/arch/um/dyn_link.ld.in
--- linux-2.4.22/arch/um/dyn_link.ld.in 2004-04-01 11:26:04.000000000 -0800
+++ linux-2.4.22.works/arch/um/dyn_link.ld.in 2004-04-01 11:32:35.000000000 -0800
@@ -8,7 +8,6 @@
{
. = START() + SIZEOF_HEADERS;
.interp : { *(.interp) }
- . = ALIGN(4096);
__binary_start = .;
. = ALIGN(4096); /* Init code and data */
_stext = .;
diff -Naur linux-2.4.22/arch/um/link.ld.in linux-2.4.22.works/arch/um/link.ld.in
--- linux-2.4.22/arch/um/link.ld.in 2004-04-01 11:26:07.000000000 -0800
+++ linux-2.4.22.works/arch/um/link.ld.in 2004-04-01 11:32:19.000000000 -0800
@@ -6,7 +6,6 @@
{
. = START() + SIZEOF_HEADERS;
- . = ALIGN(4096);
__binary_start = .;
ifdef(`MODE_TT', `
.thread_private : {
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
next prev parent reply other threads:[~2004-04-01 22:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-31 23:56 [uml-devel] Segfault on UML load Charles A. Clinton
2004-04-01 18:21 ` BlaisorBlade
2004-04-01 22:16 ` Charles A. Clinton [this message]
2004-04-02 19:50 ` BlaisorBlade
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=Pine.LNX.4.58.0404011358130.15283@cac \
--to=cac@cac.seattle.wa.us \
--cc=user-mode-linux-devel@lists.sourceforge.net \
/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