Date: Fri, 19 Aug 2016 07:59:00 +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-11@freebsd.org Subject: svn commit: r304452 - stable/11/libexec/rtld-elf Message-ID: <201608190759.u7J7x0pq003258@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Fri Aug 19 07:59:00 2016 New Revision: 304452 URL: https://svnweb.freebsd.org/changeset/base/304452 Log: MFC r304012: Fill phdr and phsize for rtld object. Modified: stable/11/libexec/rtld-elf/rtld.c Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/rtld-elf/rtld.c ============================================================================== --- stable/11/libexec/rtld-elf/rtld.c Fri Aug 19 07:57:43 2016 (r304451) +++ stable/11/libexec/rtld-elf/rtld.c Fri Aug 19 07:59:00 2016 (r304452) @@ -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 * 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?201608190759.u7J7x0pq003258>