aboutsummaryrefslogtreecommitdiff
path: root/src/jit
diff options
context:
space:
mode:
authorMike Pall <mike>2022-07-12 22:25:33 +0200
committerMike Pall <mike>2022-07-12 22:25:33 +0200
commitb98b37231bd2dcb79e10b0f974cefd91eb0d7b3a (patch)
tree602d5e43e2d06af71b0102dd12f87c4585fbd7dd /src/jit
parent6bda30d8c745b3963ba870221b9be6acdffed9b1 (diff)
downloadluajit-b98b37231bd2dcb79e10b0f974cefd91eb0d7b3a.tar.gz
luajit-b98b37231bd2dcb79e10b0f974cefd91eb0d7b3a.tar.bz2
luajit-b98b37231bd2dcb79e10b0f974cefd91eb0d7b3a.zip
OSX/iOS/ARM64: Fix bytecode embedding in Mach-O object file.
Thanks to Carlo Cabrera.
Diffstat (limited to 'src/jit')
-rw-r--r--src/jit/bcsave.lua14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/jit/bcsave.lua b/src/jit/bcsave.lua
index 6227d136..adf197c6 100644
--- a/src/jit/bcsave.lua
+++ b/src/jit/bcsave.lua
@@ -501,6 +501,18 @@ typedef struct {
501 mach_nlist sym_entry; 501 mach_nlist sym_entry;
502 uint8_t space[4096]; 502 uint8_t space[4096];
503} mach_fat_obj; 503} mach_fat_obj;
504typedef struct {
505 mach_fat_header fat;
506 mach_fat_arch fat_arch[2];
507 struct {
508 mach_header_64 hdr;
509 mach_segment_command_64 seg;
510 mach_section_64 sec;
511 mach_symtab_command sym;
512 } arch[2];
513 mach_nlist_64 sym_entry;
514 uint8_t space[4096];
515} mach_fat_obj_64;
504]] 516]]
505 local symname = '_'..LJBC_PREFIX..ctx.modname 517 local symname = '_'..LJBC_PREFIX..ctx.modname
506 local isfat, is64, align, mobj = false, false, 4, "mach_obj" 518 local isfat, is64, align, mobj = false, false, 4, "mach_obj"
@@ -509,7 +521,7 @@ typedef struct {
509 elseif ctx.arch == "arm" then 521 elseif ctx.arch == "arm" then
510 isfat, mobj = true, "mach_fat_obj" 522 isfat, mobj = true, "mach_fat_obj"
511 elseif ctx.arch == "arm64" then 523 elseif ctx.arch == "arm64" then
512 is64, align, isfat, mobj = true, 8, true, "mach_fat_obj" 524 is64, align, isfat, mobj = true, 8, true, "mach_fat_obj_64"
513 else 525 else
514 check(ctx.arch == "x86", "unsupported architecture for OSX") 526 check(ctx.arch == "x86", "unsupported architecture for OSX")
515 end 527 end