From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 527 invoked by alias); 22 Jul 2004 15:47:25 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 505 invoked from network); 22 Jul 2004 15:47:24 -0000 Received: from unknown (HELO omx3.sgi.com) (192.48.171.6) by sourceware.org with SMTP; 22 Jul 2004 15:47:24 -0000 Received: from cthulhu.engr.sgi.com (cthulhu.engr.sgi.com [192.26.80.2]) by omx3.sgi.com (8.12.11/8.12.9/linux-outbound_gateway-1.1) with ESMTP id i6MEtS23001566; Thu, 22 Jul 2004 07:55:31 -0700 Received: from quasar.engr.sgi.com (quasar.engr.sgi.com [163.154.6.61]) by cthulhu.engr.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id i6MFkdon2689988; Thu, 22 Jul 2004 08:46:59 -0700 (PDT) Received: from quasar.engr.sgi.com (localhost [127.0.0.1]) by quasar.engr.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id i6MFjI2w2029051; Thu, 22 Jul 2004 08:46:09 -0700 (PDT) Received: (from davea@localhost) by quasar.engr.sgi.com (SGI-8.12.5/8.12.5/Submit) id i6MFi7GJ1865355; Thu, 22 Jul 2004 08:44:07 -0700 (PDT) Date: Thu, 22 Jul 2004 15:47:00 -0000 From: David Anderson Message-Id: <200407221544.i6MFi7GJ1865355@quasar.engr.sgi.com> To: binutils@sources.redhat.com Subject: [RFA] MIPS_TEXT symbols should be associated to .text section? Cc: gdb-patches@sources.redhat.com X-SW-Source: 2004-07/txt/msg00311.txt.bz2 oel Brobecker 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