mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier.adi@gmail.com>
To: Pavel Machek <pavel@ucw.cz>
Cc: David Howells <dhowells@redhat.com>,
	rgetz@blackfin.uclinux.org, lethal@linux-sh.org,
	gerg@uclinux.org, uclinux-dist-devel@blackfin.uclinux.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] FDPIC: Ignore the loader's PT_GNU_STACK when calculating  the stack size
Date: Tue, 14 Jul 2009 08:15:03 -0400	[thread overview]
Message-ID: <8bd0f97a0907140515t2bc47674qac75ba93f8c9fdae@mail.gmail.com> (raw)
In-Reply-To: <20090711213018.GA1425@ucw.cz>

On Sat, Jul 11, 2009 at 17:30, Pavel Machek wrote:
> On Thu 2009-07-09 11:59:11, David Howells wrote:
>> Pavel Machek wrote:
>> > > i really dont think this is realistic.  there is exactly one ldso that
>> > > everyone uses under FDPIC ELF, and it needs a very minuscule stack.
>> >
>> > Not very realistic; but that argues that the patch is NOP.
>> >
>> > And if it _is_ realistic, the patch adds a bug.
>>
>> No, it doesn't.  The problem is that the loader, when it is linked, is given a
>> sillyly large default stack size, and this causes the application to be given a
>> much larger stack than is strictly necessary - a stack that is drawn from a
>> limited pool of non-pageable RAM and that must be allocated as a contiguous
>> lump.
>
> Fix the loader to only request as big stack as it needs?

and what if the loader needs a larger stack when run as an application
?  you could make the same exact argument for every library that an
application has a DT_NEEDED tag for, or that it dlopen()'s.  but for
the same reasons, it doesnt fly.

the only stack that should be checked is what the application itself
says it needs.  the ldso has no way of knowing what functions exactly
the application in question will be using (whether in the ldso itself
or in any library), thus only the application itself knows what the
stack usage will look like.
-mike

  reply	other threads:[~2009-07-14 12:15 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-01 12:08 David Howells
2009-07-01 16:02 ` Mike Frysinger
2009-07-01 16:48 ` [PATCH] FDPIC: Ignore the loader's PT_GNU_STACK when calculating the stack size [ver #2] David Howells
2009-07-01 16:49 ` [PATCH] FDPIC: Ignore the loader's PT_GNU_STACK when calculating the stack size David Howells
2009-07-01 16:49 ` [PATCH] FDPIC: Ignore the loader's PT_GNU_STACK when calculating the stack size [ver #2] David Howells
2009-07-02 17:21 ` [PATCH] FDPIC: Ignore the loader's PT_GNU_STACK when calculating the stack size Paul Mundt
2009-07-04  2:46 ` Pavel Machek
2009-07-08 11:01 ` David Howells
2009-07-04  3:34   ` Pavel Machek
2009-07-08 18:48     ` Mike Frysinger
2009-07-09 10:19       ` Pavel Machek
2009-07-09 10:59       ` David Howells
2009-07-11 21:30         ` Pavel Machek
2009-07-14 12:15           ` Mike Frysinger [this message]
2009-07-18 10:39             ` Pavel Machek
2009-07-18 19:11               ` Mike Frysinger

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=8bd0f97a0907140515t2bc47674qac75ba93f8c9fdae@mail.gmail.com \
    --to=vapier.adi@gmail.com \
    --cc=dhowells@redhat.com \
    --cc=gerg@uclinux.org \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=rgetz@blackfin.uclinux.org \
    --cc=uclinux-dist-devel@blackfin.uclinux.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®