File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -166,9 +166,9 @@ typedef enum {
166166} jl_callingconv_t ;
167167
168168
169- // this supports up to 1 GB images and 16 RefTags
169+ // this supports up to 8 RefTags, 512MB of pointer data, and 4/2 (64/32-bit) GB of constant data.
170170// if a larger size is required, will need to add support for writing larger relocations in many cases below
171- #define RELOC_TAG_OFFSET 28
171+ #define RELOC_TAG_OFFSET 29
172172
173173
174174/* read and write in host byte order */
@@ -1394,6 +1394,12 @@ static void jl_save_system_image_to_stream(ios_t *f)
13941394 jl_write_gv_ints (& s );
13951395 }
13961396
1397+ if (sysimg .size > ((uintptr_t )1 << RELOC_TAG_OFFSET ) ||
1398+ const_data .size > ((uintptr_t )1 << RELOC_TAG_OFFSET )* sizeof (void * )) {
1399+ jl_printf (JL_STDERR , "ERROR: system image too large\n" );
1400+ jl_exit (1 );
1401+ }
1402+
13971403 // step 3: combine all of the sections into one file
13981404 write_uint32 (f , sysimg .size - sizeof (uint32_t ));
13991405 ios_seek (& sysimg , sizeof (uint32_t ));
You can’t perform that action at this time.
0 commit comments