Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Thiemo Seufer <ica2_ts@csv.ica.uni-stuttgart.de>
To: Mark Kettenis <kettenis@chello.nl>
Cc: brobecker@gnat.com, binutils@sources.redhat.com,
	gdb-patches@sources.redhat.com
Subject: Re: [RFA] MIPS_TEXT symbols should be associated to .text section?
Date: Fri, 30 Jul 2004 00:31:00 -0000	[thread overview]
Message-ID: <20040730003138.GU965@rembrandt.csv.ica.uni-stuttgart.de> (raw)
In-Reply-To: <200407292314.i6TNEqwV024526@elgar.kettenis.dyndns.org>

Mark Kettenis wrote:
>    From: Thiemo Seufer <ica2_ts@csv.ica.uni-stuttgart.de>
>    Date: Fri, 30 Jul 2004 00:19:04 +0200
> 
>    Joel Brobecker wrote:
>    > Hello BFD maintainers,
>    > 
>    > Ping? This patch is only 8 days old, and I wouldn't send a reminder
>    > just a week after sending it, but GDB is completely broken without
>    > this patch (ie "break main; run" doesn't work)... Would somebody mind
>    > having a look at it and tell me if it is good or not?
> 
> Joel, I'm seeing similar problems on NetBSD/mips (NetBSD/pmax 1.6.2 to
> be precise).

AFAICS it will hit all elf{32-,32-n,64-}{big,little}mips targets (as
opposed to *trad*mips), which are covered by SGI_COMPAT.

>    [snip]
> 
>    > >  #if 0 /* for SGI_COMPAT */
>    > >      case SHN_MIPS_TEXT:
>    > >        asym->section = mips_elf_text_section_ptr;
> 
>    The last three lines in this patch suggest AFAICS to use
>    mips_elf_text_section_ptr instead of bfd_get_section_by_name,
>    and to make the test conditional on SGI_COMPAT. The SHN_MIPS_DATA
>    below should probably get handled similiarily.
> 
> Well, mips_elf_text_section_ptr doesn't really exist.

Right, that appears to be some leftover of earlier code. Looks like
elf_tdata()->elf_text_section replaced it.

Joel, can you try the appended (untested) patch and tell me if it
works for you?


Thiemo


Index: bfd/elfxx-mips.c
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-mips.c,v
retrieving revision 1.106
diff -u -p -r1.106 elfxx-mips.c
--- bfd/elfxx-mips.c	1 Jul 2004 14:53:40 -0000	1.106
+++ bfd/elfxx-mips.c	30 Jul 2004 00:28:55 -0000
@@ -4192,15 +4192,31 @@ _bfd_mips_elf_symbol_processing (bfd *ab
       asym->section = bfd_und_section_ptr;
       break;
 
-#if 0 /* for SGI_COMPAT */
     case SHN_MIPS_TEXT:
-      asym->section = mips_elf_text_section_ptr;
+      {
+	asection *section = elf_tdata (abfd)->elf_text_section;
+
+	BFD_ASSERT (SGI_COMPAT (abfd));
+	if (section != NULL)
+	  {
+	    asym->section = section;
+	    /* MIPS_TEXT is a bit special, the address is not an offset
+	       to the base of the .text section.  So substract the section
+	       base address to make it an offset.  */
+	    asym->value -= section->vma;
+	  }
+      }
       break;
 
     case SHN_MIPS_DATA:
-      asym->section = mips_elf_data_section_ptr;
+      {
+	asection *section = elf_tdata (abfd)->elf_data_section;
+
+	BFD_ASSERT (SGI_COMPAT (abfd));
+	if (section != NULL)
+	  asym->section = section;
+      }
       break;
-#endif
     }
 }
 \f


  reply	other threads:[~2004-07-30  0:31 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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
2004-07-22 15:47 David Anderson

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=20040730003138.GU965@rembrandt.csv.ica.uni-stuttgart.de \
    --to=ica2_ts@csv.ica.uni-stuttgart.de \
    --cc=binutils@sources.redhat.com \
    --cc=brobecker@gnat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=kettenis@chello.nl \
    /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