diff --git a/src/staticdata.c b/src/staticdata.c index cd9ed8b0db0888..c7034ef5cd769d 100644 --- a/src/staticdata.c +++ b/src/staticdata.c @@ -528,6 +528,9 @@ static int jl_needs_serialization(jl_serializer_state *s, jl_value_t *v) JL_NOTS else if (jl_typeis(v, jl_task_type)) { return 0; } + else if (s->incremental && jl_is_code_instance(v) && !((jl_code_instance_t*)v)->relocatability) { + return 0; + } return 1; } diff --git a/src/staticdata_utils.c b/src/staticdata_utils.c index 32c735ab4f6266..7c53183deae172 100644 --- a/src/staticdata_utils.c +++ b/src/staticdata_utils.c @@ -230,6 +230,8 @@ static jl_array_t *queue_external_cis(jl_array_t *list) for (i = n0; i-- > 0; ) { jl_code_instance_t *ci = (jl_code_instance_t*)jl_array_ptr_ref(list, i); assert(jl_is_code_instance(ci)); + if (!ci->relocatability) + continue; jl_method_instance_t *mi = ci->def; jl_method_t *m = mi->def.method; if (ci->inferred && jl_is_method(m) && jl_object_in_image((jl_value_t*)m->module)) {