projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
make dynamic linker relocate the main program image last, after all libs
[musl]
/
src
/
ldso
/
dynlink.c
diff --git
a/src/ldso/dynlink.c
b/src/ldso/dynlink.c
index
62dd9db
..
82aaeec
100644
(file)
--- a/
src/ldso/dynlink.c
+++ b/
src/ldso/dynlink.c
@@
-462,6
+462,7
@@
void *__dynlink(int argc, char **argv, size_t *got)
load_deps(head);
make_global(head);
load_deps(head);
make_global(head);
+ reloc_all(head->next);
reloc_all(head);
if (rtld_used) {
reloc_all(head);
if (rtld_used) {
@@
-473,6
+474,7
@@
void *__dynlink(int argc, char **argv, size_t *got)
*libc->prev->next = *libc;
libc = libc->prev->next;
if (libc->next) libc->next->prev = libc;
*libc->prev->next = *libc;
libc = libc->prev->next;
if (libc->next) libc->next->prev = libc;
+ if (tail == &lib) tail = libc;
} else {
free_all(head);
free(sys_path);
} else {
free_all(head);
free(sys_path);