[PATCH/6.2.1] Handle MIPS_TEXT/MIPS_DATA symbols (IRIX)
Joel Brobecker
brobecker@gnat.com
Sat Jul 31 00:18:00 GMT 2004
Hello,
I just pulled the following change from mainline into the branch
(pre-approved by Andrew).
2004-07-31 Joel Brobecker <brobecker@gnat.com>
Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
* elfxx-mips.c (_bfd_mips_elf_symbol_processing): Handle
SHN_MIPS_TEXT and SHN_MIPS_DATA.
That should allow "break main; run" to work.
--
Joel
-------------- next part --------------
Index: elfxx-mips.c
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-mips.c,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -p -r1.106 -r1.107
--- elfxx-mips.c 1 Jul 2004 14:53:40 -0000 1.106
+++ elfxx-mips.c 30 Jul 2004 23:56:04 -0000 1.107
@@ -4192,15 +4192,37 @@ _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 = bfd_get_section_by_name (abfd, ".text");
+
+ 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 = bfd_get_section_by_name (abfd, ".data");
+
+ BFD_ASSERT (SGI_COMPAT (abfd));
+ if (section != NULL)
+ {
+ asym->section = section;
+ /* MIPS_DATA is a bit special, the address is not an offset
+ to the base of the .data section. So substract the section
+ base address to make it an offset. */
+ asym->value -= section->vma;
+ }
+ }
break;
-#endif
}
}
More information about the Gdb-patches
mailing list