From: David Anderson <davea@quasar.engr.sgi.com>
To: binutils@sources.redhat.com
Cc: gdb-patches@sources.redhat.com
Subject: [RFA] MIPS_TEXT symbols should be associated to .text section?
Date: Thu, 22 Jul 2004 15:47:00 -0000 [thread overview]
Message-ID: <200407221544.i6MFi7GJ1865355@quasar.engr.sgi.com> (raw)
oel Brobecker <brobecker@gnat.com> writes:
>I was looking at a fairly high number of regressions in the GDB
>testsuite on mips-irix, and one of them was caused by the fact
>that we searched a symbol by its address and that we match the
>possible candidates against the expected section.
>
>For instance, consider the following symbol "main" from my executable.
>nm on this symbol says:
>
> [76] | 268441176| 252|FUNC |GLOB |DEFAULT |MIPS_TEXT|main
>
>GDB is searching the symbol table for a symbol stored at 0x10001658
>(268441176 = 0x10001658). The first thing it does is going through
>all the sections of the executable, and determine that there is only
>one section that contains this address: .text. So it figures that
>if a symbol matches this address, it will belong to that section.
>...
>
>Not knowing IRIX enough, I am not 110% sure that symbol main is indeed
>in section .text, but it seems pretty obvious: the address range of
>the section matches, .text is the only text section, the MIPS_TEXT
>shndx name... I read various man pages, but couldn't find anything
>that explicitly says MIPS_TEXT = .text section.
SHN_MIPS_TEXT is not mentioned in the ABI books (for any IRIX ABI).
It is set as the section for defined externals in text (normally
this means instructions). (set by ld(1) I mean.)
Nor is SHN_MIPS_DATA (used similarly, but for non-instruction externals).
IRIX ld has created things this way for a very long time.
It should be documented, but is not. I will see about
documenting it. I don't know why it is done this way.
Hope this helps.
David B. Anderson davea at sgi dot com http://reality.sgiweb.org/davea
next reply other threads:[~2004-07-22 15:47 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-22 15:47 David Anderson [this message]
-- strict thread matches above, loose matches on Subject: below --
2004-07-21 20:46 Joel Brobecker
2004-07-29 22:02 ` Joel Brobecker
2004-07-29 22:19 ` Thiemo Seufer
2004-07-29 23:15 ` Mark Kettenis
2004-07-30 0:31 ` Thiemo Seufer
2004-07-30 11:32 ` Eli Zaretskii
2004-07-30 13:37 ` Andrew Cagney
2004-07-30 18:04 ` Eli Zaretskii
2004-07-30 18:13 ` Joel Brobecker
2004-07-30 18:44 ` Eli Zaretskii
2004-07-30 18:55 ` Joel Brobecker
2004-07-30 19:36 ` Eli Zaretskii
2004-07-30 19:59 ` Andrew Cagney
2004-07-30 22:29 ` Michael Chastain
2004-07-30 18:08 ` Joel Brobecker
2004-07-30 18:57 ` Thiemo Seufer
2004-07-30 21:08 ` Mark Kettenis
2004-07-30 23:03 ` Joel Brobecker
2004-07-30 23:57 ` Thiemo Seufer
2004-07-30 18:19 ` Joel Brobecker
2004-07-30 0:17 ` Joel Brobecker
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=200407221544.i6MFi7GJ1865355@quasar.engr.sgi.com \
--to=davea@quasar.engr.sgi.com \
--cc=binutils@sources.redhat.com \
--cc=gdb-patches@sources.redhat.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