Date: Fri, 19 Aug 2016 08:07:04 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304455 - stable/10/libexec/rtld-elf Message-ID: <201608190807.u7J874u0006952@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Fri Aug 19 08:07:04 2016 New Revision: 304455 URL: https://svnweb.freebsd.org/changeset/base/304455 Log: MFC r304012: Fill phdr and phsize for rtld object. Modified: stable/10/libexec/rtld-elf/rtld.c Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/rtld-elf/rtld.c ============================================================================== --- stable/10/libexec/rtld-elf/rtld.c Fri Aug 19 08:05:08 2016 (r304454) +++ stable/10/libexec/rtld-elf/rtld.c Fri Aug 19 08:07:04 2016 (r304455) @@ -1872,6 +1872,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; @@ -1910,6 +1911,9 @@ init_rtld(caddr_t mapbase, Elf_Auxinfo * 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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608190807.u7J874u0006952>