diff options
author | kib <kib@FreeBSD.org> | 2016-08-19 07:59:00 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2016-08-19 07:59:00 +0000 |
commit | 4b81093e46e9bfa4eaa21b09f0032a5f9fe7f7ec (patch) | |
tree | 942cdc2fd37357ff2b5c616c605b6672aecc76cc /libexec | |
parent | 9eeb002e72b81e4ea34697f082f31b065d7ad43c (diff) | |
download | FreeBSD-src-4b81093e46e9bfa4eaa21b09f0032a5f9fe7f7ec.zip FreeBSD-src-4b81093e46e9bfa4eaa21b09f0032a5f9fe7f7ec.tar.gz |
MFC r304012:
Fill phdr and phsize for rtld object.
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/rtld-elf/rtld.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 01beeb8..d891d52 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -1916,6 +1916,7 @@ static void init_rtld(caddr_t mapbase, Elf_Auxinfo **aux_info) { Obj_Entry objtmp; /* Temporary rtld object */ + const Elf_Ehdr *ehdr; const Elf_Dyn *dyn_rpath; const Elf_Dyn *dyn_soname; const Elf_Dyn *dyn_runpath; @@ -1954,6 +1955,9 @@ init_rtld(caddr_t mapbase, Elf_Auxinfo **aux_info) relocate_objects(&objtmp, true, &objtmp, 0, NULL); } + ehdr = (Elf_Ehdr *)mapbase; + objtmp.phdr = (Elf_Phdr *)((char *)mapbase + ehdr->e_phoff); + objtmp.phsize = ehdr->e_phnum * sizeof(objtmp.phdr[0]); /* Initialize the object list. */ TAILQ_INIT(&obj_list); |