All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <dmj+@andrew.cmu.edu>
To: Alexandre.Nikolaev@matrox.com
Cc: linuxppc-dev@lists.linuxppc.org
Subject: Re: who loads argc in elf binary???????
Date: Wed, 7 Mar 2001 14:10:14 -0500	[thread overview]
Message-ID: <20010307141014.A28040@nevyn.them.org> (raw)
In-Reply-To: <3AA50A43.FA070FDE@matrox.com>; from anikolae@matrox.com on Tue, Mar 06, 2001 at 11:03:15AM -0500


On Tue, Mar 06, 2001 at 11:03:15AM -0500, Alexandre Nikolaev wrote:
>
> Hi!
>
> We are trying montavista kernel .4 on G4. Upon starting of ELF binary,
> the r3, which should contain argc, always reads 0 (for any program). r4
> is ok.
> What could be the problem?
> Who is responsible for loading r3?
>
> I would really appreciate if someone can help!

argc and argv are created by the kernel, based on what is given in
exec().  It has to go through the dynamic loader and any start code
before it gets to main, though.  Are you using any custom crt* code, or
otherwise linking oddly?  If so, look there.

I also seem to recall that the arguments are loaded into registers by
the application, off the stack.  I'm not entirely sure of that, though.

--
Daniel Jacobowitz                           Debian GNU/Linux Developer
Monta Vista Software                              Debian Security Team
                         "I am croutons!"

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

  reply	other threads:[~2001-03-07 19:10 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-06 16:03 who loads argc in elf binary??????? Alexandre Nikolaev
2001-03-07 19:10 ` Daniel Jacobowitz [this message]
2001-03-07 19:15   ` David Edelsohn
  -- strict thread matches above, loose matches on Subject: below --
2001-12-04 16:13 Changes to PPC Linux required for GCC 3.1 Corey Minyard
2001-12-04 16:16 ` David Edelsohn
2001-12-04 16:39   ` Corey Minyard
2001-12-05 12:55 ` Franz Sirl
2001-12-05 16:18   ` Corey Minyard
2001-12-05 17:37     ` Tom Rini
2001-12-05 17:50       ` Benjamin Herrenschmidt
2001-12-05 19:45         ` Tom Rini
2001-12-05 20:30           ` Franz Sirl
2001-12-07 13:01             ` Gabriel Paubert
2001-12-07 20:57               ` AltiVec register ptrace support Kumar Gala
2001-12-07 22:23                 ` Kevin Buettner
2001-12-07 22:34                   ` Daniel Jacobowitz
2001-12-14 18:52                     ` Kumar Gala
2001-12-14 19:16                       ` Jason R Thorpe
2001-12-15  2:08                       ` Andrew Cagney
2001-12-15 17:44                         ` Kumar Gala
2001-12-16 21:11                         ` Paul Mackerras
2002-01-10 18:58                           ` Kumar Gala
2001-12-05 21:59         ` Changes to PPC Linux required for GCC 3.1 Paul Mackerras
2001-12-05 20:17       ` Daniel Jacobowitz
2001-12-05 20:20         ` David Edelsohn
2001-12-05 20:30         ` Franz Sirl
2001-12-06  0:59       ` Corey Minyard
2001-12-06  3:38         ` Tom Rini
2001-12-07  5:22           ` Corey Minyard
2001-12-05 20:51     ` Franz Sirl
2001-12-06  1:41       ` Corey Minyard

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=20010307141014.A28040@nevyn.them.org \
    --to=dmj+@andrew.cmu.edu \
    --cc=Alexandre.Nikolaev@matrox.com \
    --cc=linuxppc-dev@lists.linuxppc.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.