From: Julian Seward Date: Sun, 23 Feb 2003 03:54:59 +0000 (+0000) Subject: Initial rough hack to spot the stack segment at startup by looking X-Git-Tag: svn/VALGRIND_1_9_4~18 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3276c2b5c752e01908bc8480b574ef94cdf556ae;p=thirdparty%2Fvalgrind.git Initial rough hack to spot the stack segment at startup by looking for a rwx mapping which contains the startup %esp. Might be better to look for just rw-. Stack might not be executable if there's a noexec patch, and x86-64 actually enforces the x bit distinctly from r. --> Look for just rw-. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1431 --- diff --git a/coregrind/vg_main.c b/coregrind/vg_main.c index 739a8f0424..f129f2e1f6 100644 --- a/coregrind/vg_main.c +++ b/coregrind/vg_main.c @@ -627,7 +627,9 @@ static void vg_findstack_callback ( Addr start, UInt size, { Addr lastword; if (size == 0) return; - if (r != 'r' || w != 'w' || x != 'x') return; + if (r != 'r' || w != 'w' + /* || x != 'x' --not necessarily so on x86-64*/ + ) return; lastword = start + size - 4; if (start <= VG_(esp_at_startup) && VG_(esp_at_startup) <= lastword) {