public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  archer-tromey-remove-obj_section: more hackery in SOM reader
@ 2013-01-22 16:28 tromey
  0 siblings, 0 replies; only message in thread
From: tromey @ 2013-01-22 16:28 UTC (permalink / raw)
  To: archer-commits

The branch, archer-tromey-remove-obj_section has been updated
       via  36b2db08d02bd45935a021c3f1446da432b7b94b (commit)
      from  8cf1c381f45305c9616de802b263cf6ceaa0012b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 36b2db08d02bd45935a021c3f1446da432b7b94b
Author: Tom Tromey <tromey@redhat.com>
Date:   Mon Jan 21 08:05:34 2013 -0700

    more hackery in SOM reader

-----------------------------------------------------------------------

Summary of changes:
 gdb/solib-som.c |   25 ++++++++++++++++++++-----
 gdb/somread.c   |    5 ++---
 2 files changed, 22 insertions(+), 8 deletions(-)

First 500 lines of diff:
diff --git a/gdb/solib-som.c b/gdb/solib-som.c
index 469fba3..6c64f64 100644
--- a/gdb/solib-som.c
+++ b/gdb/solib-som.c
@@ -1,6 +1,6 @@
 /* Handle SOM shared libraries.
 
-   Copyright (C) 2004-2005, 2007-2012 Free Software Foundation, Inc.
+   Copyright (C) 2004-2005, 2007-2013 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -840,6 +840,7 @@ som_solib_section_offsets (struct objfile *objfile,
       if (strstr (objfile->name, so_list->so_name))
 	{
 	  asection *private_section;
+	  struct obj_section *sect;
 
 	  /* The text offset is easy.  */
 	  offsets->offsets[SECT_OFF_TEXT (objfile)]
@@ -857,10 +858,24 @@ som_solib_section_offsets (struct objfile *objfile,
 	      offsets->offsets[SECT_OFF_BSS (objfile)] = 0;
 	      return 1;
 	    }
-	  offsets->offsets[SECT_OFF_DATA (objfile)]
-	    = (so_list->lm_info->data_start - private_section->vma);
-	  offsets->offsets[SECT_OFF_BSS (objfile)]
-	    = ANOFFSET (offsets, SECT_OFF_DATA (objfile));
+	  if (objfile->sect_index_data != -1)
+	    {
+	      offsets->offsets[SECT_OFF_DATA (objfile)]
+		= (so_list->lm_info->data_start - private_section->vma);
+	      if (objfile->sect_index_bss != -1)
+		offsets->offsets[SECT_OFF_BSS (objfile)]
+		  = ANOFFSET (offsets, SECT_OFF_DATA (objfile));
+	    }
+
+	  ALL_OBJFILE_OSECTIONS (objfile, sect)
+	    {
+	      if (sect->the_bfd_section->index != objfile->sect_index_text
+		  && sect->the_bfd_section->index != objfile->sect_index_bss
+		  && sect->the_bfd_section->index != objfile->sect_index_data)
+		offsets->offsets[sect->the_bfd_section->index]
+		  = offsets->offsets[SECT_OFF_TEXT (objfile)];
+	    }
+
 	  return 1;
 	}
       so_list = so_list->next;
diff --git a/gdb/somread.c b/gdb/somread.c
index c7add8a..967a9f7 100644
--- a/gdb/somread.c
+++ b/gdb/somread.c
@@ -55,11 +55,10 @@ som_symtab_read (bfd *abfd, struct objfile *objfile,
   struct som_external_symbol_dictionary_record *buf, *bufp, *endbufp;
   char *symname;
   CONST int symsize = sizeof (struct som_external_symbol_dictionary_record);
-  CORE_ADDR text_offset, data_offset;
 
 
-  text_offset = ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
-  data_offset = ANOFFSET (section_offsets, SECT_OFF_DATA (objfile));
+#define text_offset ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile))
+#define data_offset ANOFFSET (section_offsets, SECT_OFF_DATA (objfile))
 
   number_of_symbols = bfd_get_symcount (abfd);
 


hooks/post-receive
--
Repository for Project Archer.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-01-22 16:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-22 16:28 [SCM] archer-tromey-remove-obj_section: more hackery in SOM reader tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).