mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-06 13:58:40 +00:00
fix signedness issue
This commit is contained in:
committed by
Ryan Fleury
parent
671431cfbd
commit
a3bcfe01e1
+4
-4
@@ -178,7 +178,7 @@ coff_pick_reloc_value_x64(COFF_Reloc_X64 type,
|
|||||||
U64 reloc_virtual_offset,
|
U64 reloc_virtual_offset,
|
||||||
U32 symbol_section_number,
|
U32 symbol_section_number,
|
||||||
U32 symbol_section_offset,
|
U32 symbol_section_offset,
|
||||||
U32 symbol_virtual_offset)
|
S64 symbol_virtual_offset)
|
||||||
{
|
{
|
||||||
U64 reloc_value_size = 0;
|
U64 reloc_value_size = 0;
|
||||||
S64 reloc_value = 0;
|
S64 reloc_value = 0;
|
||||||
@@ -187,15 +187,15 @@ coff_pick_reloc_value_x64(COFF_Reloc_X64 type,
|
|||||||
case COFF_Reloc_X64_Abs: {} break;
|
case COFF_Reloc_X64_Abs: {} break;
|
||||||
case COFF_Reloc_X64_Addr64: {
|
case COFF_Reloc_X64_Addr64: {
|
||||||
reloc_value_size = 8;
|
reloc_value_size = 8;
|
||||||
reloc_value = symbol_virtual_offset + image_base;
|
reloc_value = symbol_virtual_offset + (S64)image_base;
|
||||||
} break;
|
} break;
|
||||||
case COFF_Reloc_X64_Addr32: {
|
case COFF_Reloc_X64_Addr32: {
|
||||||
reloc_value_size = 4;
|
reloc_value_size = 4;
|
||||||
reloc_value = symbol_virtual_offset + image_base;
|
reloc_value = safe_cast_s32(symbol_virtual_offset + (S64)image_base);
|
||||||
} break;
|
} break;
|
||||||
case COFF_Reloc_X64_Addr32Nb: {
|
case COFF_Reloc_X64_Addr32Nb: {
|
||||||
reloc_value_size = 4;
|
reloc_value_size = 4;
|
||||||
reloc_value = safe_cast_u32(symbol_virtual_offset);
|
reloc_value = symbol_virtual_offset;
|
||||||
} break;
|
} break;
|
||||||
case COFF_Reloc_X64_Rel32: {
|
case COFF_Reloc_X64_Rel32: {
|
||||||
reloc_value_size = 4;
|
reloc_value_size = 4;
|
||||||
|
|||||||
+1
-1
@@ -601,7 +601,7 @@ internal String8 coff_read_symbol_name(String8 string_table, COFF_SymbolName *na
|
|||||||
internal U64 coff_apply_size_from_reloc_x64(COFF_Reloc_X64 x);
|
internal U64 coff_apply_size_from_reloc_x64(COFF_Reloc_X64 x);
|
||||||
internal U64 coff_apply_size_from_reloc_x86(COFF_Reloc_X86 x);
|
internal U64 coff_apply_size_from_reloc_x86(COFF_Reloc_X86 x);
|
||||||
|
|
||||||
internal COFF_RelocValue coff_pick_reloc_value_x64(COFF_Reloc_X64 type, U64 image_base, U64 reloc_virtual_offset, U32 symbol_section_number, U32 symbol_section_offset, U32 symbol_virtual_offset);
|
internal COFF_RelocValue coff_pick_reloc_value_x64(COFF_Reloc_X64 type, U64 image_base, U64 reloc_virtual_offset, U32 symbol_section_number, U32 symbol_section_offset, S64 symbol_virtual_offset);
|
||||||
|
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
// Import
|
// Import
|
||||||
|
|||||||
+2
-2
@@ -1117,7 +1117,7 @@ THREAD_POOL_TASK_FUNC(lnk_obj_reloc_patcher)
|
|||||||
// compute symbol location values
|
// compute symbol location values
|
||||||
U32 symbol_secnum = 0;
|
U32 symbol_secnum = 0;
|
||||||
U32 symbol_secoff = 0;
|
U32 symbol_secoff = 0;
|
||||||
U32 symbol_voff = 0;
|
S64 symbol_voff = 0;
|
||||||
{
|
{
|
||||||
COFF_ParsedSymbol symbol;
|
COFF_ParsedSymbol symbol;
|
||||||
if (obj_header.is_big_obj) {
|
if (obj_header.is_big_obj) {
|
||||||
@@ -1149,7 +1149,7 @@ THREAD_POOL_TASK_FUNC(lnk_obj_reloc_patcher)
|
|||||||
if (str8_match(symbol.name, str8_lit("__ImageBase"), 0)) {
|
if (str8_match(symbol.name, str8_lit("__ImageBase"), 0)) {
|
||||||
symbol_voff = 0;
|
symbol_voff = 0;
|
||||||
} else {
|
} else {
|
||||||
symbol_voff = symbol.value - task->image_base;
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user