public inbox for sid@sourceware.org
 help / color / mirror / Atom feed
* [patch] elf loader detection of code sections
@ 2004-02-23 20:14 Dave Brolley
  0 siblings, 0 replies; only message in thread
From: Dave Brolley @ 2004-02-23 20:14 UTC (permalink / raw)
  To: sid

[-- Attachment #1: Type: text/plain, Size: 160 bytes --]

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


[-- Attachment #2: elfload-1.ChangeLog --]
[-- Type: text/plain, Size: 142 bytes --]

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.


[-- Attachment #3: elfload-1.patch.txt --]
[-- Type: text/plain, Size: 1711 bytes --]

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;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-02-23 20:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-23 20:14 [patch] elf loader detection of code sections Dave Brolley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).