mirror of https://github.com/contiki-ng/mspsim
Improved handling of the stack idenfitication at end of memory that works better for mspgcc 4.7.x
This commit is contained in:
parent
d59a319f17
commit
b5985a4f47
|
|
@ -374,6 +374,7 @@ public class ELF {
|
|||
public MapTable getMap() {
|
||||
MapTable map = new MapTable();
|
||||
int sAddrHighest = -1;
|
||||
boolean foundEnd = false;
|
||||
|
||||
ELFSection name = sections[symTable.link];
|
||||
int len = symTable.size;
|
||||
|
|
@ -418,13 +419,14 @@ public class ELF {
|
|||
if (sAddr > 0 && sAddr < 0x100000) {
|
||||
String symbolName = sn;
|
||||
|
||||
if (sAddr < 0x5c00 && sAddr > sAddrHighest) {
|
||||
if (sAddr < 0x5c00 && sAddr > sAddrHighest && !sn.equals("__stack")) {
|
||||
sAddrHighest = sAddr;
|
||||
}
|
||||
// if (bind == ELFSection.SYMBIND_LOCAL) {
|
||||
// symbolName += " (" + currentFile + ')';
|
||||
// }
|
||||
if ("_end".equals(symbolName)) {
|
||||
foundEnd = true;
|
||||
map.setHeapStart(sAddr);
|
||||
} else if ("__stack".equals(symbolName)){
|
||||
map.setStackStart(sAddr);
|
||||
|
|
@ -455,10 +457,10 @@ public class ELF {
|
|||
addr += symTable.getEntrySize();
|
||||
}
|
||||
|
||||
if (map.getHeapStart() <= 0 && sAddrHighest > 0) {
|
||||
System.err.printf("Warning: Unable to parse _end symbol. I'm guessing that heap starts at 0x%05x\n", sAddrHighest);
|
||||
map.setHeapStart(sAddrHighest);
|
||||
}
|
||||
if (!foundEnd && sAddrHighest > 0) {
|
||||
System.out.printf("Warning: Unable to parse _end symbol. I'm guessing that heap starts at 0x%05x\n", sAddrHighest);
|
||||
map.setHeapStart(sAddrHighest);
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue