aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfxx-ia64.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2005-08-10 04:32:49 +0000
committerH.J. Lu <hjl.tools@gmail.com>2005-08-10 04:32:49 +0000
commita38a2e96b002d6c07564920566539625d8e550a9 (patch)
tree074a222779a67977f5a360fadac4812f23c02415 /bfd/elfxx-ia64.c
parent3c26c61aa1e17fe8122351f702b5df5c431402c7 (diff)
downloadgdb-a38a2e96b002d6c07564920566539625d8e550a9.zip
gdb-a38a2e96b002d6c07564920566539625d8e550a9.tar.gz
gdb-a38a2e96b002d6c07564920566539625d8e550a9.tar.bz2
2005-08-09 H.J. Lu <hongjiu.lu@intel.com>
* elfxx-ia64.c (elfNN_ia64_final_link): Reset gp.
Diffstat (limited to 'bfd/elfxx-ia64.c')
-rw-r--r--bfd/elfxx-ia64.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c
index 85f715c..140a0c9 100644
--- a/bfd/elfxx-ia64.c
+++ b/bfd/elfxx-ia64.c
@@ -3981,15 +3981,15 @@ elfNN_ia64_final_link (abfd, info)
/* Make sure we've got ourselves a nice fat __gp value. */
if (!info->relocatable)
{
- bfd_vma gp_val = _bfd_get_gp_value (abfd);
+ bfd_vma gp_val;
struct elf_link_hash_entry *gp;
- if (gp_val == 0)
- {
- if (! elfNN_ia64_choose_gp (abfd, info))
- return FALSE;
- gp_val = _bfd_get_gp_value (abfd);
- }
+ /* We assume after gp is set, section size will only decrease. We
+ need to adjust gp for it. */
+ _bfd_set_gp_value (abfd, 0);
+ if (! elfNN_ia64_choose_gp (abfd, info))
+ return FALSE;
+ gp_val = _bfd_get_gp_value (abfd);
gp = elf_link_hash_lookup (elf_hash_table (info), "__gp", FALSE,
FALSE, FALSE);