This is the mail archive of the binutils@sourceware.org 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 bad gp value in elfNN_ia64_choose_gp


elfNN_ia64_choose_gp chooses a bad gp value because os->size is not set
until final link.  If .sbss is very large the gp value chosen during final
link will vary wildly from the chosen value during the relaxation pass and
some of the relaxed GPREL22 relocations may overflow.

Andreas.

2006-07-26  Andreas Schwab  <schwab@suse.de>

	* elfxx-ia64.c (elfNN_ia64_choose_gp): Use rawsize if set.

--- bfd/elfxx-ia64.c.~1.187.~	2006-07-06 17:26:47.000000000 +0200
+++ bfd/elfxx-ia64.c	2006-07-26 17:36:03.000000000 +0200
@@ -4366,7 +4366,7 @@ elfNN_ia64_choose_gp (abfd, info)
 	continue;
 
       lo = os->vma;
-      hi = os->vma + os->size;
+      hi = os->vma + (os->rawsize ? os->rawsize : os->size);
       if (hi < lo)
 	hi = (bfd_vma) -1;
 

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP 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]