aboutsummaryrefslogtreecommitdiffstats
path: root/trunk/src/layout.c
diff options
context:
space:
mode:
Diffstat (limited to 'trunk/src/layout.c')
-rw-r--r--trunk/src/layout.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/trunk/src/layout.c b/trunk/src/layout.c
index 9292425..de98e1f 100644
--- a/trunk/src/layout.c
+++ b/trunk/src/layout.c
@@ -23,6 +23,7 @@
#include <string.h>
#include <time.h>
#include <unistd.h>
+#include <assert.h>
#include "prelinktab.h"
#include "layout.h"
@@ -298,7 +299,10 @@ layout_libs (void)
for (j = 0, k = 0; j < l.binlibs[i]->ndepends; ++j)
if (l.binlibs[i]->depends[j]->type == ET_DYN
&& l.binlibs[i]->depends[j]->done)
- deps[k++] = l.binlibs[i]->depends[j];
+ {
+ assert (k < l.nlibs);
+ deps[k++] = l.binlibs[i]->depends[j];
+ }
if (k)
{
qsort (deps, k, sizeof (struct prelink_entry *), deps_cmp);
@@ -381,6 +385,7 @@ layout_libs (void)
mmap_start += mmap_base;
}
+ fsync (fd);
close (fd);
}