public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Dave Korn" <dave.korn@artimi.com>
To: "'Ian Lance Taylor'" <ian@wasabisystems.com>,
	"'David Daney'" <ddaney@avtrex.com>
Cc: <binutils@sourceware.org>
Subject: RE: News MIPS option -mno-shared
Date: Fri, 10 Dec 2004 13:45:00 -0000	[thread overview]
Message-ID: <NUTMEGtgTIFprhMOgRG000005de@NUTMEG.CAM.ARTIMI.COM> (raw)
In-Reply-To: <m3hdmv8b79.fsf@gossamer.airs.com>

> -----Original Message-----
> From: binutils-owner On Behalf Of Ian Lance Taylor
> Sent: 09 December 2004 20:32
> To: David Daney

> David Daney writes:
> 
> > I have code that generates stack traces that relies on the 
> structure of the
> > function prolog to work.  It looks for this:
> > 
> >         /*
> >          * Find function prolog.  It will have the form:
> >          *
> >          *	3c1c???? 	lui	gp,????
> >          *	279c???? 	addiu	gp,gp,????
> >          *	0399e021 	addu	gp,gp,t9
> >          *	27bd#### 	addiu	sp,sp,####
> >          *
> >          * Where ???? are the offset of the GOT from the function
> >          * entrypoint, and #### is the amount added to the 
> stack poiner.
> >          */
> > 
> > Your change will break it.
> 
> True, but only if you choose to use -mno-shared when you compile.  I'm
> not proposing that it be the default, only that it be an option.
> 
> Ian


  GDB will presumably barf on this too, won't it?  It does very much the same
kind of crude disassembling/parsing of function prologs IIUIC.

  Having said that, reversing the prolog to deduce information that was
discarded at compile-time is always going to be an inherently fragile strategy.
The proper solution (both for gdb and for David's application, and I think to
some extent gdb may be already beginning to support this where applicable) is to
compile the application with debug info that identifies which instructions are
prolog-related.  I think that means Dwarf-3.

  David, another thing that could break your code is if the MIPS gcc port starts
to use RTL prolog generation; when that happens, you'll start to see code where
instructions from the body of the function are migrated upward in among prolog
instructions by the scheduler.  That's liable to confuse any code that attempts
to parse prologs without using debug info. 

    cheers, 
      DaveK
-- 
Can't think of a witty .sigline today....

  reply	other threads:[~2004-12-10 13:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-09 15:34 Ian Lance Taylor
2004-12-09 16:41 ` Richard Sandiford
2004-12-09 16:44   ` Ian Lance Taylor
2004-12-10  9:34     ` Richard Sandiford
2004-12-11  3:45       ` Ian Lance Taylor
2004-12-09 16:53 ` Thiemo Seufer
2004-12-09 18:03 ` David Daney
2004-12-09 20:32   ` Ian Lance Taylor
2004-12-10 13:45     ` Dave Korn [this message]
2004-12-10 14:12       ` Thiemo Seufer
2004-12-09 18:19 ` Maciej W. Rozycki
2004-12-09 21:05   ` Ian Lance Taylor
2004-12-09 18:52 ` David Daney
2004-12-09 21:20   ` Ian Lance Taylor
2005-02-21 22:42 ` David Daney

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=NUTMEGtgTIFprhMOgRG000005de@NUTMEG.CAM.ARTIMI.COM \
    --to=dave.korn@artimi.com \
    --cc=binutils@sourceware.org \
    --cc=ddaney@avtrex.com \
    --cc=ian@wasabisystems.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).