if (callback != 0 && !callback(info->dlpi_name, start, p->p_memsz))
break;
# ifdef PT_GNU_RELRO
- if (n_load_segs >= MAX_LOAD_SEGS) ABORT("Too many PT_LOAD segs");
# if CPP_WORDSZ == 64
/* FIXME: GC_push_all eventually does the correct */
/* rounding to the next multiple of ALIGNMENT, so, most */
/* start pointer value may require aligning */
start = (ptr_t)((word)start & ~(sizeof(word) - 1));
# endif
- load_segs[n_load_segs].start = start;
- load_segs[n_load_segs].end = end;
- load_segs[n_load_segs].start2 = 0;
- load_segs[n_load_segs].end2 = 0;
- ++n_load_segs;
+ if (n_load_segs >= MAX_LOAD_SEGS) {
+ WARN("Too many PT_LOAD segments;"
+ " registering as roots directly...\n", 0);
+ GC_add_roots_inner(start, end, TRUE);
+ } else {
+ load_segs[n_load_segs].start = start;
+ load_segs[n_load_segs].end = end;
+ load_segs[n_load_segs].start2 = 0;
+ load_segs[n_load_segs].end2 = 0;
+ ++n_load_segs;
+ }
# else
GC_add_roots_inner(start, end, TRUE);
# endif /* PT_GNU_RELRO */