This is the mail archive of the sid@sources.redhat.com mailing list for the SID project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] elf loader detection of code sections


The attached patch makes a correction in the way code sections are detected by the elf loader. It now uses the VMA address of the section as intended.

Dave

2004-02-23  Dave Brolley  <brolley@redhat.com>

	* elfload.c (readElfFile): Get address from offset 16 for 64 bit and
	offset 12 for 16 bit.

Index: sid/component/loader/elfload.c
===================================================================
RCS file: /cvs/src/src/sid/component/loader/elfload.c,v
retrieving revision 1.6
diff -c -p -r1.6 elfload.c
*** sid/component/loader/elfload.c	12 Feb 2004 20:30:08 -0000	1.6
--- sid/component/loader/elfload.c	23 Feb 2004 20:07:02 -0000
*************** readElfFile (PFLOAD func, unsigned* entr
*** 229,235 ****
  	  if (fetchQuad(secHdr+8, littleEndian) & SHF_EXECINSTR)
  	    {
  	      textSections[textSectionCount].lbound = 
! 		fetchQuad(secHdr+24, littleEndian);
  	      textSections[textSectionCount].hbound = 
  		textSections[textSectionCount].lbound
  		+ fetchQuad(secHdr+32, littleEndian) - 1;
--- 229,235 ----
  	  if (fetchQuad(secHdr+8, littleEndian) & SHF_EXECINSTR)
  	    {
  	      textSections[textSectionCount].lbound = 
! 		fetchQuad(secHdr+16, littleEndian);
  	      textSections[textSectionCount].hbound = 
  		textSections[textSectionCount].lbound
  		+ fetchQuad(secHdr+32, littleEndian) - 1;
*************** readElfFile (PFLOAD func, unsigned* entr
*** 242,248 ****
  	  if (fetchWord(secHdr+8, littleEndian) & SHF_EXECINSTR)
  	    {
  	      textSections[textSectionCount].lbound = 
! 		fetchWord(secHdr+16, littleEndian);
  	      textSections[textSectionCount].hbound = 
  		textSections[textSectionCount].lbound
  		+ fetchWord(secHdr+20, littleEndian) - 1;
--- 242,248 ----
  	  if (fetchWord(secHdr+8, littleEndian) & SHF_EXECINSTR)
  	    {
  	      textSections[textSectionCount].lbound = 
! 		fetchWord(secHdr+12, littleEndian);
  	      textSections[textSectionCount].hbound = 
  		textSections[textSectionCount].lbound
  		+ fetchWord(secHdr+20, littleEndian) - 1;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]