projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
368ba4a
)
discard dso descriptors after performing relocations
author
Rich Felker
<dalias@aerifal.cx>
Sat, 25 Jun 2011 04:47:28 +0000
(
00:47
-0400)
committer
Rich Felker
<dalias@aerifal.cx>
Sat, 25 Jun 2011 04:47:28 +0000
(
00:47
-0400)
eventually (once dlopen exists) this behavior will be conditional on
dlopen/dlsym not being reachable.
src/ldso/dynlink.c
patch
|
blob
|
history
diff --git
a/src/ldso/dynlink.c
b/src/ldso/dynlink.c
index cb35759bad6de15296c09143aff8e0ef3f20a74f..105ed3d71de4577536fb934a8385789a07955bc5 100644
(file)
--- a/
src/ldso/dynlink.c
+++ b/
src/ldso/dynlink.c
@@
-322,6
+322,16
@@
static void reloc_all(struct dso *p)
}
}
+static void free_all(struct dso *p)
+{
+ struct dso *n;
+ while (p) {
+ n = p->next;
+ if (p->map) free(p);
+ p = n;
+ }
+}
+
void *__dynlink(int argc, char **argv, size_t *got)
{
size_t *auxv, aux[AUX_CNT] = {0};
@@
-387,6
+397,8
@@
void *__dynlink(int argc, char **argv, size_t *got)
reloc_all(head);
+ free_all(head);
+
errno = 0;
return (void *)aux[AT_ENTRY];
}