From: H.J. Lu Date: Wed, 8 Mar 2006 21:24:22 +0000 (+0000) Subject: 2006-03-08 H.J. Lu X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6d2cf7d80b489bb9c4bee76d3bd30c3a03eb2901;p=binutils-gdb.git 2006-03-08 H.J. Lu * elfxx-ia64.c (elfNN_ia64_choose_gp): Properly choose gp. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index e91d267a144..855984af639 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,7 @@ +2006-03-08 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_choose_gp): Properly choose gp. + 2006-03-07 Richard Sandiford Daniel Jacobowitz Zack Weinberg diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c index 7a0cc90371e..63c131649b6 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) {