From owner-svn-src-all@freebsd.org Sun Nov 4 00:32:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CDEE10EE103; Sun, 4 Nov 2018 00:32:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E06F072EFD; Sun, 4 Nov 2018 00:32:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8BC421177; Sun, 4 Nov 2018 00:32:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA40WTwU014402; Sun, 4 Nov 2018 00:32:29 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA40WTr6014399; Sun, 4 Nov 2018 00:32:29 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811040032.wA40WTr6014399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 4 Nov 2018 00:32:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340107 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 340107 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E06F072EFD X-Spamd-Result: default: False [-0.77 / 200.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: mx1.FreeBSD.org]; NEURAL_HAM_SHORT(-0.66)[-0.658,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2018 00:32:30 -0000 Author: kib Date: Sun Nov 4 00:32:28 2018 New Revision: 340107 URL: https://svnweb.freebsd.org/changeset/base/340107 Log: Remove Obj_Entry textsize member. It is unused after r340102, and more important, I do not see how to define textsize in both practically useful and correct way, for binaries with more that one executable segments. Sponsored by: The FreeBSD Foundation Modified: head/libexec/rtld-elf/map_object.c head/libexec/rtld-elf/rtld.c head/libexec/rtld-elf/rtld.h Modified: head/libexec/rtld-elf/map_object.c ============================================================================== --- head/libexec/rtld-elf/map_object.c Sat Nov 3 23:37:13 2018 (r340106) +++ head/libexec/rtld-elf/map_object.c Sun Nov 4 00:32:28 2018 (r340107) @@ -287,7 +287,6 @@ map_object(int fd, const char *path, const struct stat } obj->mapbase = mapbase; obj->mapsize = mapsize; - obj->textsize = text_end - base_vaddr; obj->vaddrbase = base_vaddr; obj->relocbase = mapbase - base_vaddr; obj->dynamic = (const Elf_Dyn *)(obj->relocbase + phdyn->p_vaddr); Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Sat Nov 3 23:37:13 2018 (r340106) +++ head/libexec/rtld-elf/rtld.c Sun Nov 4 00:32:28 2018 (r340107) @@ -1415,10 +1415,6 @@ digest_phdr(const Elf_Phdr *phdr, int phnum, caddr_t e obj->vaddrbase; } nsegs++; - if ((ph->p_flags & PF_X) == PF_X) { - obj->textsize = MAX(obj->textsize, - round_page(ph->p_vaddr + ph->p_memsz) - obj->vaddrbase); - } break; case PT_DYNAMIC: Modified: head/libexec/rtld-elf/rtld.h ============================================================================== --- head/libexec/rtld-elf/rtld.h Sat Nov 3 23:37:13 2018 (r340106) +++ head/libexec/rtld-elf/rtld.h Sun Nov 4 00:32:28 2018 (r340107) @@ -151,7 +151,6 @@ typedef struct Struct_Obj_Entry { /* These items are computed by map_object() or by digest_phdr(). */ caddr_t mapbase; /* Base address of mapped region */ size_t mapsize; /* Size of mapped region in bytes */ - size_t textsize; /* Size of text segment in bytes */ Elf_Addr vaddrbase; /* Base address in shared object file */ caddr_t relocbase; /* Relocation constant = mapbase - vaddrbase */ const Elf_Dyn *dynamic; /* Dynamic section */