From: "Jim Blandy" <jimb@red-bean.com>
To: "Nigel Stephens" <nigel@mips.com>
Cc: "Maciej W. Rozycki" <macro@mips.com>,
"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: Fri, 22 Feb 2008 16:38:00 -0000 [thread overview]
Message-ID: <8f2776cb0802220317q4fe3c813je07e8396920d2147@mail.gmail.com> (raw)
In-Reply-To: <47B988D5.3060605@mips.com>
On Mon, Feb 18, 2008 at 5:32 AM, Nigel Stephens <nigel@mips.com> wrote:
> Maciej W. Rozycki wrote:
> > On Wed, 13 Feb 2008, Jim Blandy wrote:
> >> It seems that we all agree on the following:
> >>
> >> - It's contrary to the DWARF spec for producers to put arch-specific
> >> information in the low bits of the addresses in the line number
> >> table, function and block address ranges, and so on. Existing
> >> toolchains that do this are buggy, but that's life.
>
> Hmm. The ELF symbol table has an "out of band" mechanism to distinguish
> symbols which refer to different architectural encodings, using the
> architecture-specific bits in the st_info field. But how would you
> represent that in DWARF's object file encoding, noting that the
> "MIPS16-ness" of an undefined symbol is not known at compile time, only
> at final link time.
>
> And this is not just a way of sneaking architecture-specific
> "information" through the object file: it is a fundamental aspect of the
> MIPS architecture. From the running software's point of view bit 0 of
> the PC must be set to execute MIPS16 instructions (e.g. when performing
> an indirect jump or function call) and it will always be viewed as set
> when made visible to software (e.g. in the return address register after
> a function call, or saved on the stack, or in the exception program
> counter). Bit 0 must therefore be set in any data which points to a
> MIPS16 instruction.
If you're going to conclude that DWARF DW_AT_low_pc and DW_AT_high_pc
attributes ought to have bit zero set when they show the extent of
MIPS16 code, I don't think that's right. After all, if I want to
disassemble such an instruction, which address do I start reading
bytes from? I must clear bit zero.
Does DWARF information refer to undefined symbols? Doesn't the
compiler know the mode associated with every symbol it refers to in
DWARF? Couldn't relocs against DWARF data citing MIPS16 symbols
subtract off bit 0 in the addend?
GDB actually does have mechanisms (which Maciej mentions) for setting
and masking off bit zero when writing and reading the PC. It seems to
me GDB could look up the linker symbol associated with an address to
find the appropriate mode.
prev parent reply other threads:[~2008-02-22 11:17 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
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 [this message]
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=8f2776cb0802220317q4fe3c813je07e8396920d2147@mail.gmail.com \
--to=jimb@red-bean.com \
--cc=drow@false.org \
--cc=gdb-patches@sourceware.org \
--cc=macro@linux-mips.org \
--cc=macro@mips.com \
--cc=nigel@mips.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