You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
auto DebugObject = L.getObjectForDebug(Object); // ELF requires us to make a copy to mutate the header with the section load addresses. On other platforms this is a no-op.
if (TT.isOSWindows() && TT.getArch() == Triple::x86_64) {
2256
2245
// Add special values used by debuginfo to build the UnwindData table registration for Win64
2257
2246
// This used to be GV, but with https://reviews.llvm.org/D100944 we no longer can emit GV into `.text`
2258
-
// TODO: The data is set in debuginfo.cpp but it should be okay to actually emit it here.
2259
-
std::string inline_asm = "\
2260
-
.section ";
2261
-
inline_asm +=
2247
+
// and with JITLink it became difficult to change the content afterwards, but we
2248
+
// would prefer that this simple content wasn't recompiled in every single module,
2249
+
// so we emit the necessary PLT trampoline as inline assembly.
2250
+
// This is somewhat duplicated with the .pdata section, but we haven't been able to
2251
+
// use that yet due to relocation issues.
2252
+
#defineASM_USES_ELF// use ELF or COFF syntax based on FORCE_ELF
2253
+
StringRef inline_asm(
2254
+
".section"
2262
2255
#if JL_LLVM_VERSION >= 180000
2263
-
".ltext,\"ax\",@progbits";
2256
+
".ltext,\"ax\",@progbits\n"
2264
2257
#else
2265
-
".text";
2258
+
".text\n"
2266
2259
#endif
2267
-
inline_asm += "\n\
2268
-
.type __UnwindData,@object \n\
2269
-
.p2align 2, 0x90 \n\
2270
-
__UnwindData: \n\
2271
-
.zero 12 \n\
2272
-
.size __UnwindData, 12 \n\
2273
-
\n\
2274
-
.type __catchjmp,@object \n\
2275
-
.p2align 2, 0x90 \n\
2276
-
__catchjmp: \n\
2277
-
.zero 12 \n\
2278
-
.size __catchjmp, 12";
2279
-
2260
+
".globl __julia_personality\n"
2261
+
"\n"
2262
+
#ifdef ASM_USES_ELF
2263
+
".type __UnwindData,@object\n"
2264
+
#else
2265
+
".def __UnwindData\n"
2266
+
".scl 2\n"
2267
+
".type 0\n"
2268
+
".endef\n"
2269
+
#endif
2270
+
".p2align 2, 0x90\n"
2271
+
"__UnwindData:\n"
2272
+
" .byte 0x09;\n"// version info, UNW_FLAG_EHANDLER
2273
+
" .byte 4;\n"// size of prolog (bytes)
2274
+
" .byte 2;\n"// count of unwind codes (slots)
2275
+
" .byte 0x05;\n"// frame register (rbp) = rsp
2276
+
" .byte 4;\n"// second instruction
2277
+
" .byte 0x03;\n"// mov RBP, RSP
2278
+
" .byte 1;\n"// first instruction
2279
+
" .byte 0x50;\n"// push RBP
2280
+
" .int __catchjmp - "
2281
+
#if JL_LLVM_VERSION >= 180000
2282
+
".ltext;\n"// Section-relative offset (if using COFF and JITLink, this can be relative to __ImageBase instead, though then we could possibly use pdata/xdata directly then)
0 commit comments