projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
use load address from elf header if possible
[musl]
/
src
/
ldso
/
dynlink.c
diff --git
a/src/ldso/dynlink.c
b/src/ldso/dynlink.c
index
9a0697c
..
527b36b
100644
(file)
--- a/
src/ldso/dynlink.c
+++ b/
src/ldso/dynlink.c
@@
-189,7
+189,7
@@
static void *map_library(int fd, size_t *lenp, unsigned char **basep, size_t *dy
* the length of the file. This is okay because we will not
* use the invalid part; we just need to reserve the right
* amount of virtual address space to map over later. */
* the length of the file. This is okay because we will not
* use the invalid part; we just need to reserve the right
* amount of virtual address space to map over later. */
- map = mmap(
0
, map_len, prot, MAP_PRIVATE, fd, off_start);
+ map = mmap(
(void *)addr_min
, map_len, prot, MAP_PRIVATE, fd, off_start);
if (map==MAP_FAILED) return 0;
base = map - addr_min;
ph = (void *)((char *)buf + eh->e_phoff);
if (map==MAP_FAILED) return 0;
base = map - addr_min;
ph = (void *)((char *)buf + eh->e_phoff);
@@
-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) {