mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
Implement IMAGE_REL_AMD64_SECREL for RuntimeDyldCOFFX86_64
lldb on Windows uses the ExecutionEngine for expression evaluation and hits the llvm_unreachable due to this relocation. Thus, implement the relocation and add a test to verify it's function. llvm-svn: 348904
This commit is contained in:
parent
321ce59ba4
commit
3cfcc8fb8b
@ -128,6 +128,13 @@ public:
|
||||
break;
|
||||
}
|
||||
|
||||
case COFF::IMAGE_REL_AMD64_SECREL: {
|
||||
assert(static_cast<int64_t>(RE.Addend) <= INT32_MAX && "Relocation overflow");
|
||||
assert(static_cast<int64_t>(RE.Addend) >= INT32_MIN && "Relocation underflow");
|
||||
writeBytesUnaligned(RE.Addend, Target, 4);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
llvm_unreachable("Relocation type not implemented yet!");
|
||||
break;
|
||||
|
@ -24,3 +24,17 @@ inst1:
|
||||
# rtdyld-check: decode_operand(inst2, 3) = section_addr(COFF_x86_64_IMGREL.o, .rdata)+5-40960000000000
|
||||
inst2:
|
||||
mov %ebx, (__constdata@imgrel+5)
|
||||
.data
|
||||
.space 375
|
||||
rel1:
|
||||
# rtdyld-check: *{4}rel1 = string - section_addr(COFF_x86_64_IMGREL.o, .data)
|
||||
.secrel32 string
|
||||
|
||||
# We explicitly add padding to put string outside of the 16bit address space
|
||||
# (absolute and as an offset from .data), so that relocations involving
|
||||
# 32bit addresses / offsets are not accidentally truncated to 16 bits.
|
||||
.space 65536
|
||||
.global string
|
||||
.align 1
|
||||
string:
|
||||
.asciz "Hello World\n"
|
||||
|
Loading…
x
Reference in New Issue
Block a user