undefined symbols are initialized to "0xdeaddead"

This commit is contained in:
László Molnár
2006-06-29 00:22:45 +02:00
parent 96e3899216
commit a68b76c8b4
+4 -2
View File
@@ -391,9 +391,11 @@ void ElfLinker::preprocessSymbols(char *start, const char *end)
s[strlen(symbol)] = 0; s[strlen(symbol)] = 0;
assert(nsymbols < TABLESIZE(symbols)); assert(nsymbols < TABLESIZE(symbols));
if (strcmp(section, "*UND*") == 0)
offset = 0xdeaddead;
symbols[nsymbols++] = Symbol(s, findSection(section), offset); symbols[nsymbols++] = Symbol(s, findSection(section), offset);
printf("symbol %s preprocessed\n", s); printf("symbol %s preprocessed o=%x\n", s, offset);
} }
start = nextl + 1; start = nextl + 1;
@@ -581,7 +583,7 @@ void ElfLinker::relocate()
} }
if (strcmp(rel->value->section->name, "*UND*") == 0 && if (strcmp(rel->value->section->name, "*UND*") == 0 &&
rel->value->offset == 0) rel->value->offset == 0xdeaddead)
{ {
printf("undefined symbol '%s' referenced\n", rel->value->name); printf("undefined symbol '%s' referenced\n", rel->value->name);
abort(); abort();