summaryrefslogtreecommitdiff
path: root/dyn_load.c
diff options
context:
space:
mode:
authorhboehm <hboehm>2009-05-25 21:24:44 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:45 +0200
commit7f30e7414f8bcb605ccaf6438e2fa3c85f3cbed6 (patch)
treee15b790838c728b208a0c5de27b856bfba2bd0e4 /dyn_load.c
parentc1fcf4d1c0811ae7e3f0841e630eeee402ba64e2 (diff)
2009-05-25 Hans Boehm <Hans.Boehm@hp.com> (Really Petter Urkedal)
* dyn_load.c (GC_register_dynlib_callback): Use new index j instead of i in the inner loop.
Diffstat (limited to 'dyn_load.c')
-rw-r--r--dyn_load.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/dyn_load.c b/dyn_load.c
index af32cea..d443ff1 100644
--- a/dyn_load.c
+++ b/dyn_load.c
@@ -432,22 +432,24 @@ static int GC_register_dynlib_callback(info, size, ptr)
typically a subset of a previously encountered `LOAD' segment, so
we need to exclude it. */
{
+ int j;
+
start = ((ptr_t)(p->p_vaddr)) + info->dlpi_addr;
end = start + p->p_memsz;
- for (i = n_load_segs; --i >= 0; ) {
- if (start >= load_segs[i].start && start < load_segs[i].end) {
- if (load_segs[i].start2 != 0) {
+ for (j = n_load_segs; --j >= 0; ) {
+ if (start >= load_segs[j].start && start < load_segs[j].end) {
+ if (load_segs[j].start2 != 0) {
WARN("More than one GNU_RELRO segment per load seg\n",0);
} else {
- GC_ASSERT(end <= load_segs[i].end);
+ GC_ASSERT(end <= load_segs[j].end);
/* Remove from the existing load segment */
- load_segs[i].end2 = load_segs[i].end;
- load_segs[i].end = start;
- load_segs[i].start2 = end;
+ load_segs[j].end2 = load_segs[j].end;
+ load_segs[j].end = start;
+ load_segs[j].start2 = end;
}
break;
}
- if (i == 0) WARN("Failed to find PT_GNU_RELRO segment"
+ if (j == 0) WARN("Failed to find PT_GNU_RELRO segment"
" inside PT_LOAD region", 0);
}
}