mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-05 05:18:40 +00:00
refactored special case for image base
This commit is contained in:
committed by
Ryan Fleury
parent
d22962af8d
commit
2e531cd70a
@@ -50,7 +50,7 @@ typedef struct COFF_Symbol32Array
|
|||||||
typedef struct COFF_ParsedSymbol
|
typedef struct COFF_ParsedSymbol
|
||||||
{
|
{
|
||||||
String8 name;
|
String8 name;
|
||||||
U32 value;
|
U64 value;
|
||||||
U32 section_number;
|
U32 section_number;
|
||||||
COFF_SymbolType type;
|
COFF_SymbolType type;
|
||||||
COFF_SymStorageClass storage_class;
|
COFF_SymStorageClass storage_class;
|
||||||
|
|||||||
+5
-5
@@ -1146,16 +1146,16 @@ THREAD_POOL_TASK_FUNC(lnk_obj_reloc_patcher)
|
|||||||
NotImplemented;
|
NotImplemented;
|
||||||
}
|
}
|
||||||
|
|
||||||
symbol_secnum = 0;
|
|
||||||
symbol_secoff = 0;
|
|
||||||
// There aren't enough bits in COFF symbol to store full image base address,
|
// There aren't enough bits in COFF symbol to store full image base address,
|
||||||
// so we special case __ImageBase. A better solution would be to add
|
// so we special case __ImageBase. A better solution would be to add
|
||||||
// a 64-bit symbol format to COFF.
|
// a 64-bit symbol format to COFF.
|
||||||
if (str8_match(symbol.name, str8_lit("__ImageBase"), 0)) {
|
if (str8_match(symbol.name, str8_lit("__ImageBase"), 0)) {
|
||||||
symbol_voff = 0;
|
symbol.value = task->image_base;
|
||||||
} else {
|
|
||||||
symbol_voff = (S64)symbol.value - (S64)task->image_base;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
symbol_secnum = 0;
|
||||||
|
symbol_secoff = 0;
|
||||||
|
symbol_voff = (S64)symbol.value - (S64)task->image_base;
|
||||||
} else if (interp == COFF_SymbolValueInterp_Weak) {
|
} else if (interp == COFF_SymbolValueInterp_Weak) {
|
||||||
// unresolved weak
|
// unresolved weak
|
||||||
} else if (interp == COFF_SymbolValueInterp_Undefined) {
|
} else if (interp == COFF_SymbolValueInterp_Undefined) {
|
||||||
|
|||||||
Reference in New Issue
Block a user