From: "Maciej W. Rozycki" <macro@mips.com>
To: Jim Blandy <jimb@red-bean.com>
Cc: Daniel Jacobowitz <drow@false.org>,
gdb-patches@sourceware.org,
"Maciej W. Rozycki" <macro@linux-mips.org>
Subject: Re: MIPS: Handle manual calls of MIPS16 functions with a call stub
Date: Wed, 13 Feb 2008 18:28:00 -0000 [thread overview]
Message-ID: <Pine.LNX.4.61.0802131810250.19972@perivale.mips.com> (raw)
In-Reply-To: <8f2776cb0802081007v3978bbfbs4c91835ddd8c3885@mail.gmail.com>
On Fri, 8 Feb 2008, Jim Blandy wrote:
> On Feb 8, 2008 6:23 AM, Maciej W. Rozycki <macro@mips.com> wrote:
> > It is much more than that, but I think it can be done with some
> > adjustments to pointer_to_address(), address_to_pointer() and
> > integer_to_address() methods. If DWARF-2 records could be treated as
> > pointers (which they are given how the linker processes them) rather than
> > addresses then such a setup should work. That should be done above the
> > level of the DWARF-2 interpreter, as losing the LSB from relative data
> > often contained in records would result in an accumulative error.
>
> If you're suggesting that we run the values in DWARF data through
> pointer_to_address, I don't think that's right, either. DWARF
> specifies that those attributes' values are byte addresses of code.
You are right indeed -- this is what the spec says:
"address
Represented as an object of appropriate size to hold an address on the
target machine (DW_FORM_addr). The size is encoded in the compilation
unit header (see Section 7.5.1). This address is relocatable in a
relocatable object file and is relocated inan executable file or shared
object."
> Putting ISA information in low bits of DWARF attribute values isn't
> the way we've decided to do things.
Unfortunately this is what the current versions of the relevant tools do
and I think it has been like this for a while. The linker does not
differentiate between relocations used for taking an address of a function
for the purpose of making a call and for other uses and the same
relocation types are used in both cases.
Ultimately it is the linker that should be fixed (though from the current
behaviour I think GAS has a problem here as well), but I am afraid broken
tools and broken binaries are going to be out there for a while yet, so it
may be a reasonable idea to try to handle them as well as possible. I
recognise pointer_to_address() may not be the best choice here though.
However I think it will have to be involved anyway elsewhere as I find
the current model assumed by GDB inconsistent.
Maciej
next prev parent reply other threads:[~2008-02-13 18:28 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-31 18:14 Maciej W. Rozycki
2008-01-31 22:08 ` Daniel Jacobowitz
2008-02-01 10:27 ` Maciej W. Rozycki
2008-02-01 14:19 ` Daniel Jacobowitz
2008-02-01 15:34 ` Maciej W. Rozycki
2008-02-01 16:58 ` Daniel Jacobowitz
2008-02-01 17:07 ` Maciej W. Rozycki
2008-02-01 17:15 ` Daniel Jacobowitz
2008-02-04 16:14 ` Maciej W. Rozycki
2008-02-04 16:39 ` Daniel Jacobowitz
2008-02-08 14:23 ` Maciej W. Rozycki
2008-02-08 14:57 ` Daniel Jacobowitz
2008-02-08 18:06 ` Jim Blandy
2008-02-08 18:08 ` Jim Blandy
2008-02-13 18:28 ` Maciej W. Rozycki [this message]
2008-02-13 20:54 ` Jim Blandy
2008-02-15 11:36 ` Maciej W. Rozycki
2008-02-18 13:32 ` Nigel Stephens
2008-02-18 16:28 ` Maciej W. Rozycki
2008-02-19 19:48 ` Michael Snyder
2008-02-22 16:38 ` Jim Blandy
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=Pine.LNX.4.61.0802131810250.19972@perivale.mips.com \
--to=macro@mips.com \
--cc=drow@false.org \
--cc=gdb-patches@sourceware.org \
--cc=jimb@red-bean.com \
--cc=macro@linux-mips.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