lkml.org 
[lkml]   [2002]   [Oct]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Loading init and ld.so.1 for Coldfire V4e
On Wed, Oct 09, 2002 at 11:14:07AM -0400, Kent Borg wrote:
> In response to my question about how ld.so.1 is supposed to get an elf
> file up and running Ben Collins and Erik Andersen suggested I write a
> simple statically linked program. Thanks for your help. (My boss had
> suggested the same thing earlier but I didn't listen to him, the
> kernel list I listened to.)
>
> Alas, it doesn't simplify matters. I wrote a tivial program (all it
> does is a link instruction to make an empty stack frame, two moves, an
> unlink to remove the empty stack frame, and a return--only 5
> instructions long) but it is still an elf file. And, following
> through the code, the kernel still wants to load ld.so.1, it seems to
> interpret the elf (Linux can run different kinds of executables,
> remember). And in the process something gets messed up.
>
> So I am back to trying to figure out what is going wrong with loading
> init and ld.so.1. I am suspicious that do_mmap_pgoff() calls are not
> all happening right and will be comparing them with what mappings.
> But I wish I knew more about what ld.so.1 does...

If you compiled it static (e.g. pass -static to gcc), then the
dynamic-linker shouldn't be referenced in the executable. The kernel
doesn't assume that elf requires ld.so.1, that's something that is
placed into the executable itself as the INTERP. If you have an INTERP
section in your test executable, you didn't link it properly. There
should be no references to NEEDED and INTERP when you do:

# coldfirev4e-elf-objdump -x hello | less

--
Debian - http://www.debian.org/
Linux 1394 - http://www.linux1394.org/
Subversion - http://subversion.tigris.org/
Deqo - http://www.deqo.com/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:29    [W:0.264 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site