From owner-svn-src-head@freebsd.org Wed Dec 28 14:25:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4003C94295; Wed, 28 Dec 2016 14:25:05 +0000 (UTC) (envelope-from emaste@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 mx1.freebsd.org (Postfix) with ESMTPS id 549191935; Wed, 28 Dec 2016 14:25:05 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBSEP467037215; Wed, 28 Dec 2016 14:25:04 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBSEP4qO037214; Wed, 28 Dec 2016 14:25:04 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201612281425.uBSEP4qO037214@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 28 Dec 2016 14:25:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310702 - head/sys/boot/i386/btx/btxldr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2016 14:25:05 -0000 Author: emaste Date: Wed Dec 28 14:25:04 2016 New Revision: 310702 URL: https://svnweb.freebsd.org/changeset/base/310702 Log: btxldr: process all PT_LOAD segments, not just the first two With default settings GNU ld generates two PT_LOADs for loader.sym while LLD generates three, because it creates a rodata segment. Previously btxldr terminated phdr processing after two PT_LOADs. Remove the early termination to process all PT_LOADs. Reviewed by: kib, tsoome MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D8929 Modified: head/sys/boot/i386/btx/btxldr/btxldr.S Modified: head/sys/boot/i386/btx/btxldr/btxldr.S ============================================================================== --- head/sys/boot/i386/btx/btxldr/btxldr.S Wed Dec 28 14:10:33 2016 (r310701) +++ head/sys/boot/i386/btx/btxldr/btxldr.S Wed Dec 28 14:25:04 2016 (r310702) @@ -198,7 +198,6 @@ start.3: call putstr # message movl $m_segs,%esi # Format string #endif - movl $0x2,%edi # Segment count movl 0x1c(%ebx),%edx # Get e_phoff addl %ebx,%edx # To pointer movzwl 0x2c(%ebx),%ecx # Get e_phnum @@ -216,8 +215,7 @@ start.4: cmpl $0x1,(%edx) # Is p_type P call putstr # End message #endif pushl %esi # Save - pushl %edi # working - pushl %ecx # registers + pushl %ecx # working registers movl 0x4(%edx),%esi # Get p_offset addl %ebx,%esi # as pointer movl 0x8(%edx),%edi # Get p_vaddr @@ -232,13 +230,9 @@ start.4: cmpl $0x1,(%edx) # Is p_type P rep # zero stosb # them start.5: popl %ecx # Restore - popl %edi # working popl %esi # registers - decl %edi # Segments to do - je start.7 # If none start.6: addl $0x20,%edx # To next entry loop start.4 # Till done -start.7: #ifdef BTXLDR_VERBOSE movl $m_done,%esi # Display done call putstr # message