Index: sid/component/loader/elfload.c =================================================================== RCS file: /cvs/src/src/sid/component/loader/elfload.c,v retrieving revision 1.7 diff -c -p -r1.7 elfload.c *** sid/component/loader/elfload.c 23 Feb 2004 20:08:53 -0000 1.7 --- sid/component/loader/elfload.c 26 Feb 2004 16:10:24 -0000 *************** newLoadArea (int index) *** 39,53 **** } } ! /* 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; static void newTextSection (int index) { - static textSectionNum = 0; if (index >= textSectionNum) { textSectionNum = index + 10; --- 39,52 ---- } } ! /* 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) { if (index >= textSectionNum) { textSectionNum = index + 10; *************** readElfFile (PFLOAD func, unsigned* entr *** 204,211 **** /* Look in the section table in order to determine which sections contain code and which contain data. */ newTextSection (textSectionCount); - *section_table = textSections + textSectionCount; if (sixtyfourbit) { secOffset = fetchQuad (fileHeader+40, littleEndian); --- 203,212 ---- /* 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); if (sixtyfourbit) { secOffset = fetchQuad (fileHeader+40, littleEndian); *************** readElfFile (PFLOAD func, unsigned* entr *** 256,264 **** /* Terminate this portion of the section table. */ textSections[textSectionCount].lbound = 0; textSections[textSectionCount].hbound = 0; - textSectionCount++; *entry_point = entryPoint; *little_endian = littleEndian; return 1; } --- 257,266 ---- /* Terminate this portion of the section table. */ textSections[textSectionCount].lbound = 0; textSections[textSectionCount].hbound = 0; *entry_point = entryPoint; *little_endian = littleEndian; + *section_table = textSections; + return 1; }