Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Robert L. Millner <rmillner@nrao.edu>
Subject: argv[] to /sbin/loader
Date: Thu, 2 Oct 1997 23:14:48 -0400 (EDT)	[thread overview]
Message-ID: <5e5cb896f9153b070898df77b1464b9b.axp-list@archive.invalid> (raw)

This may be better suited to the kernel list but I thought to ask it
here.  I have a system running:

Kern 2.1.57, libc 2.0.5 and the /sbin/loader from 4.0B (system patch 3,
about to patch up to 4).  When the kernel launches loader, it does so by
(I think) shifting off argv[0], and then unshifting the name of the
loader on to it (see fs/exec.c:search_binary_handler).  When loader gets
its argv, it probably looks something like:

(loader, -n, 1000)

and the exec call is something like (I haven't gone digging enough to
get it directly yet so this is speculation)

loader, a.out, (loader, -n, 1000), (ENV1, ENV2, ...)

loader never bothers to replace argv[0] when it runs the program.  This
is a problem for some code that checks argv[0].  Under D.U., it looks
like exec_with_loader gets called without modifications to argv so that
the call is something like:

loader, a.out, (a.out, -n, 1000), (ENV1, ENV2, ...)

and a.out never knows the difference.  Why do we do it the former and
not the latter way?  I can figure how to change the code myself given
enough time but someone out there who already knows it well can send a
quick change faster.  Thanks.

	Rob

--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

             reply	other threads:[~1997-10-03  3:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-10-03  3:14 Robert L. Millner [this message]
  -- strict thread matches above, loose matches on Subject: below --
1997-10-03 16:10 argv[] to /sbin/loader Robert L. Millner
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox