public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Fix bad gp value in elfNN_ia64_choose_gp
@ 2006-07-26 15:50 Andreas Schwab
  2006-07-26 19:34 ` James E Wilson
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Schwab @ 2006-07-26 15:50 UTC (permalink / raw)
  To: binutils

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."

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Fix bad gp value in elfNN_ia64_choose_gp
  2006-07-26 15:50 Fix bad gp value in elfNN_ia64_choose_gp Andreas Schwab
@ 2006-07-26 19:34 ` James E Wilson
  0 siblings, 0 replies; 2+ messages in thread
From: James E Wilson @ 2006-07-26 19:34 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: binutils

On Wed, 2006-07-26 at 08:50, Andreas Schwab wrote:
> 	* elfxx-ia64.c (elfNN_ia64_choose_gp): Use rawsize if set.

Thanks.  This is good.

I see that it was changed from _raw_size to size via a large rewrite,
and this large rewrite failed to recognize that this is a relax related
function, and hence should have used rawsize in the first place.
-- 
Jim Wilson, GNU Tools Support, http://www.specifix.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-07-26 19:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-26 15:50 Fix bad gp value in elfNN_ia64_choose_gp Andreas Schwab
2006-07-26 19:34 ` James E Wilson

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).