+2004-02-26 Dave Brolley <brolley@redhat.com>
+
+ * elfload.c (textSectionNum): Now file level static.
+ (readElfFile): Initialize textSections, textSectionNum and
+ textSectionCount for each load. Set *section_table after all
+ sections have been saved.
+
2004-02-23 Dave Brolley <brolley@redhat.com>
* elfload.c (readElfFile): Get address from offset 16 for 64 bit and
}
}
-/* The section table is kept for the duration of the simulation.
- It is divided into sub tables, one for each loader in the system. */
-static int textSectionCount = 0;
-static struct TextSection *textSections = 0;
+/* A new section table is created for each loader in the system. */
+static struct TextSection *textSections;
+static int textSectionCount;
+static int textSectionNum;
static void
newTextSection (int index)
{
- static textSectionNum = 0;
if (index >= textSectionNum)
{
textSectionNum = index + 10;
/* Look in the section table in order to determine which sections contain
code and which contain data. */
+ textSections = 0;
+ textSectionNum = 0;
+ textSectionCount = 0;
newTextSection (textSectionCount);
- *section_table = textSections + textSectionCount;
if (sixtyfourbit)
{
secOffset = fetchQuad (fileHeader+40, littleEndian);
/* Terminate this portion of the section table. */
textSections[textSectionCount].lbound = 0;
textSections[textSectionCount].hbound = 0;
- textSectionCount++;
*entry_point = entryPoint;
*little_endian = littleEndian;
+ *section_table = textSections;
+
return 1;
}