svn commit: r311908 - stable/11/sys/boot/i386/btx/btxldr

Ed Maste emaste at FreeBSD.org
Wed Jan 11 00:50:20 UTC 2017


Author: emaste
Date: Wed Jan 11 00:50:19 2017
New Revision: 311908
URL: https://svnweb.freebsd.org/changeset/base/311908

Log:
  MFC r310702: 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.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  stable/11/sys/boot/i386/btx/btxldr/btxldr.S
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/boot/i386/btx/btxldr/btxldr.S
==============================================================================
--- stable/11/sys/boot/i386/btx/btxldr/btxldr.S	Wed Jan 11 00:14:47 2017	(r311907)
+++ stable/11/sys/boot/i386/btx/btxldr/btxldr.S	Wed Jan 11 00:50:19 2017	(r311908)
@@ -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


More information about the svn-src-all mailing list