This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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]

Fix readline crash on SHN_ABS relocation


readline crashes when trying to print a relocation against a SHN_ABS
section.  This patch brings the calculation of sec_index in
dump_relocations in line with SECTION_HEADER_INDEX.  Committed as obvious.

Andreas.

2004-08-06  Andreas Schwab  <schwab@suse.de>

	* readelf.c (dump_relocations): Fix typo when calculating
	sec_index.

--- binutils/readelf.c	29 Jul 2004 10:54:25 +0200	1.248
+++ binutils/readelf.c	06 Aug 2004 15:06:36 +0200	
@@ -1225,7 +1225,7 @@ dump_relocations (FILE *file,
 
 		      if (psym->st_shndx < SHN_LORESERVE)
 			sec_index = psym->st_shndx;
-		      else if (psym->st_shndx > SHN_LORESERVE)
+		      else if (psym->st_shndx > SHN_HIRESERVE)
 			sec_index = psym->st_shndx - (SHN_HIRESERVE + 1
 						      - SHN_LORESERVE);
 

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


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