summaryrefslogtreecommitdiff
path: root/devel/psptoolchain-gdb/files/patch-gdb-remote.c
blob: 5864447b042053d44a9d499f423e97c04ed52d22 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
--- gdb/remote.c.orig	2005-07-20 03:56:43.000000000 +0100
+++ gdb/remote.c	2007-02-08 20:06:12.000000000 +0000
@@ -1953,6 +1953,7 @@
   int lose;
   CORE_ADDR text_addr, data_addr, bss_addr;
   struct section_offsets *offs;
+  int i;
 
   putpkt ("qOffsets");
 
@@ -2014,6 +2015,13 @@
   memcpy (offs, symfile_objfile->section_offsets,
 	  SIZEOF_N_SECTION_OFFSETS (symfile_objfile->num_sections));
 
+  /* GDB is stupid, lets fix up all sections to the same address not just a few :P */
+
+  for(i = 0; i < symfile_objfile->num_sections; i++)
+  {
+	  offs->offsets[i] = text_addr;
+  }
+#if 0
   offs->offsets[SECT_OFF_TEXT (symfile_objfile)] = text_addr;
 
   /* This is a temporary kludge to force data and bss to use the same offsets
@@ -2022,6 +2030,7 @@
 
   offs->offsets[SECT_OFF_DATA (symfile_objfile)] = data_addr;
   offs->offsets[SECT_OFF_BSS (symfile_objfile)] = data_addr;
+#endif
 
   objfile_relocate (symfile_objfile, offs);
 }