OSDN Git Service

2004-04-29 Dave Brolley <brolley@redhat.com>
authorbrolley <brolley>
Thu, 29 Apr 2004 20:27:32 +0000 (20:27 +0000)
committerbrolley <brolley>
Thu, 29 Apr 2004 20:27:32 +0000 (20:27 +0000)
        * elfload.c (textSectionAddress): Check section table before accessing.
        * compLoader.cxx (loader_probe_bus): Initialize section_table.

sid/component/loader/ChangeLog
sid/component/loader/compLoader.cxx
sid/component/loader/elfload.c

index 8ccbdba..ea90728 100644 (file)
@@ -1,3 +1,8 @@
+2004-04-29  Dave Brolley  <brolley@redhat.com>
+
+       * elfload.c (textSectionAddress): Check section table before accessing.
+       * compLoader.cxx (loader_probe_bus): Initialize section_table.
+
 2004-02-26  Dave Brolley  <brolley@redhat.com>
 
        * elfload.c (textSectionNum): Now file level static.
index dc1588b..45e7928 100644 (file)
@@ -68,7 +68,8 @@ class loader_probe_bus: public sidutil::passthrough_bus
   public:
     loader_probe_bus (sid::bus **t, output_pin *p) :
       sidutil::passthrough_bus (t),
-      write_to_code_address_pin (p)
+      write_to_code_address_pin (p),
+      section_table (0)
     {
       assert (t);
     }
index a4eaf37..83413cb 100644 (file)
@@ -57,6 +57,10 @@ newTextSection (int index)
 int
 textSectionAddress (unsigned long long address, const struct TextSection *section_table)
 {
+  // Not a text section address if there is no table.
+  if (! section_table)
+    return 0;
+
   /* The table begins with the given pointer and is terminated by an entry with
      zeroes for both the high and low bounds.  */
   int i;