aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfxx-ia64.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2006-03-08 21:24:22 +0000
committerH.J. Lu <hjl.tools@gmail.com>2006-03-08 21:24:22 +0000
commit6d2cf7d80b489bb9c4bee76d3bd30c3a03eb2901 (patch)
tree3e75adabccc879171dee66c6a5038c8a18e31cf9 /bfd/elfxx-ia64.c
parentf1b4b38ecb079e3762826dfc2d4fcc6a9698517d (diff)
downloadgdb-6d2cf7d80b489bb9c4bee76d3bd30c3a03eb2901.zip
gdb-6d2cf7d80b489bb9c4bee76d3bd30c3a03eb2901.tar.gz
gdb-6d2cf7d80b489bb9c4bee76d3bd30c3a03eb2901.tar.bz2
2006-03-08 H.J. Lu <hongjiu.lu@intel.com>
* elfxx-ia64.c (elfNN_ia64_choose_gp): Properly choose gp.
Diffstat (limited to 'bfd/elfxx-ia64.c')
-rw-r--r--bfd/elfxx-ia64.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c
index 7a0cc90..63c1316 100644
--- a/bfd/elfxx-ia64.c
+++ b/bfd/elfxx-ia64.c
@@ -3928,14 +3928,16 @@ elfNN_ia64_choose_gp (abfd, info)
gp_val = got_sec->output_section->vma;
else if (max_short_vma != 0)
gp_val = min_short_vma;
- else
+ else if (max_vma - min_vma < 0x200000)
gp_val = min_vma;
+ else
+ gp_val = max_vma - 0x200000 + 8;
/* If it is possible to address the entire image, but we
don't with the choice above, adjust. */
if (max_vma - min_vma < 0x400000
- && max_vma - gp_val <= 0x200000
- && gp_val - min_vma > 0x200000)
+ && (max_vma - gp_val >= 0x200000
+ || gp_val - min_vma > 0x200000))
gp_val = min_vma + 0x200000;
else if (max_short_vma != 0)
{