diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2021-09-19 13:23:22 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2021-09-19 14:29:41 +0300 |
commit | eed7e2372fed90a97b079a1fe26e65a6867dc836 (patch) | |
tree | 1a67846fad9aa6da9c7bc01c66fd5458cadb5f12 /dyn_load.c | |
parent | bc26e5debad671693f52f721535cf4ac7927856e (diff) | |
download | bdwgc-eed7e2372fed90a97b079a1fe26e65a6867dc836.tar.gz |
Fix assertion violation in register_dynlib_callback on Android
* dyn_load.c [HAVE_DL_ITERATE_PHDR && PT_GNU_RELRO]
(GC_register_dynlib_callback): Round load_segs[j].end up to nearest
page boundary in the assertion; add comment.
Diffstat (limited to 'dyn_load.c')
-rw-r--r-- | dyn_load.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -542,11 +542,15 @@ STATIC int GC_register_dynlib_callback(struct dl_phdr_info * info, if (load_segs[j].start2 != 0) { WARN("More than one GNU_RELRO segment per load one\n",0); } else { - GC_ASSERT((word)end <= (word)load_segs[j].end); + GC_ASSERT((word)end <= + (((word)load_segs[j].end + GC_page_size - 1) & + ~(GC_page_size - 1))); /* Remove from the existing load segment */ load_segs[j].end2 = load_segs[j].end; load_segs[j].end = start; load_segs[j].start2 = end; + /* Note that start2 may be greater than end2 because of */ + /* p->p_memsz value multiple of page size. */ } break; } |