Subject: ELF loader question
To: None <tech-kern@netbsd.org>
From: Kyle Unice <kyle@midnighttech.com>
List: tech-kern
Date: 04/08/2003 21:41:03
This is a multi-part message in MIME format.

------=_NextPart_000_00E5_01C2FE17.8D96AC00
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

I built a cross compiler and linker for xscale ELF.  I built the NetBSD
source and linked the NetBSD 1.6 /sbin/init and /usr/libexec/ld.elf_so
with the cross compiler.  The problem is that in when the OS is booting
and check_exec() is called, the structure member epp->ep_entry is never
set,  so the sanity check at line 290 of kern_exec.c.  

 

                        if (epp->ep_entry > VM_MAXUSER_ADDRESS)

                                    error = ENOEXEC;

 

fails and ENOEXEC is returned.  It is a shared library link of
/sbin/init.  Not sure how this is supposed to work any help is
appreciated.

 

Kyle


------=_NextPart_000_00E5_01C2FE17.8D96AC00
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html>

<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">


<meta name=3DGenerator content=3D"Microsoft Word 10 (filtered)">

<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:"Comic Sans MS";
	panose-1:3 15 7 2 3 3 2 2 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{font-family:"Comic Sans MS";
	color:blue;
	font-weight:normal;
	font-style:normal;
	text-decoration:none none;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
	{page:Section1;}
-->
</style>

</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal><font size=3D2 color=3Dblue face=3D"Comic Sans =
MS"><span
style=3D'font-size:10.0pt;font-family:"Comic Sans MS";color:blue'>I =
built a cross
compiler and linker for xscale ELF.&nbsp; I built the NetBSD source and =
linked
the NetBSD 1.6 /sbin/init and /usr/libexec/ld.elf_so with the cross
compiler.&nbsp; The problem is that in when the OS is booting and =
check_exec()
is called, the structure member epp-&gt;ep_entry is never set,&nbsp; so =
the
sanity check at line 290 of kern_exec.c.&nbsp; </span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dblue face=3D"Comic Sans =
MS"><span
style=3D'font-size:10.0pt;font-family:"Comic Sans =
MS";color:blue'>&nbsp;</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dblue face=3D"Comic Sans =
MS"><span
style=3D'font-size:10.0pt;font-family:"Comic Sans =
MS";color:blue'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp; if
(epp-&gt;ep_entry &gt; VM_MAXUSER_ADDRESS)</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dblue face=3D"Comic Sans =
MS"><span
style=3D'font-size:10.0pt;font-family:"Comic Sans =
MS";color:blue'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp; error
=3D ENOEXEC;</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dblue face=3D"Comic Sans =
MS"><span
style=3D'font-size:10.0pt;font-family:"Comic Sans =
MS";color:blue'>&nbsp;</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dblue face=3D"Comic Sans =
MS"><span
style=3D'font-size:10.0pt;font-family:"Comic Sans MS";color:blue'>fails =
and
ENOEXEC is returned.&nbsp; It is a shared library link of =
/sbin/init.&nbsp; Not
sure how this is supposed to work any help is =
appreciated.</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dblue face=3D"Comic Sans =
MS"><span
style=3D'font-size:10.0pt;font-family:"Comic Sans =
MS";color:blue'>&nbsp;</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dblue face=3D"Comic Sans =
MS"><span
style=3D'font-size:10.0pt;font-family:"Comic Sans =
MS";color:blue'>Kyle</span></font></p>

</div>

</body>

</html>

------=_NextPart_000_00E5_01C2FE17.8D96AC00--