All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Collins <bcollins@debian.org>
To: Kent Borg <kentborg@borg.org>
Cc: Erik Andersen <andersen@codepoet.org>, linux-kernel@vger.kernel.org
Subject: Re: Loading init and ld.so.1 for Coldfire V4e
Date: Wed, 9 Oct 2002 11:19:04 -0400	[thread overview]
Message-ID: <20021009151904.GG26771@phunnypharm.org> (raw)
In-Reply-To: <20021009111407.B17419@borg.org>

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/

      reply	other threads:[~2002-10-09 15:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-08 19:54 Loading init and ld.so.1 for Coldfire V4e Kent Borg
2002-10-08 21:40 ` Erik Andersen
2002-10-09 15:14   ` Kent Borg
2002-10-09 15:19     ` Ben Collins [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=20021009151904.GG26771@phunnypharm.org \
    --to=bcollins@debian.org \
    --cc=andersen@codepoet.org \
    --cc=kentborg@borg.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.